# Erebus IRC bot - Author: John Runyon
# main startup code
-#TODO: tons
-
import os, sys, select, MySQLdb, MySQLdb.cursors, time, random
import bot, config, ctlmod
self.chans = []
+ def msg(self, *args, **kwargs):
+ main.randbot.msg(self, *args, **kwargs)
+
def isauthed(self):
return self.auth is not None
def quit(self):
for chan in self.chans:
self.chans.remove(chan)
+ def nick(self, newnick):
+ self.nick = newnick
def __str__(self): return self.nick
def __repr__(self): return "<User %r (%d)>" % (self.nick,self.glevel)
row = c.fetchone()
+ def msg(self, *args, **kwargs):
+ self.bot.msg(self.name, *args, **kwargs)
+
def levelof(self, auth):
if auth is None:
return 0
def fd(self, fileno): #get Bot() by fd/fileno
return self.fds[fileno]
def randbot(self): #get Bot() randomly
- return self.bots[random.choice(self.bots.keys())]
+ return random.choice(self.bots)
def user(self, _nick, justjoined=False):
nick = _nick.lower()