summaryrefslogtreecommitdiff
path: root/Hsbot/Message.hs
diff options
context:
space:
mode:
authorJulien Dessaux2011-05-01 03:11:32 +0200
committerJulien Dessaux2011-05-01 03:28:28 +0200
commitc497b24700eeea4269e4d76559e8023284a0a213 (patch)
tree9d09a769232cb93e3987f999f12a3203b81443b1 /Hsbot/Message.hs
parentImproved message utilities. (diff)
downloadhsbot-c497b24700eeea4269e4d76559e8023284a0a213.tar.gz
hsbot-c497b24700eeea4269e4d76559e8023284a0a213.tar.bz2
hsbot-c497b24700eeea4269e4d76559e8023284a0a213.zip
Added plugin loading, and the most basic hook capability.
Diffstat (limited to '')
-rw-r--r--Hsbot/Message.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/Hsbot/Message.hs b/Hsbot/Message.hs
index e95c3e7..133ff92 100644
--- a/Hsbot/Message.hs
+++ b/Hsbot/Message.hs
@@ -11,13 +11,13 @@ import qualified Network.IRC as IRC
import Hsbot.Types
-- Plugin Utils
-readMsg :: Plugin IO (Message)
+readMsg :: Plugin (Env IO) (Message)
readMsg = gets pluginChan >>= liftIO . readChan >>= return
-writeMsg :: Message -> Plugin IO ()
+writeMsg :: Message -> Plugin (Env IO) ()
writeMsg msg = gets pluginMaster >>= liftIO . flip writeChan msg
-answerMsg :: IRC.Message -> String -> Plugin IO ()
+answerMsg :: IRC.Message -> String -> Plugin (Env IO) ()
answerMsg request msg =
case IRC.msg_params request of
sender:_ -> writeMsg . OutgoingMsg $ IRC.Message Nothing "PRIVMSG" [sender, msg]