X-Git-Url: http://gitweb.pimeys.fr/?a=blobdiff_plain;f=parrot.py;h=821459498d8f8cae63a731acde54d4e332043dbb;hb=d8f25a4cab028d43f815c7bb3337ef53eca204d4;hp=6229e8d4a5c4189d82a0a6945fe5d8c3a52e4e50;hpb=9cdf643cd7cb6713b470f54a09f963816101fca0;p=bots%2Fparrot.git diff --git a/parrot.py b/parrot.py index 6229e8d..8214594 100755 --- a/parrot.py +++ b/parrot.py @@ -449,15 +449,15 @@ class Parrot(ircbot.SingleServerIRCBot): elif message.startswith(u"!author"): words = message.split() cmd = words[0].lstrip("!") - regexp = cmd in ["author-r", "authorreg", "author-reg", "author-regex"] + regexp = cmd in ["author" + suffix for suffix in config.regex_suffixes] search = u" ".join(words[1:]) authors = self.quotedb.search_authors(search, regexp) if len(authors) > config.search_max_authors: - authors = authors[:config.search_max_authors+1] + [unicode(len(authors) - config.search_max_authors)] + authors = authors[:config.search_max_authors+1] + ["+%s" % (len(authors) - config.search_max_authors)] if authors: - serv.privmsg(canal, "%s: %s" % (auteur, (u" ".join(authors)).encode("utf-8"))) + serv.privmsg(canal, "%s: %s" % (auteur, (u", ".join(authors)).encode("utf-8"))) else: - serv.privmsg(canal, "%s: Pas d'auteur correspondant à la recherche.") + serv.privmsg(canal, "%s: Pas d'auteur correspondant à la recherche." % (auteur,)) def on_action(self, serv, ev): """À la réception d'une action."""