Added reconnect command.

This commit is contained in:
Jeremy Fincher 2004-07-20 17:46:36 +00:00
parent 39bf2e4848
commit 44e8ff5be2
2 changed files with 16 additions and 0 deletions

View File

@ -1,3 +1,7 @@
* Added a reconnect command to the Owner plugin. It won't work
for people using asyncoreDrivers, but those people should be few
and far between these days.
* Added aol filter in the Filter plugin. * Added aol filter in the Filter plugin.
* Added Nickometer plugin, a translation of Infobot's Nickometer. * Added Nickometer plugin, a translation of Infobot's Nickometer.

View File

@ -540,6 +540,18 @@ class Owner(privmsgs.CapabilityCheckingPrivmsg):
else: else:
irc.error('There was no callback %s.' % name) irc.error('There was no callback %s.' % name)
def reconnect(self, irc, msg, args):
"""takes no arguments
Disconnects and then reconnects to the current network.
"""
try:
irc.driver.reconnect()
irc.replySuccess()
except AttributeError: # There's a cleaner way to do this, but I'm lazy.
irc.error('I couldn\'t reconnect. You should restart me instead.')
Class = Owner Class = Owner