feat(router): 添加用户追踪和节点通知功能
在ROUTER_MODE启用时跟踪用户消息,并在节点注册/注销时通知相关用户。新增_known_users集合记录活跃用户,重构通知逻辑以支持所有已知用户或特定服务用户的通知。
This commit is contained in:
@@ -129,6 +129,11 @@ async def _process_message(user_id: str, chat_id: str, text: str) -> None:
|
||||
await send_text(chat_id, "chat_id", "Sorry, you are not authorized to use this bot.")
|
||||
return
|
||||
|
||||
from config import ROUTER_MODE
|
||||
if ROUTER_MODE:
|
||||
from router.nodes import get_node_registry
|
||||
get_node_registry().track_user(user_id)
|
||||
|
||||
reply = await handle_command(user_id, text)
|
||||
if reply is not None:
|
||||
if reply:
|
||||
|
||||
Reference in New Issue
Block a user