From 62f8106b1841ec7316ec1a057b4c7bdbf77165e1 Mon Sep 17 00:00:00 2001 From: BaerbelBox Date: Sat, 23 Dec 2023 10:00:46 +0100 Subject: [PATCH] made glossary is only asked for when .? is at the beginning of the message --- FaustBot/Modules/CustomUserModules/GlossaryModule.py | 6 +++--- HangmanLog | 8 ++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/FaustBot/Modules/CustomUserModules/GlossaryModule.py b/FaustBot/Modules/CustomUserModules/GlossaryModule.py index 120dcfa..aabdc96 100644 --- a/FaustBot/Modules/CustomUserModules/GlossaryModule.py +++ b/FaustBot/Modules/CustomUserModules/GlossaryModule.py @@ -25,11 +25,11 @@ class GlossaryModule(PrivMsgObserverPrototype): def update_on_priv_msg(self, data, connection: Connection): msg = data['message'] - if not -1 == msg.find(GlossaryModule._REMOVE_EXPLANATION): + if msg.startswith(GlossaryModule._REMOVE_EXPLANATION): self._remove_query(data, connection) - elif not -1 == msg.find(GlossaryModule._ADD_EXPLANATION): + elif msg.startswith(GlossaryModule._ADD_EXPLANATION): self._add_query(data, connection) - elif not -1 == msg.find(GlossaryModule._QUERY_EXPLANATION): + elif msg.startswith(GlossaryModule._QUERY_EXPLANATION): self._answer_query(data, connection) def _answer_query(self, data, connection: Connection): diff --git a/HangmanLog b/HangmanLog index 6ce6490..738114d 100644 --- a/HangmanLog +++ b/HangmanLog @@ -25,3 +25,11 @@ Yana ; TEST Neuling78 ; GURKENESSIG Yana ; TEST Yana ; TEST +baerbel ; TEST +TommyRainbow ; BLA +TommyRainbow ; BLA +TommyRainbow ; X +baerbel ; GITTERPOMMES +baerbel ; NASE +TommyRainbow ; TEST +TommyRainbow ; LALALALALALA