config: use a generic error message for issues

master
dece 4 years ago
parent 93288d3599
commit 828802fdbe

@ -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 ;("
}
}
}

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

Loading…
Cancel
Save