Code cleaning.
This commit is contained in:
parent
9abbc593a2
commit
4522289d55
3 changed files with 14 additions and 6 deletions
|
@ -75,10 +75,10 @@ runHsbot = do
|
||||||
-- Then we join channels
|
-- Then we join channels
|
||||||
mapM_ (liftIO . sendStr connhdl tlsCtx . IRC.encode . IRC.joinChan) channels
|
mapM_ (liftIO . sendStr connhdl tlsCtx . IRC.encode . IRC.joinChan) channels
|
||||||
-- Finally we set the new bot state
|
-- Finally we set the new bot state
|
||||||
asks envBotState >>= liftIO . (flip putMVar BotState { botPlugins = M.empty
|
asks envBotState >>= liftIO . flip putMVar BotState { botPlugins = M.empty
|
||||||
, botHooks = []
|
, botHooks = []
|
||||||
, botChannels = channels
|
, botChannels = channels
|
||||||
, botNickname = nickname })
|
, botNickname = nickname }
|
||||||
-- | Run the bot itself
|
-- | Run the bot itself
|
||||||
trueRunHsbot :: Env IO BotStatus
|
trueRunHsbot :: Env IO BotStatus
|
||||||
trueRunHsbot = do
|
trueRunHsbot = do
|
||||||
|
|
|
@ -13,7 +13,7 @@ import Hsbot.Types
|
||||||
loadPlugin :: PluginId -> Env IO ()
|
loadPlugin :: PluginId -> Env IO ()
|
||||||
loadPlugin pId = do
|
loadPlugin pId = do
|
||||||
botMVar <- asks envBotState
|
botMVar <- asks envBotState
|
||||||
(liftIO $ takeMVar botMVar) >>= execStateT effectivelyLoadPlugin >>= liftIO . putMVar botMVar
|
liftIO (takeMVar botMVar) >>= execStateT effectivelyLoadPlugin >>= liftIO . putMVar botMVar
|
||||||
where
|
where
|
||||||
effectivelyLoadPlugin :: Bot (Env IO) ()
|
effectivelyLoadPlugin :: Bot (Env IO) ()
|
||||||
effectivelyLoadPlugin = do
|
effectivelyLoadPlugin = do
|
||||||
|
|
10
TODO
10
TODO
|
@ -1,8 +1,16 @@
|
||||||
|
* owner rights
|
||||||
|
* better hooks?
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
:julien!~julien@ogu21.corp PRIVMSG #shbot :@quote graou snif
|
:julien!~julien@ogu21.corp PRIVMSG #shbot :@quote graou snif
|
||||||
|
|
||||||
* Improve configuration file errors display
|
* Improve configuration file errors display
|
||||||
* fork process in background
|
* fork process in background
|
||||||
* implement logging capabilities
|
|
||||||
|
|
||||||
* add a function to answer by /msg to somebody
|
* add a function to answer by /msg to somebody
|
||||||
* write the vote system for the quote module
|
* write the vote system for the quote module
|
||||||
|
|
Reference in a new issue