From c55da197cead35f72e691f20502af69884fa39f2 Mon Sep 17 00:00:00 2001 From: Cyberes Date: Sun, 19 Mar 2023 21:33:49 -0600 Subject: [PATCH] more logging --- matrix_gpt/bot/callbacks.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/matrix_gpt/bot/callbacks.py b/matrix_gpt/bot/callbacks.py index 86dc65a..c7914ba 100644 --- a/matrix_gpt/bot/callbacks.py +++ b/matrix_gpt/bot/callbacks.py @@ -1,5 +1,6 @@ # https://github.com/anoadragon453/nio-template import asyncio +import json import logging import time from types import ModuleType @@ -149,7 +150,14 @@ class Callbacks: ) await command.process() else: - logger.debug(f"Bot not reacting to event {event.event_id}.") + debug = { + 'command_prefix': msg.startswith(f'{self.command_prefix} '), + 'is_dm': room.member_count == 2, + 'is_thread': is_thread(event), + 'is_our_thread': await is_this_our_thread(self.client, room, event, self.command_prefix) + + } + logger.debug(f"Bot not reacting to event {event.event_id}: {json.dumps(debug)}") async def invite(self, room: MatrixRoom, event: InviteMemberEvent) -> None: """Callback for when an invite is received. Join the room specified in the invite.