plugin: auto-remove question marks

This commit is contained in:
dece 2020-11-02 18:34:41 +01:00
parent 22c75c4445
commit d21a6dd2be

View file

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