From c1313130a89b5141b5efe40835ba993bf3f44205 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Tue, 20 Apr 2004 11:19:31 +0000 Subject: [PATCH] Added a monologue command. --- plugins/Fun.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/plugins/Fun.py b/plugins/Fun.py index b86da23f6..0c80c6e9c 100644 --- a/plugins/Fun.py +++ b/plugins/Fun.py @@ -356,6 +356,25 @@ class Fun(callbacks.Privmsg): else: irc.reply('*click*') + def monologue(self, irc, msg, args): + """[] + + Returns the number of consecutive lines you've sent in + without being interrupted by someone else (i.e. how long your current + 'monologue' is). is only necessary if the message isn't sent + in the channel itself. + """ + i = 0 + for m in reversed(irc.state.history): + if m.command != 'PRIVMSG' or not m.prefix: + continue + elif msg.prefix == m.prefix: + i += 1 + else: + break + iS = utils.nItems('line', i) + irc.reply('Your current monologue is at least %s long.' % iS) + Class = Fun