summaryrefslogtreecommitdiff
path: root/Hsbot/Types.hs
diff options
context:
space:
mode:
authorJulien Dessaux2010-02-04 20:40:16 +0100
committerJulien Dessaux2010-02-04 20:40:16 +0100
commitcf68de02be3e9695c95b0d1fafdab5ab2c0fc5f7 (patch)
tree977286771d0f9e126ae599af01a63e06b3c67d2d /Hsbot/Types.hs
parentFinished changing plugin data structure to Maps. (diff)
downloadhsbot-cf68de02be3e9695c95b0d1fafdab5ab2c0fc5f7.tar.gz
hsbot-cf68de02be3e9695c95b0d1fafdab5ab2c0fc5f7.tar.bz2
hsbot-cf68de02be3e9695c95b0d1fafdab5ab2c0fc5f7.zip
Added command registering and dispatching for plugins.
Diffstat (limited to 'Hsbot/Types.hs')
-rw-r--r--Hsbot/Types.hs22
1 files changed, 11 insertions, 11 deletions
diff --git a/Hsbot/Types.hs b/Hsbot/Types.hs
index 7a37035..5522404 100644
--- a/Hsbot/Types.hs
+++ b/Hsbot/Types.hs
@@ -22,10 +22,10 @@ import System.Time (ClockTime)
-- | TODO : a monad for a channel, and a monad for a server, all together driven by a Bot?
-- | Configuration data type
-data Config = Config {
- commandPrefixes :: String, -- command prefixes, for example @[\'>\',\'@\',\'?\']@
- ircServer :: IrcServer -- list of 'Server's to connect to
-} deriving (Show)
+data Config = Config
+ { commandPrefix :: Char -- command prefixes, for example @[\'>\',\'@\',\'?\']@
+ , ircServer :: IrcServer -- list of 'Server's to connect to
+ } deriving (Show)
-- | An IRC server
data IrcServer = IrcServer
@@ -76,19 +76,19 @@ data Channel = Channel
, channelAdmins :: [String] -- the bot administrators
} deriving (Show)
--- | A Bot command
-data IntCmd = IntCmd
- { intCmd :: String -- the bot's internal command
- , intCmdParams :: [String] -- the parameters
- } deriving (Show)
-
--- |An IRC message.
+-- | An IRC message
data IrcMsg = IrcMsg
{ prefix :: Maybe String -- the message prefix
, command :: String -- the message command
, parameters :: [String] -- the message parameters
} deriving (Show)
+-- | An internal command
+data IntCmd = IntCmd
+ { intCmd :: String -- the internal command
+ , intMsg :: IrcMsg -- the IrcMsg associated with the command
+ }
+
-- | A plugin definition
data Plugin = Plugin
{ pluginName :: String -- The plugin's name