mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-11 03:50:44 +01:00
Channel: Fix error in @part when channel is configured but not joined
This typically happens when banned from the channel, and returning an error gives bot admins the impression @part did not remove the channel from the auto-join list
This commit is contained in:
parent
03a3777129
commit
03c638705f
@ -991,9 +991,14 @@ class Channel(callbacks.Plugin):
|
||||
network = conf.supybot.networks.get(irc.network)
|
||||
network.channels().remove(channel)
|
||||
except KeyError:
|
||||
pass
|
||||
if channel not in irc.state.channels:
|
||||
irc.error(_('I\'m not in %s.') % channel, Raise=True)
|
||||
if channel not in irc.state.channels:
|
||||
# Not configured AND not in the channel
|
||||
irc.error(_('I\'m not in %s.') % channel, Raise=True)
|
||||
else:
|
||||
if channel not in irc.state.channels:
|
||||
# Configured, but not in the channel
|
||||
irc.reply(_('%s removed from configured join list.') % channel)
|
||||
return
|
||||
reason = (reason or self.registryValue("partMsg", channel, irc.network))
|
||||
reason = ircutils.standardSubstitute(irc, msg, reason)
|
||||
irc.queueMsg(ircmsgs.part(channel, reason))
|
||||
|
Loading…
x
Reference in New Issue
Block a user