plugin: auto-remove question marks

master
dece 4 years ago
parent 22c75c4445
commit d21a6dd2be

@ -100,8 +100,13 @@ class Plugin:
question = message[len(words[0]):].strip()
for q in self.config.get("questions", []):
if question.startswith(q):
self.question = Question(q, question[len(q):].strip())
self.bot.log_d(f"Answering question from plugin {self.name}.")
content = question[len(q):].strip()
content = content.rstrip("?").rstrip()
question = Question(q, content)
self.question = question
self.bot.log_d(
f"Answering question from plugin {self.name}: {question}"
)
return True
return False

Loading…
Cancel
Save