Refactor configuration and enhance AI capabilities

Updated .env.example to improve clarity and added new configuration options for memory and reliability settings. Refactored main.py to streamline the bot's entry point and improved error handling. Enhanced README to reflect new features and command structure. Removed deprecated cmd_zip_skill and skills_creator modules to clean up the codebase. Updated AIClient and MemorySystem for better performance and flexibility in handling user interactions.
This commit is contained in:
Mimikko-zeus
2026-03-03 21:56:33 +08:00
parent 726d41ad79
commit a754e7843f
72 changed files with 1607 additions and 5015 deletions

View File

@@ -0,0 +1,22 @@
from types import SimpleNamespace
from src.handlers.message_handler_ai import MessageHandler
def _build_handler() -> MessageHandler:
fake_bot = SimpleNamespace(robot=SimpleNamespace(id="bot_1", name="TestBot"))
return MessageHandler(fake_bot)
def test_message_dedup_by_message_id():
handler = _build_handler()
msg = SimpleNamespace(id="m1", content="hello", author=SimpleNamespace(id="u1"))
assert handler._is_duplicate_message(msg) is False
assert handler._is_duplicate_message(msg) is True
def test_message_dedup_fallback_without_message_id():
handler = _build_handler()
msg = SimpleNamespace(content="hello", author=SimpleNamespace(id="u1"), group_id="g1")
assert handler._is_duplicate_message(msg) is False
assert handler._is_duplicate_message(msg) is True