diff options
author | Julien Dessaux | 2010-04-22 00:05:35 +0200 |
---|---|---|
committer | Julien Dessaux | 2010-04-22 00:10:13 +0200 |
commit | d922240e9a28680d48014604576620d7fc5aa605 (patch) | |
tree | 60185f299eebb04d8da9b79e9afd011d6147e411 /Hsbot/IRCPlugin.hs | |
parent | Make the main thread exit cleanly in case of connection loss. (diff) | |
download | hsbot-d922240e9a28680d48014604576620d7fc5aa605.tar.gz hsbot-d922240e9a28680d48014604576620d7fc5aa605.tar.bz2 hsbot-d922240e9a28680d48014604576620d7fc5aa605.zip |
Wrote the list plugin command.
Diffstat (limited to 'Hsbot/IRCPlugin.hs')
-rw-r--r-- | Hsbot/IRCPlugin.hs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Hsbot/IRCPlugin.hs b/Hsbot/IRCPlugin.hs index 568eb1d..c32d24c 100644 --- a/Hsbot/IRCPlugin.hs +++ b/Hsbot/IRCPlugin.hs @@ -1,6 +1,7 @@ module Hsbot.IRCPlugin ( readMsg , sendCommand + , sendCommandWithRequest , sendRegisterCommand , sendUnregisterCommand , writeMsg @@ -25,10 +26,13 @@ writeMsg botMsg = do -- | Commands management sendCommand :: String -> String -> String -> IrcPlugin () -sendCommand cmd to params = do +sendCommand cmd to params = sendCommandWithRequest cmd to params Nothing + +sendCommandWithRequest :: String -> String -> String -> Maybe IrcMsg -> IrcPlugin () +sendCommandWithRequest cmd to params originalRequest = do serverChan <- gets instanceServerChan from <- gets instanceName - liftIO $ writeChan serverChan $ InternalCmd $ IntCmd cmd from to params Nothing + liftIO $ writeChan serverChan $ InternalCmd $ IntCmd cmd from to params originalRequest sendRegisterCommand :: String -> IrcPlugin () sendRegisterCommand cmd = sendCommand "REGISTER" "CORE" cmd |