feat(telegram): add per-chat/topic default agents (#109)

This commit is contained in:
banteg
2026-01-13 04:11:16 +04:00
committed by GitHub
parent 6ce08ee602
commit f060d3b59c
13 changed files with 660 additions and 31 deletions
+20
View File
@@ -0,0 +1,20 @@
import pytest
from takopi.telegram.chat_prefs import ChatPrefsStore
@pytest.mark.anyio
async def test_chat_prefs_store_roundtrip(tmp_path) -> None:
path = tmp_path / "telegram_chat_prefs_state.json"
store = ChatPrefsStore(path)
await store.set_default_engine(123, "codex")
await store.set_default_engine(123, "codex")
await store.clear_default_engine(456)
assert await store.get_default_engine(123) == "codex"
store2 = ChatPrefsStore(path)
assert await store2.get_default_engine(123) == "codex"
await store2.clear_default_engine(123)
assert await store2.get_default_engine(123) is None