utils
feishu.im.utils
¶
get_message_text
¶
Python
get_message_text(message: NestedDict) -> str
读取消息中的文本
源代码位于: feishu/im/utils.py
is_mentioned
¶
Python
is_mentioned(message: NestedDict) -> bool
判断消息是否被@了
源代码位于: feishu/im/utils.py
infer_receive_id_type
¶
根据 receive_id 来推断 receive_id_type
源代码位于: feishu/im/utils.py
get_stream_message
¶
Python
get_stream_message(content: str, streaming: bool = False, streaming_status_text: str | None = None) -> dict
构建流消息的消息卡片
参数:
名称 | 类型 | 描述 | 默认 |
---|---|---|---|
|
str
|
消息内容 |
必需 |
|
bool
|
是否正在流式传输 |
False
|
|
str
|
用于显示流式传输状态的文本,默认为 |
None
|
飞书文档
源代码位于: feishu/im/utils.py
convert_json_to_dict
¶
Python
convert_json_to_dict(content: str) -> NestedDict