The danibot package

[ Tags: library, mit, network, program ] [ Propose Tags ]

[Skip to Readme]

Properties

Versions 0.2.0.0
Change log CHANGELOG
Dependencies aeson (>=0.11.0.0), async (>=2.1.0), attoparsec (>=0.13), base (>=4.7 && <5), bytestring (>=0.10.6.0), conceit (>=0.4.0.0), containers (>=0.5), danibot, foldl (>=1.1.5), lens (>=4.5), lens-aeson (>=1.0.0.0), monoid-subclasses (>=0.4.2), network (>=2.6), optparse-applicative (>=0.12.1.0), stm (>=2.4.4), streaming (>=0.1.4), text (>=1.2.2.0), transformers (>=0.4.3.0), websockets (>=0.9.6.0), wreq (>=0.4.1.0), wuss (>=1.0.2) [details]
License MIT
Copyright 2015 Daniel Diaz
Author Daniel Diaz
Maintainer diaz_carrete@yahoo.com
Category Network
Bug tracker https://github.com/danidiaz/danibot/issues
Source repository head: git clone git@github.com:danidiaz/danibot.git
Uploaded Sat Mar 19 08:43:23 UTC 2016 by DanielDiazCarrete
Distributions NixOS:0.2.0.0
Executables danibot
Downloads 91 total (7 in the last 30 days)
Rating 0.0 (0 ratings) [clear rating]
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]
Hackage Matrix CI

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for danibot-0.2.0.0

[back to package description]

A very basic framework for creating Slack bots.

The bot will respond to messages in IM channels, and also to messages explicitly directed at him in general channels (@nameofthebot: some message).

The bot reads the Slack api token from the environment variable "DANIBOT_SLACK_API_TOKEN".

The default danibot executable comes with a few example handlers:

  • up? host port

    Checks if a port is open in a host.

  • lookup key

    Checks the value of key in a dictionary that is loaded at startup with the --dict parameter. The dictionary is a json object with string values.

  • help

    Lists available options.

Right now the bot ignores most chat events apart from messages.

To create your own customized bot, import Network.Danibot.Main and pass a value of type IO (Either String (Text -> IO Text)) to mainWith, where Text -> IO Text is the type of the handler function.