diff options
author | Julien Dessaux | 2011-05-11 00:17:10 +0200 |
---|---|---|
committer | Julien Dessaux | 2011-05-11 00:17:10 +0200 |
commit | 27df2808fc4618699abf6b8b8fcd88de26615bb6 (patch) | |
tree | 5c0b5f60c5ecd020f7976cbf5328e42693f3bf56 | |
parent | Improving a bit the Ping module's code. (diff) | |
download | hsbot-27df2808fc4618699abf6b8b8fcd88de26615bb6.tar.gz hsbot-27df2808fc4618699abf6b8b8fcd88de26615bb6.tar.bz2 hsbot-27df2808fc4618699abf6b8b8fcd88de26615bb6.zip |
Added a function to get the destination channel of a message.
-rw-r--r-- | Hsbot/Message.hs | 6 | ||||
-rw-r--r-- | hsbot.cabal | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/Hsbot/Message.hs b/Hsbot/Message.hs index dd15f75..9bb77f1 100644 --- a/Hsbot/Message.hs +++ b/Hsbot/Message.hs @@ -1,6 +1,7 @@ module Hsbot.Message ( answerMsg , getCommand + , getDestination , readMsg , writeMsg ) where @@ -36,3 +37,8 @@ getCommand (IRC.Message _ _ (_:msg:[])) = do else return [] getCommand _ = return [] +-- | Get the destination of a message +getDestination :: IRC.Message -> String +getDestination (IRC.Message _ _ (dest:_:[])) = dest +getDestination _ = "" + diff --git a/hsbot.cabal b/hsbot.cabal index f92af2d..50536d0 100644 --- a/hsbot.cabal +++ b/hsbot.cabal @@ -1,5 +1,5 @@ Name: hsbot -Version: 0.4.12 +Version: 0.4.13 Cabal-version: >=1.2 Synopsis: A multipurposes IRC bot Description: |