Safe Haskell | None |
---|---|
Language | Haskell2010 |
The module gives access to the message count. For each channel with counting enabled, the counter system maintains a log which lists counts of message made in the channel, and user join/part events. This log can then be used to determine how many messages were made between events.
- startCountingAll :: Session e s ()
- startCountingChan :: String -> Session e s ()
- startCountingChans :: [String] -> Session e s ()
- stopCountingAll :: Session e s ()
- stopCountingChan :: String -> Session e s ()
- stopCountingChans :: [String] -> Session e s ()
- getCountLogs :: Session e s (HashMap String (Seq MsgCountEntry))
- getCountLog :: String -> Session e s (Seq MsgCountEntry)
- chanIsCounted :: String -> Session e s Bool
- everParted :: String -> String -> Session e s Bool
- everJoined :: String -> String -> Session e s Bool
- countMsgs :: Seq MsgCountEntry -> Int
- msgsSinceParted :: String -> String -> Session e s (Either Int Int)
Counter Control
startCountingAll :: Session e s () Source
Start counting in all the channels the bot has joined which aren't being counted.
startCountingChan :: String -> Session e s () Source
Start counting in the given channel, if not counted already.
startCountingChans :: [String] -> Session e s () Source
Start counting in the channels not counted, among the ones given.
stopCountingAll :: Session e s () Source
Stop counting in all counted channels.
stopCountingChan :: String -> Session e s () Source
Stop counting in the given channel, if counted.
stopCountingChans :: [String] -> Session e s () Source
Stop counting in the counted channels among the ones given.
Queries
getCountLogs :: Session e s (HashMap String (Seq MsgCountEntry)) Source
Get a mapping between channel names and sequences of their message counting data.
getCountLog :: String -> Session e s (Seq MsgCountEntry) Source
Get the count log for a specific channel. If there is none, an empty log is returned.
chanIsCounted :: String -> Session e s Bool Source
Check whether a given channel is being counted.
everParted :: String -> String -> Session e s Bool Source
Check whether a given user ever parted the channel, as far as the count log remembers.
everJoined :: String -> String -> Session e s Bool Source
Check whether a given user ever joined the channel, as far as the count log remembers.
countMsgs :: Seq MsgCountEntry -> Int Source
Determine how many messages a log sequence has recorded.