From: Vincent Le Gallic Date: Mon, 30 Jul 2012 17:37:50 +0000 (+0200) Subject: [brown paperbag] c'est une liste ! X-Git-Url: http://gitweb.pimeys.fr/?a=commitdiff_plain;h=7ef7a8ccb16df25e2a7a645d95d824c4be5edca3;p=bots%2Fhung.git [brown paperbag] c'est une liste ! --- diff --git a/hung.py b/hung.py index 96c8a58..4f70801 100755 --- a/hung.py +++ b/hung.py @@ -128,7 +128,7 @@ class Hung(ircbot.SingleServerIRCBot): test=bot_unicode(message) except UnicodeBotError: if config.utf8_trigger: - serv.privmsg(auteur, config.utf8_fail_answers) + serv.privmsg(auteur, random.choice(config.utf8_fail_answers).encode("utf8")) return message=message.split() cmd=message[0].lower() @@ -334,8 +334,8 @@ class Hung(ircbot.SingleServerIRCBot): try: test=bot_unicode(message) except UnicodeBotError: - if not canal in self.quiet_channels and config.utf8_trigger: - serv.privmsg(canal, "%s: %s"%(auteur,config.utf8_fail_answers)) + if config.utf8_trigger and not canal in self.quiet_channels: + serv.privmsg(canal, (u"%s: %s"%(auteur,random.choice(config.utf8_fail_answers))).encode("utf8")) return pour_moi,message=self.pourmoi(serv,message) if pour_moi and message.split()!=[]: