mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +01:00
Fixed supybot.channels to use an IrcSet instead of a list.
This commit is contained in:
parent
3b899fd5c0
commit
1264f21f23
@ -67,7 +67,7 @@ def configure(advanced):
|
||||
|
||||
conf.registerPlugin('Parter')
|
||||
conf.registerGlobalValue(conf.supybot.plugins.Parter, 'channels',
|
||||
conf.SpaceSeparatedListOfChannels([], """Determines what channels the bot
|
||||
conf.SpaceSeparatedSetOfChannels([], """Determines what channels the bot
|
||||
will automatically part whenever it joins them."""))
|
||||
|
||||
class Parter(callbacks.Privmsg):
|
||||
|
@ -63,7 +63,7 @@ class Admin(privmsgs.CapabilityCheckingPrivmsg):
|
||||
self.joins = {}
|
||||
|
||||
def do376(self, irc, msg):
|
||||
channels = conf.supybot.channels()
|
||||
channels = list(conf.supybot.channels())
|
||||
utils.sortBy(lambda s: ',' not in s, channels)
|
||||
keys = []
|
||||
chans = []
|
||||
@ -132,7 +132,7 @@ class Admin(privmsgs.CapabilityCheckingPrivmsg):
|
||||
if conf.supybot.alwaysJoinOnInvite() or \
|
||||
ircdb.checkCapability(msg.prefix, 'admin'):
|
||||
irc.queueMsg(ircmsgs.join(channel))
|
||||
conf.supybot.channels().append(channel)
|
||||
conf.supybot.channels().add(channel)
|
||||
|
||||
def join(self, irc, msg, args):
|
||||
"""<channel>[,<key>] [<channel>[,<key>] ...]
|
||||
@ -157,7 +157,7 @@ class Admin(privmsgs.CapabilityCheckingPrivmsg):
|
||||
if not ircutils.isChannel(channel):
|
||||
irc.error('%r is not a valid channel.' % channel)
|
||||
return
|
||||
conf.supybot.channels().append(original)
|
||||
conf.supybot.channels().add(original)
|
||||
irc.queueMsg(ircmsgs.joins(channels, keys))
|
||||
for channel in channels:
|
||||
self.joins[channel] = (irc, msg)
|
||||
|
@ -108,13 +108,14 @@ what server the bot connects to."""))
|
||||
supybot.register('password', registry.String('', """Determines the password to
|
||||
be sent to the server if it requires one."""))
|
||||
|
||||
class SpaceSeparatedListOfChannels(registry.SeparatedListOf):
|
||||
class SpaceSeparatedSetOfChannels(registry.SeparatedListOf):
|
||||
List = ircutils.IrcSet
|
||||
Value = ValidChannel
|
||||
def splitter(self, s):
|
||||
return s.split()
|
||||
joiner = ' '.join
|
||||
|
||||
supybot.register('channels', SpaceSeparatedListOfChannels(['#supybot'], """
|
||||
supybot.register('channels', SpaceSeparatedSetOfChannels(['#supybot'], """
|
||||
Determines what channels the bot will join when it connects to the server."""))
|
||||
|
||||
class ValidPrefixChars(registry.String):
|
||||
|
Loading…
Reference in New Issue
Block a user