mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +01:00
The bot won't de itself anymore.
This commit is contained in:
parent
aa6e663768
commit
1c1046cddb
@ -100,7 +100,11 @@ class Channel(callbacks.Privmsg):
|
|||||||
"""
|
"""
|
||||||
if not args:
|
if not args:
|
||||||
args.append(msg.nick)
|
args.append(msg.nick)
|
||||||
if irc.nick in irc.state.channels[channel].ops:
|
if irc.nick in args:
|
||||||
|
irc.error('I cowardly refuse to deop myself. If you really want '
|
||||||
|
'me deopped, tell me to op you and then deop me '
|
||||||
|
'yourself.')
|
||||||
|
elif irc.nick in irc.state.channels[channel].ops:
|
||||||
irc.queueMsg(ircmsgs.deops(channel, args))
|
irc.queueMsg(ircmsgs.deops(channel, args))
|
||||||
else:
|
else:
|
||||||
irc.error('How can I deop someone? I\'m not opped!')
|
irc.error('How can I deop someone? I\'m not opped!')
|
||||||
@ -115,7 +119,11 @@ class Channel(callbacks.Privmsg):
|
|||||||
"""
|
"""
|
||||||
if not args:
|
if not args:
|
||||||
args.append(msg.nick)
|
args.append(msg.nick)
|
||||||
if irc.nick in irc.state.channels[channel].ops:
|
if irc.nick in args:
|
||||||
|
irc.error('I cowardly refuse to dehalfop myself. If you really '
|
||||||
|
'want me dehalfopped, tell me to op you and then '
|
||||||
|
'dehalfop me yourself.')
|
||||||
|
elif irc.nick in irc.state.channels[channel].ops:
|
||||||
irc.queueMsg(ircmsgs.dehalfops(channel, args))
|
irc.queueMsg(ircmsgs.dehalfops(channel, args))
|
||||||
else:
|
else:
|
||||||
irc.error('How can I dehalfop someone? I\'m not opped!')
|
irc.error('How can I dehalfop someone? I\'m not opped!')
|
||||||
@ -130,7 +138,11 @@ class Channel(callbacks.Privmsg):
|
|||||||
"""
|
"""
|
||||||
if not args:
|
if not args:
|
||||||
args.append(msg.nick)
|
args.append(msg.nick)
|
||||||
if irc.nick in irc.state.channels[channel].ops:
|
if irc.nick in args:
|
||||||
|
irc.error('I cowardly refuse to devoice myself. If you really '
|
||||||
|
'want me devoiced, tell me to op you and then devoice '
|
||||||
|
'me yourself.')
|
||||||
|
elif irc.nick in irc.state.channels[channel].ops:
|
||||||
irc.queueMsg(ircmsgs.devoices(channel, args))
|
irc.queueMsg(ircmsgs.devoices(channel, args))
|
||||||
else:
|
else:
|
||||||
irc.error('How can I devoice someone? I\'m not opped!')
|
irc.error('How can I devoice someone? I\'m not opped!')
|
||||||
|
@ -72,6 +72,11 @@ class ChannelTestCase(ChannelPluginTestCase, PluginDocumentation):
|
|||||||
self.assertNotError('%s foo' % s)
|
self.assertNotError('%s foo' % s)
|
||||||
self.irc.feedMsg(ircmsgs.deop(self.channel, self.nick))
|
self.irc.feedMsg(ircmsgs.deop(self.channel, self.nick))
|
||||||
|
|
||||||
|
def testWontDeItself(self):
|
||||||
|
for s in 'deop dehalfop devoice'.split():
|
||||||
|
self.irc.feedMsg(ircmsgs.op(self.channel, self.nick))
|
||||||
|
self.assertError('%s %s' % (s, self.nick))
|
||||||
|
|
||||||
def testOp(self):
|
def testOp(self):
|
||||||
self.assertError('op')
|
self.assertError('op')
|
||||||
self.irc.feedMsg(ircmsgs.op(self.channel, self.nick))
|
self.irc.feedMsg(ircmsgs.op(self.channel, self.nick))
|
||||||
@ -114,10 +119,6 @@ class ChannelTestCase(ChannelPluginTestCase, PluginDocumentation):
|
|||||||
self.assertNotRegexp('kban foobar time', 'ValueError')
|
self.assertNotRegexp('kban foobar time', 'ValueError')
|
||||||
self.assertError('kban %s' % self.irc.nick)
|
self.assertError('kban %s' % self.irc.nick)
|
||||||
|
|
||||||
def testLobotomizers(self):
|
|
||||||
self.assertNotError('lobotomize')
|
|
||||||
self.assertNotError('unlobotomize')
|
|
||||||
|
|
||||||
def testPermban(self):
|
def testPermban(self):
|
||||||
self.assertNotError('permban foo!bar@baz')
|
self.assertNotError('permban foo!bar@baz')
|
||||||
self.assertNotError('unpermban foo!bar@baz')
|
self.assertNotError('unpermban foo!bar@baz')
|
||||||
|
Loading…
Reference in New Issue
Block a user