Kaynağa Gözat

Lenient decoding

tBKwtWS 8 yıl önce
ebeveyn
işleme
01e4a69d50
2 değiştirilmiş dosya ile 7 ekleme ve 3 silme
  1. 6 2
      irc/bot.py
  2. 1 1
      irc/events/common.py

+ 6 - 2
irc/bot.py

@@ -3,6 +3,7 @@
 import sys, random, string, ssl
 import irc.bot#, irc.strings
 from irc.client import ip_numstr_to_quad#, ip_quad_to_numstr
+from jaraco.stream import buffer
 from postgres import Postgres
 import commands.public, commands.admin, commands.games, commands.statistics
 import events.on_welcome, events.on_join, events.on_kick, events.on_mode, events.on_pubmsg, events.on_action, events.on_whoreply, events.on_nick
@@ -31,12 +32,15 @@ class PyRot(irc.bot.SingleServerIRCBot):
         self.protectees = {}
         self.channelkeys = {}
         
+        print("Starting pyRot, the third RotBot by tBkwtWS.")
+        log.info("Connecting to " + host + ":" + str(port) + "/" + self.homechannel)
+        
         if usessl:
             factory = irc.connection.Factory(wrapper=ssl.wrap_socket)
         else:
             factory = irc.connection.Factory()
-        print("Starting pyRot, the third RotBot by tBkwtWS.")
-        log.info("Connecting to " + host + ":" + str(port) + "/" + self.homechannel)
+        
+        irc.client.ServerConnection.buffer_class = buffer.LenientDecodingLineBuffer
         try:
             irc.bot.SingleServerIRCBot.__init__(self, [(host, port)], nickname, username, connect_factory=factory)
         except irc.client.ServerConnectionError:

+ 1 - 1
irc/events/common.py

@@ -28,7 +28,7 @@ class Replyto():
             "I'm not talking to you!", 
             "What have you been up to?", 
             "How is life?", 
-            "What do you wan't from me?", 
+            "What do you want from me?", 
             event.source.nick + ", why are you bothering me?", 
             event.source.nick + ", when will you stop talking about me?", 
             event.source.nick + " I hate you!",