diff options
Diffstat (limited to 'config.py')
| -rw-r--r-- | config.py | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -28,7 +28,7 @@ ### -from supybot import conf, registry +from supybot import conf, registry, ircutils try: from supybot.i18n import PluginInternationalization _ = PluginInternationalization('SnoParser') @@ -37,6 +37,12 @@ except: # without the i18n module _ = lambda x: x +class ValidChannel(registry.string): + """Value must be a valid channel""" + def setValue(self, v): + if not (ircutils.isChannel(v)): + self.error() + registry.String.setValue(self, v) def configure(advanced): # This will be called by supybot to configure this module. advanced is @@ -52,8 +58,8 @@ SnoParser = conf.registerPlugin('SnoParser') # conf.registerGlobalValue(SnoParser, 'someConfigVariableName', # registry.Boolean(False, _("""Help for someConfigVariableName."""))) -conf.registerGlobalValue(SnoParser, 'targetChannel', - registry.String(None, ("""Sends reformatted snolines to the <channel>"""))) +conf.registerNetworkValue(SnoParser, 'targetChannel', ValidChannel, + ("", ("""Determines which channel the bot should send snolines"""))) conf.registerGlobalValue(SnoParser, 'AutoVhost', registry.String('libcasa/user/', ("""Configure the vhost eg. libcasa/user/$account"""))) |
