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:
22
tests/test_message_dedup.py
Normal file
22
tests/test_message_dedup.py
Normal 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
|
||||
Reference in New Issue
Block a user