From 07e87bc3c7699a41d8484a8fc881679a1529174e Mon Sep 17 00:00:00 2001 From: Cyberes Date: Sun, 19 Mar 2023 19:54:16 -0600 Subject: [PATCH] t --- matrix_gpt/bot/callbacks.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/matrix_gpt/bot/callbacks.py b/matrix_gpt/bot/callbacks.py index 3aec0b8..cc5854e 100644 --- a/matrix_gpt/bot/callbacks.py +++ b/matrix_gpt/bot/callbacks.py @@ -61,10 +61,6 @@ class Callbacks: event: The event defining the message. """ # Extract the message text - msg = event.body.strip().strip('\n') - - logger.debug(f"Bot message received from {event.sender} in {room.room_id} --> {msg}") - await self.client.room_read_markers(room.room_id, event.event_id, event.event_id) # Ignore messages from ourselves @@ -81,6 +77,10 @@ class Callbacks: logger.debug(f'Skipping seen event: {event.event_id}') return + msg = event.body.strip().strip('\n') + + logger.debug(f"Bot message received from {event.sender} in {room.room_id} --> {msg}") + # if room.member_count > 2: # has_command_prefix = # else: @@ -91,6 +91,8 @@ class Callbacks: # room.member_count > 2 ... we assume a public room # room.member_count <= 2 ... we assume a DM # General message listener + logger.info(is_thread(event)) + if not msg.startswith(f'{self.command_prefix} ') and is_thread(event) and (await is_this_our_thread(self.client, room, event, self.command_prefix)): await self.client.room_typing(room.room_id, typing_state=True, timeout=3000) thread_content = await get_thread_content(self.client, room, event)