blob: 470dd339784a9a6a179fe65b5d37623eb9916e17 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
{-# LANGUAGE OverloadedStrings #-}
module Plugin.Help
( help
) where
import qualified Data.Text as T
import qualified Plugin.PluginList as PL (plugins)
import Plugin.Base
help = Plugin
{ matchRegex = "^help$"
, perform = helpAction
, command = "help"
, description = "Show a list of available bot commands."
}
helpAction :: PluginAction
helpAction _ = do
return $ Right $ T.intercalate "\n"
[command p `T.append` " – " `T.append` description p | p <- plugins]
plugins :: [Plugin]
plugins = PL.plugins ++ [help]
|