summaryrefslogtreecommitdiff
path: root/Hsbot/Message.hs
diff options
context:
space:
mode:
authorJulien Dessaux2011-05-06 19:15:40 +0200
committerJulien Dessaux2011-05-06 19:15:40 +0200
commita8c0c8578718098e7a0482678ab727533ee09862 (patch)
treec9a1d07d47e6089ba1fadacf595fd9dd8039a03e /Hsbot/Message.hs
parentAdded a shitload of ducks to recognize and kill! (diff)
downloadhsbot-a8c0c8578718098e7a0482678ab727533ee09862.tar.gz
hsbot-a8c0c8578718098e7a0482678ab727533ee09862.tar.bz2
hsbot-a8c0c8578718098e7a0482678ab727533ee09862.zip
Made the Plugin monad a Reader instead of a State since it can't change.
Diffstat (limited to 'Hsbot/Message.hs')
-rw-r--r--Hsbot/Message.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/Hsbot/Message.hs b/Hsbot/Message.hs
index 1382098..d6697cd 100644
--- a/Hsbot/Message.hs
+++ b/Hsbot/Message.hs
@@ -5,17 +5,17 @@ module Hsbot.Message
) where
import Control.Concurrent
-import Control.Monad.State
+import Control.Monad.Reader
import qualified Network.IRC as IRC
import Hsbot.Types
-- Plugin Utils
readMsg :: Plugin (Env IO) Message
-readMsg = gets pluginChan >>= liftIO . readChan
+readMsg = asks pluginChan >>= liftIO . readChan
writeMsg :: Message -> Plugin (Env IO) ()
-writeMsg msg = gets pluginMaster >>= liftIO . flip writeChan msg
+writeMsg msg = asks pluginMaster >>= liftIO . flip writeChan msg
answerMsg :: IRC.Message -> String -> Plugin (Env IO) ()
answerMsg request msg =