utils
feishu.im.utils
¶
get_message_text
¶
Python
get_message_text(message: NestedDict) -> str
读取消息中的文本
Source code in feishu/im/utils.py
is_mentioned
¶
Python
is_mentioned(message: NestedDict) -> bool
判断消息是否被@了
Source code in feishu/im/utils.py
_is_mentioned
¶
Python
_is_mentioned(mention: NestedDict, open_id: str | None = None, union_id: str | None = None) -> bool
判断mention是否提到指定的open_id或union_id
Source code in feishu/im/utils.py
infer_receive_id_type
¶
根据 receive_id 来推断 receive_id_type
Source code in feishu/im/utils.py
get_stream_message
¶
Python
get_stream_message(content: str, streaming: bool = False, streaming_status_text: str | None = None) -> dict
构建流消息的消息卡片
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
str
|
消息内容 |
required |
|
bool
|
是否正在流式传输 |
False
|
|
str
|
用于显示流式传输状态的文本,默认为 |
None
|
飞书文档
Source code in feishu/im/utils.py
convert_json_to_dict
¶
Python
convert_json_to_dict(content: str) -> NestedDict