mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-24 03:33:11 +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.
|
||||
"""
|
||||
c = ircdb.channels.getChannel(channel)
|
||||
c.removeBan(banmask)
|
||||
ircdb.channels.setChannel(channel, c)
|
||||
irc.replySuccess()
|
||||
try:
|
||||
c.removeBan(banmask)
|
||||
ircdb.channels.setChannel(channel, c)
|
||||
irc.replySuccess()
|
||||
except KeyError:
|
||||
irc.error('There are no persistent bans for that hostmask.')
|
||||
remove = wrap(remove, ['op', 'hostmask'])
|
||||
|
||||
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.
|
||||
"""
|
||||
c = ircdb.channels.getChannel(channel)
|
||||
c.removeIgnore(banmask)
|
||||
ircdb.channels.setChannel(channel, c)
|
||||
irc.replySuccess()
|
||||
try:
|
||||
c.removeIgnore(banmask)
|
||||
ircdb.channels.setChannel(channel, c)
|
||||
irc.replySuccess()
|
||||
except KeyError:
|
||||
irc.error('There are no ignores for that hostmask.')
|
||||
remove = wrap(remove, ['op', 'hostmask'])
|
||||
|
||||
def list(self, irc, msg, args, channel):
|
||||
|
Loading…
Reference in New Issue
Block a user