creating custom classes inheriting from irclib, in an attempt to figure out this unicode stuff and to do privmsg splitting eventually

This commit is contained in:
Brian S. Stephan 2010-07-26 20:05:17 -05:00
parent 9836ebf11f
commit 22c423f8b5
1 changed files with 13 additions and 1 deletions

View File

@ -555,6 +555,18 @@ class FactFile(Module):
except NoOptionError: pass
class DrBotServerConnection(irclib.ServerConnection):
def privmsg(self, target, text):
"""Send a PRIVMSG command."""
# TODO: length limiting or splitting
self.send_raw("PRIVMSG %s :%s" % (target, text))
class DrBotIRC(irclib.IRC):
def server(self):
c = DrBotServerConnection(self)
self.connections.append(c)
return c
#####
# init
#####
@ -582,7 +594,7 @@ irclib.DEBUG = config.getboolean('IRC', 'debug')
# start up the IRC bot
# create IRC and server objects and connect
irc = irclib.IRC()
irc = DrBotIRC()
server = irc.server().connect(botserver, botport, botnick, botircname)
modlist = []