Conflicts:
	modules/head.py
	modules/wikipedia.py
This commit is contained in:
mutantmonkey
2011-09-07 19:08:01 -04:00
8 changed files with 99 additions and 27 deletions

8
irc.py
View File

@@ -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:]