From: Vincent Le Gallic Date: Fri, 24 May 2013 21:51:33 +0000 (+0200) Subject: On ignore les bots de jben X-Git-Url: http://gitweb.pimeys.fr/?p=bots%2Fsaturnin.git;a=commitdiff_plain;h=b71142838d23a2e278774665a825e80a11a9bb6f On ignore les bots de jben --- 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: