irc-fun-bot-0.5.0.0: Library for writing fun IRC bots.

Safe HaskellNone
LanguageHaskell2010

Network.IRC.Fun.Bot.MsgCount

Contents

Description

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.

Synopsis

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.

msgsSinceParted :: String -> String -> Session e s (Either Int Int) Source

Find out how many messages the channel had since the given user parted it. On success, return Right it. Otherwise, i.e. if no parting of the user is recorded, return Left the total recorded messages.