danibot: Basic Slack bot framework.

[ library, mit, network, program ] [ Propose Tags ] [ Report a vulnerability ]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 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 repo head: git clone git@github.com:danidiaz/danibot.git
Uploaded by DanielDiazCarrete at 2016-03-19T08:43:23Z
Distributions
Executables danibot
Downloads 894 total (1 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

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.