28 lines
663 B
Python
28 lines
663 B
Python
|
|
from __future__ import annotations
|
||
|
|
|
||
|
|
from .session import CHAT_ID_PREFIX_DM, CHAT_ID_PREFIX_GROUP
|
||
|
|
|
||
|
|
|
||
|
|
def build_feishu_model_override_parent_candidates(
|
||
|
|
chat_id: str,
|
||
|
|
user_id: str = "",
|
||
|
|
group_id: str = "",
|
||
|
|
) -> list[str]:
|
||
|
|
candidates: list[str] = []
|
||
|
|
|
||
|
|
candidates.append(chat_id)
|
||
|
|
|
||
|
|
if user_id:
|
||
|
|
dm_candidate = f"{CHAT_ID_PREFIX_DM}{user_id}"
|
||
|
|
if dm_candidate != chat_id:
|
||
|
|
candidates.append(dm_candidate)
|
||
|
|
|
||
|
|
if group_id:
|
||
|
|
group_candidate = f"{CHAT_ID_PREFIX_GROUP}{group_id}"
|
||
|
|
if group_candidate != chat_id:
|
||
|
|
candidates.append(group_candidate)
|
||
|
|
|
||
|
|
candidates.append("*")
|
||
|
|
|
||
|
|
return candidates
|