fix: 修复语法错误和导入问题
This commit is contained in:
BIN
ai_chat.db
BIN
ai_chat.db
Binary file not shown.
BIN
logs/ai-chat.log
BIN
logs/ai-chat.log
Binary file not shown.
5
main.py
5
main.py
@@ -466,11 +466,6 @@ async def handle_matrix_message(action: str, conversation_id: str = None, user_m
|
|||||||
await matrix_bot.send_message(room_id, f"处理消息时出错: {str(e)}")
|
await matrix_bot.send_message(room_id, f"处理消息时出错: {str(e)}")
|
||||||
finally:
|
finally:
|
||||||
db.close()
|
db.close()
|
||||||
|
|
||||||
except Exception as e:
|
|
||||||
logger.error(f"处理Matrix消息失败: {e}")
|
|
||||||
finally:
|
|
||||||
db.close()
|
|
||||||
|
|
||||||
|
|
||||||
# ==================== 启动和关闭 ====================
|
# ==================== 启动和关闭 ====================
|
||||||
|
|||||||
Binary file not shown.
@@ -201,4 +201,8 @@ class MatrixBot:
|
|||||||
await self.client.close()
|
await self.client.close()
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
self.is_running = False
|
self.is_running = False
|
||||||
|
|
||||||
|
|
||||||
|
# 全局实例
|
||||||
|
matrix_bot = MatrixBot()
|
||||||
Reference in New Issue
Block a user