summaryrefslogtreecommitdiff
path: root/HsbotMaster/Hsbot/PluginUtils.hs
blob: d09b3b43409090551b505143ee61655562617138 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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