config: use a generic error message for issues

This commit is contained in:
dece 2020-10-09 21:59:44 +02:00
parent 93288d3599
commit 828802fdbe
2 changed files with 3 additions and 4 deletions

View file

@ -6,6 +6,7 @@
"channels": ["#idi0crates"],
"speak_delay": 0.5,
"resources_dir": "resources",
"error_message": "An error occured, sorry!",
"plugins": {
"beers": {
"commands": ["beer"],
@ -41,7 +42,6 @@
"lang": "en",
"ambiguous_response": "It is ambiguous.",
"empty_response": "I can't find it.",
"error_response": "An error occured ;("
}
}
}

View file

@ -12,8 +12,7 @@ from edmond.plugin import Plugin
class WikipediaPlugin(Plugin):
REQUIRED_CONFIGS = [
"commands", "ambiguous_response", "empty_response", "error_response",
"lang",
"commands", "ambiguous_response", "empty_response", "lang",
]
NUM_RETRIES = 3
@ -59,7 +58,7 @@ class WikipediaPlugin(Plugin):
summary = self.config["empty_response"]
break
except wikipedia.exceptions.WikipediaException:
summary = self.config["error_response"]
summary = self.bot.config["error_message"]
# Keep trying after a slight delay.
time.sleep(1)
retries -= 1