haskbot-core-0.0.1.0: Easily-extensible chatbot for Slack messaging service

Safe HaskellNone

Network.Haskbot

Contents

Description

 {-# LANGUAGE OverloadedStrings #-}

 import Network.Haskbot
 import Network.Haskbot.Plugin
 import qualified Slack.Haskbot.Plugin.Help as Help

 main :: IO ()
 main = haskbot registry 3000

 registry :: [Plugin]
 registry = [ Help.register registry "my_secret_token" ]

This will run Haskbot on port 3000 with the included Help plugin installed, where "my_secret_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) with the local HASKBOT_ENDPOINT environment variable set to the integration's endpoint URL (including the secret key query string), so that Slack can process replies from Haskbot.

Synopsis

Run a Haskbot server

haskbotSource

Arguments

:: [Plugin]

List of all Haskbot plugins to include

-> Int

Port on which to run Haskbot server

-> IO () 

Run a Haskbot server with the listed plugins on the specified port.