Encyclopedia: Rename setting 'alert' → 'alerts'
This commit is contained in:
parent
8d2bb1f371
commit
f9066b25c0
|
@ -24,7 +24,7 @@ import supybot
|
||||||
import supybot.world as world
|
import supybot.world as world
|
||||||
from importlib import reload
|
from importlib import reload
|
||||||
|
|
||||||
__version__ = "4.4.0"
|
__version__ = "4.5.0"
|
||||||
__author__ = supybot.Author("Krytarik Raido", "krytarik", "krytarik@gmail.com")
|
__author__ = supybot.Author("Krytarik Raido", "krytarik", "krytarik@gmail.com")
|
||||||
__contributors__ = {
|
__contributors__ = {
|
||||||
supybot.Author("Dennis Kaarsemaker", "Seveas", "dennis@kaarsemaker.net"): ['Original Author'],
|
supybot.Author("Dennis Kaarsemaker", "Seveas", "dennis@kaarsemaker.net"): ['Original Author'],
|
||||||
|
|
|
@ -87,12 +87,12 @@ def configure(advanced):
|
||||||
relaychannel = anything("What channel/nick should the bot forward edit messages to?", default=Encyclopedia.relaychannel._default)
|
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?")
|
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)
|
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("When certain factoids are called an alert can be forwarded to a channel/nick")
|
||||||
output("Which factoids should the bot forward alert calls for?")
|
output("Which factoids should the bot forward alert calls for?")
|
||||||
alert_i = anything("Separate types by spaces or commas:", default=', '.join(Encyclopedia.alert._default))
|
alerts_i = anything("Separate names by spaces or commas:", default=', '.join(Encyclopedia.alerts._default))
|
||||||
for name in re.split(r'[,\s]+', alert_i):
|
for name in re.split(r'[,\s]+', alerts_i):
|
||||||
alert.add(name.lower())
|
alerts.add(name.lower())
|
||||||
remotedb = anything("Location of a remote database to sync with (used with @sync):", default=Encyclopedia.remotedb._default)
|
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)
|
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.curLTSNum.setValue(curLTSNum)
|
||||||
Encyclopedia.relaychannel.setValue(relaychannel)
|
Encyclopedia.relaychannel.setValue(relaychannel)
|
||||||
Encyclopedia.notfoundmsg.setValue(notfoundmsg)
|
Encyclopedia.notfoundmsg.setValue(notfoundmsg)
|
||||||
Encyclopedia.alert.setValue(alert)
|
Encyclopedia.alerts.setValue(alerts)
|
||||||
Encyclopedia.remotedb.setValue(remotedb)
|
Encyclopedia.remotedb.setValue(remotedb)
|
||||||
Encyclopedia.privateNotFound.setValue(privateNotFound)
|
Encyclopedia.privateNotFound.setValue(privateNotFound)
|
||||||
|
|
||||||
|
@ -198,7 +198,7 @@ conf.registerChannelValue(Encyclopedia,'prefixchar',
|
||||||
conf.registerGlobalValue(Encyclopedia, 'datadir',
|
conf.registerGlobalValue(Encyclopedia, 'datadir',
|
||||||
conf.Directory(conf.supybot.directories.data(), 'Directory containing factoid databases'))
|
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'))
|
registry.SpaceSeparatedListOfStrings(['ops', 'op', 'kops', 'calltheops'], 'Factoid names used for alerts'))
|
||||||
|
|
||||||
conf.registerChannelValue(Encyclopedia, 'remotedb',
|
conf.registerChannelValue(Encyclopedia, 'remotedb',
|
||||||
|
|
|
@ -335,7 +335,7 @@ class Encyclopedia(callbacks.Plugin):
|
||||||
return
|
return
|
||||||
if loop >= 10:
|
if loop >= 10:
|
||||||
return "Error: Infinite <alias> loop detected"
|
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
|
self.alert = True
|
||||||
if factoid.value.startswith('<alias>'):
|
if factoid.value.startswith('<alias>'):
|
||||||
alias_name = factoid.value[7:].strip()
|
alias_name = factoid.value[7:].strip()
|
||||||
|
|
Loading…
Reference in New Issue