diff options
author | Julien Dessaux | 2010-08-22 17:57:30 +0200 |
---|---|---|
committer | Julien Dessaux | 2010-08-22 18:15:14 +0200 |
commit | d33ab441f876620171ff70762069efb378824562 (patch) | |
tree | 65ad9c9086c22592fb422ec4d15c08f2f938463c | |
parent | Improved message dispatching in core. (diff) | |
download | hsbot-d33ab441f876620171ff70762069efb378824562.tar.gz hsbot-d33ab441f876620171ff70762069efb378824562.tar.bz2 hsbot-d33ab441f876620171ff70762069efb378824562.zip |
Added the quote quick command.
-rw-r--r-- | HsbotIrcBot/Hsbot/Irc/Plugin/Quote.hs | 10 | ||||
-rw-r--r-- | HsbotIrcBot/hsbot-irc.cabal | 2 | ||||
-rw-r--r-- | TODO | 6 |
3 files changed, 14 insertions, 4 deletions
diff --git a/HsbotIrcBot/Hsbot/Irc/Plugin/Quote.hs b/HsbotIrcBot/Hsbot/Irc/Plugin/Quote.hs index 0335d8b..81c3794 100644 --- a/HsbotIrcBot/Hsbot/Irc/Plugin/Quote.hs +++ b/HsbotIrcBot/Hsbot/Irc/Plugin/Quote.hs @@ -105,6 +105,16 @@ runCommand intCmd -- | quote command dispatcher dispatchQuoteCmd :: String -> QuoteBot () dispatchQuoteCmd cmd + | cmd == "quick" = do + quoteBot <- get + now <- liftIO $ getCurrentTime + let sender = takeWhile (/= '!') $ fromMaybe "ARGH" (ircMsgPrefix request) + newQuote = Quote sender [(quoteElt stuff)] now 0 + quoteId = nextQuoteId quoteBot + quoteBotDB' = M.insert quoteId newQuote (quoteBotDB quoteBot) + put $ quoteBot { nextQuoteId = quoteId + 1, quoteBotDB = quoteBotDB' } + lift $ answerMsg request ("New quoteId : " ++ show quoteId) + syncQuoteBot | cmd == "start" = do quoteBot <- get now <- liftIO $ getCurrentTime diff --git a/HsbotIrcBot/hsbot-irc.cabal b/HsbotIrcBot/hsbot-irc.cabal index 861e506..5e9d7d0 100644 --- a/HsbotIrcBot/hsbot-irc.cabal +++ b/HsbotIrcBot/hsbot-irc.cabal @@ -1,5 +1,5 @@ Name: hsbot-irc -Version: 0.3 +Version: 0.3.10 Cabal-version: >=1.2 Synopsis: The irc part of a multi-purposes bot. Description: @@ -1,9 +1,9 @@ :julien!~julien@ogu21.corp PRIVMSG #shbot :@quote graou snif -* Design another way to launch and manage hsbot and it's configuration -* Improved configuration file errors display +* Improve configuration file errors display +* fork process in background +* implement logging capabilities -* implement quick quoting for one line quotes * write the vote system for the quote module * only the quote reporter should be able to edit it * detect too identical quoting in a raw, or implement quote abort |