mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 11:09:23 +01:00
plugins/Channel: Catch a Key Error in "ban remove" and "ignore remove".
This commit is contained in:
parent
766dad2f70
commit
c444a67e91
@ -505,9 +505,12 @@ class Channel(callbacks.Plugin):
|
|||||||
message isn't sent in the channel itself.
|
message isn't sent in the channel itself.
|
||||||
"""
|
"""
|
||||||
c = ircdb.channels.getChannel(channel)
|
c = ircdb.channels.getChannel(channel)
|
||||||
c.removeBan(banmask)
|
try:
|
||||||
ircdb.channels.setChannel(channel, c)
|
c.removeBan(banmask)
|
||||||
irc.replySuccess()
|
ircdb.channels.setChannel(channel, c)
|
||||||
|
irc.replySuccess()
|
||||||
|
except KeyError:
|
||||||
|
irc.error('There are no persistent bans for that hostmask.')
|
||||||
remove = wrap(remove, ['op', 'hostmask'])
|
remove = wrap(remove, ['op', 'hostmask'])
|
||||||
|
|
||||||
def list(self, irc, msg, args, channel):
|
def list(self, irc, msg, args, channel):
|
||||||
@ -551,9 +554,12 @@ class Channel(callbacks.Plugin):
|
|||||||
necessary if the message isn't sent in the channel itself.
|
necessary if the message isn't sent in the channel itself.
|
||||||
"""
|
"""
|
||||||
c = ircdb.channels.getChannel(channel)
|
c = ircdb.channels.getChannel(channel)
|
||||||
c.removeIgnore(banmask)
|
try:
|
||||||
ircdb.channels.setChannel(channel, c)
|
c.removeIgnore(banmask)
|
||||||
irc.replySuccess()
|
ircdb.channels.setChannel(channel, c)
|
||||||
|
irc.replySuccess()
|
||||||
|
except KeyError:
|
||||||
|
irc.error('There are no ignores for that hostmask.')
|
||||||
remove = wrap(remove, ['op', 'hostmask'])
|
remove = wrap(remove, ['op', 'hostmask'])
|
||||||
|
|
||||||
def list(self, irc, msg, args, channel):
|
def list(self, irc, msg, args, channel):
|
||||||
|
Loading…
Reference in New Issue
Block a user