mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-24 03:33:11 +01:00
I didn't like the idea of supybot being able to time travel
This commit is contained in:
parent
d508b19347
commit
34555c51ff
@ -230,12 +230,15 @@ class Channel(callbacks.Privmsg):
|
||||
return
|
||||
try:
|
||||
length = int(length or 0)
|
||||
if length < 0:
|
||||
irc.error('Ban length must be a non-negative integer.')
|
||||
return
|
||||
except ValueError:
|
||||
if reason:
|
||||
reason = ' '.join((length, reason))
|
||||
length = 0
|
||||
else:
|
||||
irc.error('Ban length must be a valid integer.')
|
||||
irc.error('Ban length must be a non-negative integer.')
|
||||
return
|
||||
if not reason:
|
||||
reason = msg.nick
|
||||
|
@ -123,6 +123,7 @@ class ChannelTestCase(ChannelPluginTestCase, PluginDocumentation):
|
||||
prefix='foobar!user@host.domain.tld'))
|
||||
self.assertError('kban foobar')
|
||||
self.irc.feedMsg(ircmsgs.op(self.channel, self.irc.nick))
|
||||
self.assertError('kban foobar -1')
|
||||
self.assertBan('kban foobar', '*!*@*.domain.tld')
|
||||
self.assertBan('kban --exact foobar', 'foobar!user@host.domain.tld')
|
||||
self.assertBan('kban --host foobar', '*!*@host.domain.tld')
|
||||
|
Loading…
Reference in New Issue
Block a user