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:
parent
9836ebf11f
commit
22c423f8b5
14
dr.botzo.py
14
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 = []
|
||||
|
|
Loading…
Reference in New Issue