From: Vincent Le Gallic Date: Sun, 6 Mar 2016 19:20:34 +0000 (+0100) Subject: Triggers on "allah is doing" X-Git-Url: http://gitweb.pimeys.fr/?p=bots%2Fjosh.git;a=commitdiff_plain;h=6efcdfdce3131d283fe3ba9089d8f22187b3ffdb Triggers on "allah is doing" --- diff --git a/config.py b/config.py index d9e3007..056b5c9 100644 --- a/config.py +++ b/config.py @@ -44,7 +44,7 @@ leave_fail_messages = quit_fail_messages pas_programme_pour_tobeir = [u"Encore eût-il fallu que je fusse programmé pour vous obéir !"] #: Allah regexp -allah_triggers = [".*is not doing allah is doing"] +allah_triggers = ["is not doing allah is doing"] #: Aide sur les commandes helpdico = { diff --git a/isit.py b/isit.py index 07c81dc..ac1da5d 100644 --- a/isit.py +++ b/isit.py @@ -40,3 +40,7 @@ regexp_compile() def is_tag(chain): """Vérifie si ``chain`` demande de fermer sa gueule.""" return is_something(chain, config.tag_regexp_compiled) + +def is_allah(chain): + """Vérifie si ``chain``est du allah-spam.""" + return is_something(chain, config.allah_regexp_compiled) diff --git a/josh.py b/josh.py index e4c4da1..98fc4a0 100755 --- a/josh.py +++ b/josh.py @@ -398,6 +398,8 @@ class Josh(ircbot.SingleServerIRCBot): answer = random.choice(config.tag_answers) for ligne in answer.split("\n"): serv.privmsg(canal, "%s: %s" % (auteur, ligne.encode("utf8"))) + if isit.is_allah(message): + serv.kick(canal, auteur, u"Please go spread your proselytism somewhere else.") def on_action(self, serv, ev): """À la réception d'une action."""