From f9066b25c02af2dbe1e6b546fff339cabd4f21fe Mon Sep 17 00:00:00 2001 From: Krytarik Raido Date: Thu, 13 Oct 2022 00:17:04 +0200 Subject: [PATCH] =?UTF-8?q?Encyclopedia:=20Rename=20setting=20'alert'=20?= =?UTF-8?q?=E2=86=92=20'alerts'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Encyclopedia/__init__.py | 2 +- Encyclopedia/config.py | 12 ++++++------ Encyclopedia/plugin.py | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Encyclopedia/__init__.py b/Encyclopedia/__init__.py index 09e65a4..941934f 100644 --- a/Encyclopedia/__init__.py +++ b/Encyclopedia/__init__.py @@ -24,7 +24,7 @@ import supybot import supybot.world as world from importlib import reload -__version__ = "4.4.0" +__version__ = "4.5.0" __author__ = supybot.Author("Krytarik Raido", "krytarik", "krytarik@gmail.com") __contributors__ = { supybot.Author("Dennis Kaarsemaker", "Seveas", "dennis@kaarsemaker.net"): ['Original Author'], diff --git a/Encyclopedia/config.py b/Encyclopedia/config.py index e41007e..46fb7fe 100644 --- a/Encyclopedia/config.py +++ b/Encyclopedia/config.py @@ -87,12 +87,12 @@ def configure(advanced): relaychannel = anything("What channel/nick should the bot forward edit messages to?", default=Encyclopedia.relaychannel._default) output("What message should the bot reply with when a factoid cannot be found?") notfoundmsg = something("If you include a '%s' in the message, it will be replaced with the requested factoid", default=Encyclopedia.notfoundmsg._default) - alert = set([]) + alerts = set([]) output("When certain factoids are called an alert can be forwarded to a channel/nick") output("Which factoids should the bot forward alert calls for?") - alert_i = anything("Separate types by spaces or commas:", default=', '.join(Encyclopedia.alert._default)) - for name in re.split(r'[,\s]+', alert_i): - alert.add(name.lower()) + alerts_i = anything("Separate names by spaces or commas:", default=', '.join(Encyclopedia.alerts._default)) + for name in re.split(r'[,\s]+', alerts_i): + alerts.add(name.lower()) remotedb = anything("Location of a remote database to sync with (used with @sync):", default=Encyclopedia.remotedb._default) privateNotFound = yn("Should the bot reply in private when a factoid is not found, as opposed to in the channel?", default=Encyclopedia.privateNotFound._default) @@ -112,7 +112,7 @@ def configure(advanced): Encyclopedia.curLTSNum.setValue(curLTSNum) Encyclopedia.relaychannel.setValue(relaychannel) Encyclopedia.notfoundmsg.setValue(notfoundmsg) - Encyclopedia.alert.setValue(alert) + Encyclopedia.alerts.setValue(alerts) Encyclopedia.remotedb.setValue(remotedb) Encyclopedia.privateNotFound.setValue(privateNotFound) @@ -198,7 +198,7 @@ conf.registerChannelValue(Encyclopedia,'prefixchar', conf.registerGlobalValue(Encyclopedia, 'datadir', conf.Directory(conf.supybot.directories.data(), 'Directory containing factoid databases')) -conf.registerChannelValue(Encyclopedia, 'alert', +conf.registerChannelValue(Encyclopedia, 'alerts', registry.SpaceSeparatedListOfStrings(['ops', 'op', 'kops', 'calltheops'], 'Factoid names used for alerts')) conf.registerChannelValue(Encyclopedia, 'remotedb', diff --git a/Encyclopedia/plugin.py b/Encyclopedia/plugin.py index 68e852c..93bb65d 100644 --- a/Encyclopedia/plugin.py +++ b/Encyclopedia/plugin.py @@ -335,7 +335,7 @@ class Encyclopedia(callbacks.Plugin): return if loop >= 10: return "Error: Infinite loop detected" - if factoid.name in self.registryValue('alert', channel): + if factoid.name in self.registryValue('alerts', channel): self.alert = True if factoid.value.startswith(''): alias_name = factoid.value[7:].strip()