diff --git a/dr.botzo.py b/dr.botzo.py index dcf0340..26bba91 100755 --- a/dr.botzo.py +++ b/dr.botzo.py @@ -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 = []