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
+
reg_is_smiley = re.compile(u".*("+u"|".join(config.smileys)+u")")
def is_smiley(chain):
chain=unicode(chain,"utf8")
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. Essayez 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]
serv.privmsg(canal,answer.format(auteur).encode("utf8"))
def on_action(self, serv, ev):
+ if ignore_event(serv, ev):
+ return
action = ev.arguments()[0]
auteur = irclib.nm_to_n(ev.source())
channel = ev.target()