]> gitweb.pimeys.fr Git - bots/hung.git/commitdiff
[brown paperbag] c'est une liste !
authorVincent Le Gallic <legallic@crans.org>
Mon, 30 Jul 2012 17:37:50 +0000 (19:37 +0200)
committerVincent Le Gallic <legallic@crans.org>
Mon, 30 Jul 2012 17:37:50 +0000 (19:37 +0200)
hung.py

diff --git a/hung.py b/hung.py
index 96c8a58a6e4b3dd020f36f5dfdbefb6a18778f45..4f70801ad66d6402fe49d16904a2f492a35e923d 100755 (executable)
--- 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()!=[]: