From cf68de02be3e9695c95b0d1fafdab5ab2c0fc5f7 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Thu, 4 Feb 2010 20:40:16 +0100 Subject: Added command registering and dispatching for plugins. --- Hsbot/Types.hs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'Hsbot/Types.hs') 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 -- cgit v1.2.3