mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-23 18:44:04 +01:00
Network: Make the 'network' argument of @disconnect mandatory. Closes GH-161.
Otherwise, if it's provided and the network doesn't exist (or the bot isn't currently connected to it), it's interpreted as being a quit message and disconnects from the current network.
This commit is contained in:
parent
0413304d53
commit
b166f4ad5c
@ -108,12 +108,11 @@ class Network(callbacks.Plugin):
|
|||||||
|
|
||||||
@internationalizeDocstring
|
@internationalizeDocstring
|
||||||
def disconnect(self, irc, msg, args, otherIrc, quitMsg):
|
def disconnect(self, irc, msg, args, otherIrc, quitMsg):
|
||||||
"""[<network>] [<quit message>]
|
"""<network> [<quit message>]
|
||||||
|
|
||||||
Disconnects from the network represented by the network <network>.
|
Disconnects from the network represented by the network <network>.
|
||||||
If <quit message> is given, quits the network with the given quit
|
If <quit message> is given, quits the network with the given quit
|
||||||
message. <network> is only necessary if the network is different
|
message.
|
||||||
from the network the command is sent on.
|
|
||||||
"""
|
"""
|
||||||
standard_msg = conf.supybot.plugins.Owner.quitMsg()
|
standard_msg = conf.supybot.plugins.Owner.quitMsg()
|
||||||
if standard_msg:
|
if standard_msg:
|
||||||
@ -125,7 +124,7 @@ class Network(callbacks.Plugin):
|
|||||||
if otherIrc != irc:
|
if otherIrc != irc:
|
||||||
irc.replySuccess(_('Disconnection to %s initiated.') %
|
irc.replySuccess(_('Disconnection to %s initiated.') %
|
||||||
otherIrc.network)
|
otherIrc.network)
|
||||||
disconnect = wrap(disconnect, ['owner', 'networkIrc', additional('text')])
|
disconnect = wrap(disconnect, ['owner', ('networkIrc', True), additional('text')])
|
||||||
|
|
||||||
@internationalizeDocstring
|
@internationalizeDocstring
|
||||||
def reconnect(self, irc, msg, args, otherIrc, quitMsg):
|
def reconnect(self, irc, msg, args, otherIrc, quitMsg):
|
||||||
|
Loading…
Reference in New Issue
Block a user