瀏覽代碼

Enhanced debug logging in bot initialization

Introduced additional debug log entries in the `GPTBot` class to provide clarity on the initial sync and callback setup process. This helps with monitoring and troubleshooting during the early stages of bot deployment, making it easier to pinpoint issues around bot startup and room joining behavior.
Bumped project version to 0.3.3-dev to signal ongoing development.
Kumi 11 月之前
父節點
當前提交
c7e448126d
共有 2 個文件被更改,包括 6 次插入1 次删除
  1. 1 1
      pyproject.toml
  2. 5 0
      src/gptbot/classes/bot.py

+ 1 - 1
pyproject.toml

@@ -7,7 +7,7 @@ allow-direct-references = true
 
 [project]
 name = "matrix-gptbot"
-version = "0.3.2"
+version = "0.3.3-dev"
 
 authors = [
   { name="Kumi Mitterer", email="gptbot@kumi.email" },

+ 5 - 0
src/gptbot/classes/bot.py

@@ -816,6 +816,9 @@ class GPTBot:
         self.matrix_client.config = client_config
 
         # Run initial sync (includes joining rooms)
+
+        self.logger.log("Running initial sync...", "debug")
+
         sync = await self.matrix_client.sync(timeout=30000, full_state=True)
         if isinstance(sync, SyncResponse):
             await self.response_callback(sync)
@@ -825,6 +828,8 @@ class GPTBot:
 
         # Set up callbacks
 
+        self.logger.log("Setting up callbacks...", "debug")
+
         self.matrix_client.add_event_callback(self.event_callback, Event)
         self.matrix_client.add_response_callback(self.response_callback, Response)