mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-10-12 23:07:22 +02:00
Channel.cycle: allow specifying part message + defaults to plugins.Channel.partMsg
Closes #1062.
This commit is contained in:
parent
a67fb94875
commit
32988ee3a3
@ -258,17 +258,22 @@ class Channel(callbacks.Plugin):
|
|||||||
any('nickInChannel')])
|
any('nickInChannel')])
|
||||||
|
|
||||||
@internationalizeDocstring
|
@internationalizeDocstring
|
||||||
def cycle(self, irc, msg, args, channel):
|
def cycle(self, irc, msg, args, channel, reason):
|
||||||
"""[<channel>]
|
"""[<channel>]
|
||||||
|
|
||||||
If you have the #channel,op capability, this will cause the bot to
|
If you have the #channel,op capability, this will cause the bot to
|
||||||
"cycle", or PART and then JOIN the channel. <channel> is only necessary
|
"cycle", or PART and then JOIN the channel. <channel> is only necessary
|
||||||
if the message isn't sent in the channel itself.
|
if the message isn't sent in the channel itself. If <reason> is not
|
||||||
|
specified, the default part message specified in
|
||||||
|
supybot.plugins.Channel.partMsg will be used. No part message will be
|
||||||
|
used if neither a cycle reason nor a default part message is given.
|
||||||
"""
|
"""
|
||||||
self._sendMsg(irc, ircmsgs.part(channel, msg.nick))
|
reason = (reason or self.registryValue("partMsg", channel))
|
||||||
|
reason = ircutils.standardSubstitute(irc, msg, reason)
|
||||||
|
self._sendMsg(irc, ircmsgs.part(channel, reason))
|
||||||
networkGroup = conf.supybot.networks.get(irc.network)
|
networkGroup = conf.supybot.networks.get(irc.network)
|
||||||
self._sendMsg(irc, networkGroup.channels.join(channel))
|
self._sendMsg(irc, networkGroup.channels.join(channel))
|
||||||
cycle = wrap(cycle, ['op'])
|
cycle = wrap(cycle, ['op', additional('text')])
|
||||||
|
|
||||||
@internationalizeDocstring
|
@internationalizeDocstring
|
||||||
def kick(self, irc, msg, args, channel, nicks, reason):
|
def kick(self, irc, msg, args, channel, nicks, reason):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user