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() 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

Loading…
Cancel
Save