slight documentation and whitespace for subclassing irclib.IRC, irclib.ServerConnection
This commit is contained in:
parent
331ca77337
commit
88186e1425
|
@ -27,13 +27,20 @@ modlist = []
|
||||||
moduleList = [ "Countdown", "Dice", "IrcAdmin", "GoogleTranslate", "Seen", "FactFile" ]
|
moduleList = [ "Countdown", "Dice", "IrcAdmin", "GoogleTranslate", "Seen", "FactFile" ]
|
||||||
modObjs = []
|
modObjs = []
|
||||||
|
|
||||||
|
# DrBotServerConnection subclasses irclib's ServerConnection, in order to expand
|
||||||
|
# privmsg.
|
||||||
|
|
||||||
class DrBotServerConnection(irclib.ServerConnection):
|
class DrBotServerConnection(irclib.ServerConnection):
|
||||||
|
|
||||||
def privmsg(self, target, text):
|
def privmsg(self, target, text):
|
||||||
# Send a PRIVMSG command.
|
# Send a PRIVMSG command.
|
||||||
# TODO: length limiting or splitting
|
# TODO: length limiting or splitting
|
||||||
self.send_raw("PRIVMSG %s :%s" % (target, text))
|
self.send_raw("PRIVMSG %s :%s" % (target, text))
|
||||||
|
|
||||||
|
# DrBotIRC subclasses irclib's IRC, in order to create a DrBotServerConnection.
|
||||||
|
|
||||||
class DrBotIRC(irclib.IRC):
|
class DrBotIRC(irclib.IRC):
|
||||||
|
|
||||||
def server(self):
|
def server(self):
|
||||||
c = DrBotServerConnection(self)
|
c = DrBotServerConnection(self)
|
||||||
self.connections.append(c)
|
self.connections.append(c)
|
||||||
|
|
Loading…
Reference in New Issue