From e6fb30b59ed68511533a6b384203212d32a1043f Mon Sep 17 00:00:00 2001 From: kgrim Date: Fri, 3 Jan 2025 22:28:24 +0100 Subject: [PATCH] Added handling of skip_announcement and incremented MQ version --- chatbot_core/v2/__init__.py | 4 +++- requirements/requirements.txt | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/chatbot_core/v2/__init__.py b/chatbot_core/v2/__init__.py index 9a7ca53..bed767c 100644 --- a/chatbot_core/v2/__init__.py +++ b/chatbot_core/v2/__init__.py @@ -70,11 +70,13 @@ def handle_kick_out(self, body: dict): def handle_invite(self, body: dict): """Handles incoming request to chatbot""" new_cid = body.pop('cid', None) + skip_announcement = body.pop('skip_announcement', False) self.log.info(f'Received invitation to cid: {new_cid}') if new_cid and not self.current_conversations.get(new_cid, None): self.current_conversations[new_cid] = body self.set_conversation_state(new_cid, ConversationState.IDLE) - self.send_announcement(f'{self.nick.split("-")[0]} joined', new_cid) + if not skip_announcement: + self.send_announcement(f'{self.nick.split("-")[0]} joined', new_cid) def get_conversation_state(self, cid) -> ConversationState: return self.current_conversations.get(cid, {}).get('state', ConversationState.IDLE) diff --git a/requirements/requirements.txt b/requirements/requirements.txt index 4f8d622..898c6c7 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -1,6 +1,6 @@ click~=8.0 klat-connector==0.6.2a15 -neon-mq-connector==0.7.2a8 +neon-mq-connector>=0.7.2a9 neon_utils[network,sentry] >= 1.11.1a6 ovos-bus-client~=0.0.5 psutil~=5.7