print chain
f.close()
+def ignore_event(serv, ev):
+ """Retourne ``True`` si il faut ignorer cet évènement."""
+ for (blackmask, exceptmask) in config.blacklisted_masks:
+ usermask = ev.source()
+ if exceptmask is None:
+ exceptit = False
+ else:
+ exceptit = bool(irclib.mask_matches(usermask, exceptmask))
+ blackit = bool(irclib.mask_matches(usermask, blackmask))
+ return blackit and not exceptit
class GoodCentury(Exception):
pass
return (False,message)
def on_privmsg(self, serv, ev):
+ if ignore_event(serv, ev):
+ return
message=ev.arguments()[0]
auteur = irclib.nm_to_n(ev.source())
try:
serv.privmsg(auteur,"Je n'ai pas compris. Essaye HELP…")
def on_pubmsg(self, serv, ev):
+ if ignore_event(serv, ev):
+ return
auteur = irclib.nm_to_n(ev.source())
canal = ev.target()
message = ev.arguments()[0]