Encyclopedia: Guard against mistakes.

This commit is contained in:
Krytarik Raido 2021-05-26 03:45:04 +02:00
parent 8ffed09aef
commit 95f8fabc59
2 changed files with 5 additions and 2 deletions

View File

@ -24,7 +24,7 @@ import supybot
import supybot.world as world
from importlib import reload
__version__ = "3.4.0"
__version__ = "3.5.0"
__author__ = supybot.Author("Krytarik Raido", "krytarik", "krytarik@gmail.com")
__contributors__ = {
supybot.Author("Dennis Kaarsemaker", "Seveas", "dennis@kaarsemaker.net"): ['Original Author'],

View File

@ -495,7 +495,8 @@ class Encyclopedia(callbacks.Plugin):
elif re.match(r'^[^|\s]+[^|]*?\s+is(\s+|\b)\S+', text, re.I):
edit = 'add'
else:
text, target, retmsg = term
if not display:
text, target, retmsg = term
ret = self.factoid_lookup(text, channel, msg.nick, display)
if edit:
@ -697,6 +698,8 @@ class Encyclopedia(callbacks.Plugin):
if not match:
return
name = match.group('name').lower()
if re.match(r'.*<(reply|alias|sed)>.*', name):
return "You likely don't want this, %s" % editor
value = match.group('value')
if value.startswith(('also ', 'also:')):
name += '-also'