also cancel reconnections with !disconnect
This commit is contained in:
parent
19d8f0b497
commit
14125a6048
1 changed files with 9 additions and 2 deletions
|
@ -83,8 +83,15 @@ class Module(ModuleManager.BaseModule):
|
||||||
raise utils.EventError("Unknown server alias")
|
raise utils.EventError("Unknown server alias")
|
||||||
|
|
||||||
server = self.bot.get_server_by_id(id)
|
server = self.bot.get_server_by_id(id)
|
||||||
server.disconnect()
|
if not server == None:
|
||||||
self.bot.disconnect(server)
|
server.disconnect()
|
||||||
|
self.bot.disconnect(server)
|
||||||
|
elif id in event["server"].reconnections:
|
||||||
|
event["server"].reconnections[id].cancel()
|
||||||
|
del event["server"].reconnections[id]
|
||||||
|
else:
|
||||||
|
raise utils.EventError("Server not connected")
|
||||||
|
|
||||||
event["stdout"].write("Disconnected from %s" % str(server))
|
event["stdout"].write("Disconnected from %s" % str(server))
|
||||||
|
|
||||||
@utils.hook("received.command.shutdown")
|
@utils.hook("received.command.shutdown")
|
||||||
|
|
Loading…
Reference in a new issue