MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / resolve_chat_id_for_user

Function resolve_chat_id_for_user

agents/profile-report-agent/main.py:675–685  ·  view source on GitHub ↗

优先从画像和角色配置中解析角色 chat_id。

(user_id: str, role_name: Optional[str] = None)

Source from the content-addressed store, hash-verified

673
674def resolve_chat_id_for_user(user_id: str, role_name: Optional[str] = None) -> Optional[str]:
675 """优先从画像和角色配置中解析角色 chat_id。"""
676 profile = get_profile(user_id) or {}
677 if profile.get("feishu_chat_id"):
678 return profile["feishu_chat_id"]
679
680 resolved_role_name = role_name or get_role_name_by_user_id(user_id)
681 if resolved_role_name:
682 return get_role_chat_id(resolved_role_name)
683
684 return None
685
686
687def send_weekly_report(
688 user_id: str,

Callers 1

send_weekly_reportFunction · 0.70

Calls 4

get_role_name_by_user_idFunction · 0.85
get_role_chat_idFunction · 0.85
getMethod · 0.80
get_profileFunction · 0.50

Tested by

no test coverage detected