Added the quote quick command.
This commit is contained in:
parent
8bbe88a078
commit
d33ab441f8
3 changed files with 14 additions and 4 deletions
|
@ -105,6 +105,16 @@ runCommand intCmd
|
||||||
-- | quote command dispatcher
|
-- | quote command dispatcher
|
||||||
dispatchQuoteCmd :: String -> QuoteBot ()
|
dispatchQuoteCmd :: String -> QuoteBot ()
|
||||||
dispatchQuoteCmd cmd
|
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
|
| cmd == "start" = do
|
||||||
quoteBot <- get
|
quoteBot <- get
|
||||||
now <- liftIO $ getCurrentTime
|
now <- liftIO $ getCurrentTime
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
Name: hsbot-irc
|
Name: hsbot-irc
|
||||||
Version: 0.3
|
Version: 0.3.10
|
||||||
Cabal-version: >=1.2
|
Cabal-version: >=1.2
|
||||||
Synopsis: The irc part of a multi-purposes bot.
|
Synopsis: The irc part of a multi-purposes bot.
|
||||||
Description:
|
Description:
|
||||||
|
|
6
TODO
6
TODO
|
@ -1,9 +1,9 @@
|
||||||
:julien!~julien@ogu21.corp PRIVMSG #shbot :@quote graou snif
|
:julien!~julien@ogu21.corp PRIVMSG #shbot :@quote graou snif
|
||||||
|
|
||||||
* Design another way to launch and manage hsbot and it's configuration
|
* Improve configuration file errors display
|
||||||
* Improved 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
|
* write the vote system for the quote module
|
||||||
* only the quote reporter should be able to edit it
|
* only the quote reporter should be able to edit it
|
||||||
* detect too identical quoting in a raw, or implement quote abort
|
* detect too identical quoting in a raw, or implement quote abort
|
||||||
|
|
Reference in a new issue