mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 13:19:24 +01:00
Let's catch this KeyError, shall we?
This commit is contained in:
parent
fbe80ef138
commit
5d542dcdd1
@ -60,11 +60,15 @@ conf.registerChannelValue(conf.supybot.plugins.Channel, 'alwaysRejoin',
|
||||
|
||||
class Channel(callbacks.Privmsg):
|
||||
def haveOps(self, irc, channel, what):
|
||||
if irc.nick in irc.state.channels[channel].ops:
|
||||
return True
|
||||
else:
|
||||
irc.error('How can I %s? I\'m not opped in %s.' % (what, channel))
|
||||
return False
|
||||
try:
|
||||
if irc.nick in irc.state.channels[channel].ops:
|
||||
return True
|
||||
else:
|
||||
irc.error('How can I %s? I\'m not opped in %s.' %
|
||||
(what, channel))
|
||||
return False
|
||||
except KeyError:
|
||||
irc.error('I don\'t seem to be in %s.' % channel)
|
||||
|
||||
def doKick(self, irc, msg):
|
||||
channel = msg.args[0]
|
||||
|
Loading…
Reference in New Issue
Block a user