Implemented update message handling in the bot's core.
This commit is contained in:
parent
a12e492772
commit
8b33600f38
9 changed files with 161 additions and 64 deletions
15
Hsbot/PluginUtils.hs
Normal file
15
Hsbot/PluginUtils.hs
Normal file
|
@ -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
|
||||
|
Reference in a new issue