| Safe Haskell | None |
|---|
Network.Haskbot
Contents
Description
A minimal Haskbot server can be run via:
{-# LANGUAGE OverloadedStrings #-}
import Network.Haskbot
import Network.Haskbot.Config
import Network.Haskbot.Plugin
import qualified Network.Haskbot.Plugin.Help as Help
main :: IO ()
main = haskbot config registry
config :: Config
config = Config { listenOn = 3000
, incEndpoint = "https://my-company.slack.com/services/hooks/incoming-webhook"
, incToken = "my-incoming-token"
}
registry :: [Plugin]
registry = [ Help.register registry "my-slash-token" ]
This will run Haskbot on port 3000 with the included
Network.Haskbot.Plugin.Help plugin installed, where "my-slash-token"
is the secret token of a Slack slash command integration corresponding to
the /haskbot command and pointing to the Haskbot server.
Be sure to create a Slack incoming integration (usually named Haskbot)
and set the incEndpoint and incToken to their corresponding values, so
that Slack can receive replies from Haskbot.