Archived
1
0
Fork 0
This repository has been archived on 2025-03-10. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
hsbot/Hsbot/PluginUtils.hs

15 lines
325 B
Haskell

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