mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-19 07:00:57 +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):
|
class Channel(callbacks.Privmsg):
|
||||||
def haveOps(self, irc, channel, what):
|
def haveOps(self, irc, channel, what):
|
||||||
if irc.nick in irc.state.channels[channel].ops:
|
try:
|
||||||
return True
|
if irc.nick in irc.state.channels[channel].ops:
|
||||||
else:
|
return True
|
||||||
irc.error('How can I %s? I\'m not opped in %s.' % (what, channel))
|
else:
|
||||||
return False
|
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):
|
def doKick(self, irc, msg):
|
||||||
channel = msg.args[0]
|
channel = msg.args[0]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user