File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -44,14 +44,13 @@ currentAsciifyState = do
4444 Just state -> return state
4545 Nothing -> createEntity Proxy =<< AsciifyState <$> now
4646
47- asciifyCooldown :: Reaction Message a -> Reaction Message a
48- asciifyCooldown next =
47+ asciifyCooldown :: NominalDiffTime -> Reaction Message a -> Reaction Message a
48+ asciifyCooldown cooldown next =
4949 Reaction $ \ msg -> do
5050 state <- currentAsciifyState
5151 currentTime <- now
5252 let diff =
5353 diffUTCTime currentTime $ asciifyStateLastUsed $ entityPayload state
54- let cooldown = 2 * 60
5554 if diff > cooldown
5655 then do
5756 void $ updateEntityById $ AsciifyState currentTime <$ state
@@ -69,7 +68,7 @@ asciifyReaction =
6968 bttv <- bttvUrlByName name
7069 return (ffz <|> bttv)) $
7170 replyOnNothing " Such emote does not exist" $
72- asciifyCooldown $
71+ asciifyCooldown 60 $
7372 byteStringHttpRequestReaction $
7473 cmapR (braillizeByteString . BSL. toStrict) $
7574 eitherReaction (Reaction (logMsg . T. pack . messageContent)) $
You can’t perform that action at this time.
0 commit comments