From 8b33600f3818edd9aa9dedfa7a9a03d6e2af3276 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Mon, 24 May 2010 23:50:59 +0200 Subject: Implemented update message handling in the bot's core. --- Hsbot/PluginUtils.hs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Hsbot/PluginUtils.hs (limited to 'Hsbot/PluginUtils.hs') diff --git a/Hsbot/PluginUtils.hs b/Hsbot/PluginUtils.hs new file mode 100644 index 0000000..d09b3b4 --- /dev/null +++ b/Hsbot/PluginUtils.hs @@ -0,0 +1,15 @@ +module Hsbot.PluginUtils + ( sendToPlugin + ) where + +import Control.Concurrent +import Control.Concurrent.Chan () +import Control.Monad.State + +import Hsbot.Types + +-- | Sends a msg to a plugin +sendToPlugin :: BotMsg -> PluginState -> Bot () +sendToPlugin botMsg plugin = do + liftIO $ writeChan (pluginChan plugin) botMsg + -- cgit v1.2.3