X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~matthewv/git?a=blobdiff_plain;f=commands.py;h=bb24cac2d0e4c4c7a247da5528fe0008aaf84483;hb=3a808bb740593679a63d7d8395ff61e73f1f0970;hp=02f23034a2428f5f45aa4fb1ac9cc69b4e1ff755;hpb=7f220458d4eee0b8b8f90d6e566b74d6e8c4b9e7;p=irc.git diff --git a/commands.py b/commands.py index 02f2303..bb24cac 100755 --- a/commands.py +++ b/commands.py @@ -60,6 +60,10 @@ class FishPond: fishpond.DoS=0 fishpond.quotatime=0 + def note_last(fishpond, msg, cfg): + fishpond.last=msg + fishpond.last_cfg=cfg + # Check on fish stocks def fish_quota(pond): if pond.DoS: @@ -100,8 +104,7 @@ def troutq(bot, cmd, nick, conn, public, cfg): return me = bot.connection.get_nickname() trout_msg = random.choice(fishlist) - fishpond.last=trout_msg - fishpond.last_cfg=cfg + fishpond.note_last(trout_msg,cfg) # The bot won't trout or flirt with itself; if irc_lower(me) == irc_lower(target) or irc_lower(target) in synonyms: target = nick @@ -142,8 +145,7 @@ def slashq(bot, cmd, nick, conn, public, cfg): return me = bot.connection.get_nickname() slash_msg = random.choice(fishlist) - fishpond.last=slash_msg - fishpond.last_cfg=cfg + fishpond.note_last(slash_msg,cfg) # The bot won't slash people with themselves if irc_lower(who[0]) == irc_lower(who[1]): conn.notice(nick, "oooooh no missus!")