Conflicts: modules/head.py modules/wikipedia.py
This commit is contained in:
8
irc.py
8
irc.py
@@ -42,6 +42,9 @@ class Bot(asynchat.async_chat):
|
||||
import threading
|
||||
self.sending = threading.RLock()
|
||||
|
||||
# def push(self, *args, **kargs):
|
||||
# asynchat.async_chat.push(self, *args, **kargs)
|
||||
|
||||
def __write(self, args, text=None):
|
||||
# print '%r %r %r' % (self, args, text)
|
||||
try:
|
||||
@@ -151,7 +154,10 @@ class Bot(asynchat.async_chat):
|
||||
self.sending.release()
|
||||
return
|
||||
|
||||
self.__write(('PRIVMSG', recipient), text)
|
||||
def safe(input):
|
||||
input = input.replace('\n', '')
|
||||
return input.replace('\r', '')
|
||||
self.__write(('PRIVMSG', safe(recipient)), safe(text))
|
||||
self.stack.append((time.time(), text))
|
||||
self.stack = self.stack[-10:]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user