X-Git-Url: http://gitweb.pimeys.fr/?p=bots%2Fparrot.git;a=blobdiff_plain;f=parrot.py;h=6229e8d4a5c4189d82a0a6945fe5d8c3a52e4e50;hp=aae04fc037e198f702e24d1d6c175d2a31f3f9d8;hb=9cdf643cd7cb6713b470f54a09f963816101fca0;hpb=e40da5a33f6a26bc6524bad637483db3fe602cd1 diff --git a/parrot.py b/parrot.py index aae04fc..6229e8d 100755 --- a/parrot.py +++ b/parrot.py @@ -454,7 +454,10 @@ class Parrot(ircbot.SingleServerIRCBot): 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)] - serv.privmsg(canal, "%s: %s" % (auteur, (u" ".join(authors)).encode("utf-8"))) + if authors: + serv.privmsg(canal, "%s: %s" % (auteur, (u" ".join(authors)).encode("utf-8"))) + else: + serv.privmsg(canal, "%s: Pas d'auteur correspondant à la recherche.") def on_action(self, serv, ev): """À la réception d'une action."""