From b71142838d23a2e278774665a825e80a11a9bb6f Mon Sep 17 00:00:00 2001 From: Vincent Le Gallic Date: Fri, 24 May 2013 23:51:33 +0200 Subject: [PATCH] On ignore les bots de jben --- config.py | 2 ++ saturnin.py | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/config.py b/config.py index 6c72e86..4f97263 100644 --- a/config.py +++ b/config.py @@ -97,3 +97,5 @@ u"Are you the farmer?", times_up_delays = [60*10, 60*20] times_up_sentences = [u"I stayed alive, you're too slow !!!"] + +ignored_pseudos = r'^Soldat\d+$' diff --git a/saturnin.py b/saturnin.py index 3438020..f2b432c 100755 --- a/saturnin.py +++ b/saturnin.py @@ -306,6 +306,11 @@ class Saturnin(ircbot.SingleServerIRCBot): log(self.serveur,"priv",auteur," ".join(message)+"[failed]") else: notunderstood=True + elif cmd=="status": + if auteur in self.ops: + serv.privmsg(auteur,"Status : %s" % (self.status, )) + else: + notunderstood=True elif cmd=="spawn": if auteur in self.ops: if len(message)>1: @@ -445,6 +450,8 @@ class Saturnin(ircbot.SingleServerIRCBot): def on_pubmsg(self, serv, ev): auteur = irclib.nm_to_n(ev.source()) + if re.match(config.ignored_pseudos, auteur): + return channel = ev.target() message = ev.arguments()[0] try: -- 2.39.2