Added the ability to directly answer /msg.
This commit is contained in:
parent
b3d04f9a06
commit
fa0bf06c91
2 changed files with 6 additions and 5 deletions
|
@ -18,8 +18,9 @@ writeMsg :: Message -> Plugin (Env IO) ()
|
||||||
writeMsg msg = asks pluginMaster >>= liftIO . flip writeChan msg
|
writeMsg msg = asks pluginMaster >>= liftIO . flip writeChan msg
|
||||||
|
|
||||||
answerMsg :: IRC.Message -> String -> Plugin (Env IO) ()
|
answerMsg :: IRC.Message -> String -> Plugin (Env IO) ()
|
||||||
answerMsg request msg =
|
answerMsg _ [] = return ()
|
||||||
case IRC.msg_params request of
|
answerMsg (IRC.Message (Just (IRC.NickName nick _ _)) _ (channel:_)) msg
|
||||||
sender:_ -> writeMsg . OutgoingMsg $ IRC.Message Nothing "PRIVMSG" [sender, msg]
|
| head channel == '#' = writeMsg . OutgoingMsg $ IRC.Message Nothing "PRIVMSG" [channel, msg]
|
||||||
[] -> return ()
|
| otherwise = writeMsg . OutgoingMsg $ IRC.Message Nothing "PRIVMSG" [nick, msg]
|
||||||
|
answerMsg _ _ = return ()
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
Name: hsbot
|
Name: hsbot
|
||||||
Version: 0.4.10
|
Version: 0.4.11
|
||||||
Cabal-version: >=1.2
|
Cabal-version: >=1.2
|
||||||
Synopsis: A multipurposes IRC bot
|
Synopsis: A multipurposes IRC bot
|
||||||
Description:
|
Description:
|
||||||
|
|
Reference in a new issue