Encyclopedia: Rename setting 'alert' → 'alerts'

This commit is contained in:
Krytarik Raido 2022-10-13 00:17:04 +02:00
parent 8d2bb1f371
commit f9066b25c0
3 changed files with 8 additions and 8 deletions

View File

@ -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'],

View File

@ -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',

View File

@ -335,7 +335,7 @@ class Encyclopedia(callbacks.Plugin):
return
if loop >= 10:
return "Error: Infinite <alias> 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>'):
alias_name = factoid.value[7:].strip()