diff --git a/plugins/Parter.py b/plugins/Parter.py index 8d04d10eb..334e99160 100644 --- a/plugins/Parter.py +++ b/plugins/Parter.py @@ -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): diff --git a/src/Admin.py b/src/Admin.py index c063fa2c8..065f9a954 100755 --- a/src/Admin.py +++ b/src/Admin.py @@ -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): """[,] [[,] ...] @@ -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) diff --git a/src/conf.py b/src/conf.py index 20d27b1ca..ef2ea467d 100644 --- a/src/conf.py +++ b/src/conf.py @@ -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):