mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-25 04:02:46 +01:00
Added 'chanignores' command to list current channel ignores.
This commit is contained in:
parent
6de6fb863b
commit
b14ee76ca0
@ -39,6 +39,7 @@ import time
|
|||||||
import conf
|
import conf
|
||||||
import debug
|
import debug
|
||||||
import ircdb
|
import ircdb
|
||||||
|
import utils
|
||||||
import ircmsgs
|
import ircmsgs
|
||||||
import schedule
|
import schedule
|
||||||
import ircutils
|
import ircutils
|
||||||
@ -241,6 +242,24 @@ class Channel(callbacks.Privmsg):
|
|||||||
irc.reply(msg, conf.replySuccess)
|
irc.reply(msg, conf.replySuccess)
|
||||||
unchanignore = privmsgs.checkChannelCapability(unchanignore, 'op')
|
unchanignore = privmsgs.checkChannelCapability(unchanignore, 'op')
|
||||||
|
|
||||||
|
def chanignores(self, irc, msg, args, channel):
|
||||||
|
"""[<channel>]
|
||||||
|
|
||||||
|
Lists the hostmasks that the bot is ignoring on the given channel.
|
||||||
|
The <channel> argument is only necessary if the message isn't being
|
||||||
|
sent in the channel itself.
|
||||||
|
"""
|
||||||
|
channelarg = privmsgs.getArgs(args, needed=0, optional=1)
|
||||||
|
channel = channelarg or channel
|
||||||
|
c = ircdb.channels.getChannel(channel)
|
||||||
|
if len(c.ignores) == 0:
|
||||||
|
irc.reply(msg, 'I\'m not currently ignoring any hostmasks '
|
||||||
|
'in %r' % channel)
|
||||||
|
return
|
||||||
|
irc.reply(msg, utils.commaAndify(map(repr,c.ignores)))
|
||||||
|
chanignores = privmsgs.checkChannelCapability(chanignores, 'op')
|
||||||
|
|
||||||
|
|
||||||
def addchancapability(self, irc, msg, args, channel):
|
def addchancapability(self, irc, msg, args, channel):
|
||||||
"""[<channel>] <name|hostmask> <capability>
|
"""[<channel>] <name|hostmask> <capability>
|
||||||
|
|
||||||
|
@ -77,9 +77,9 @@ class ChannelTestCase(ChannelPluginTestCase, PluginDocumentation):
|
|||||||
|
|
||||||
def testChanignore(self):
|
def testChanignore(self):
|
||||||
self.assertNotError('chanignore foo!bar@baz')
|
self.assertNotError('chanignore foo!bar@baz')
|
||||||
|
self.assertResponse('chanignores', "'foo!bar@baz'")
|
||||||
self.assertNotError('unchanignore foo!bar@baz')
|
self.assertNotError('unchanignore foo!bar@baz')
|
||||||
self.assertError('permban not!a.hostmask')
|
self.assertError('permban not!a.hostmask')
|
||||||
|
|
||||||
|
|
||||||
# vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78:
|
# vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78:
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user