From 9cdf643cd7cb6713b470f54a09f963816101fca0 Mon Sep 17 00:00:00 2001 From: Vincent Le Gallic Date: Mon, 14 Apr 2014 08:58:04 +0200 Subject: [PATCH] =?utf8?q?!author=20:=20on=20affiche=20un=20message=20si?= =?utf8?q?=20pas=20de=20r=C3=A9sultat?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- parrot.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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.""" -- 2.39.2