pub struct MessageService {
pub config: Config,
}Expand description
Message service
Provides core message functionality including creating, sending, and retrieving messages. Supports multiple message types: text, post, image, file, audio, media, sticker, interactive, share_chat, share_user.
Service 抽象接入:通过 impl_full_service! 为该服务实现
Service/ServiceObservability/ServiceBuilder/ServiceHealthCheck/ConfigurableService
等核心能力,统一服务行为与可观测性。
Fields§
§config: ConfigService configuration
Implementations§
Source§impl MessageService
impl MessageService
Sourcepub async fn list(
&self,
list_message_request: ListMessageRequest,
option: Option<RequestOption>,
) -> SDKResult<ListMessageRespData>
pub async fn list( &self, list_message_request: ListMessageRequest, option: Option<RequestOption>, ) -> SDKResult<ListMessageRespData>
Sourcepub fn list_iter(
&self,
list_message_request: ListMessageRequest,
_option: Option<RequestOption>,
) -> ListMessageIterator<'_>
pub fn list_iter( &self, list_message_request: ListMessageRequest, _option: Option<RequestOption>, ) -> ListMessageIterator<'_>
创建消息列表迭代器
提供便捷的方式遍历所有消息,自动处理分页
Sourcepub async fn list_with_validated_pagination(
&self,
container_id: impl ToString,
container_id_type: impl ToString,
page_size: Option<u32>,
page_token: Option<String>,
option: Option<RequestOption>,
) -> SDKResult<ListMessageRespData>
pub async fn list_with_validated_pagination( &self, container_id: impl ToString, container_id_type: impl ToString, page_size: Option<u32>, page_token: Option<String>, option: Option<RequestOption>, ) -> SDKResult<ListMessageRespData>
使用分页验证创建消息列表请求
提供一个更安全的方式来创建消息列表请求,自动验证分页参数
Source§impl MessageService
impl MessageService
Sourcepub async fn create(
&self,
create_message_request: CreateMessageRequest,
option: Option<RequestOption>,
) -> SDKResult<Message>
pub async fn create( &self, create_message_request: CreateMessageRequest, option: Option<RequestOption>, ) -> SDKResult<Message>
发送消息
给指定用户或者会话发送消息,支持文本、富文本、可交互的消息卡片、群名片、个人名片、图片、 视频、音频、文件、表情包。
https://open.feishu.cn/document/server-docs/im-v1/message/create
Sourcepub async fn delete(
&self,
message_id: &str,
option: Option<RequestOption>,
) -> SDKResult<()>
pub async fn delete( &self, message_id: &str, option: Option<RequestOption>, ) -> SDKResult<()>
撤回消息
撤回已经发送成功的消息。支持撤回应用自身发送的消息、应用管理员撤回群成员的消息、 撤回指定用户在指定会话的消息等不同场景。
https://open.feishu.cn/document/server-docs/im-v1/message/delete
Sourcepub async fn update(
&self,
message_id: &str,
update_message_request: UpdateMessageRequest,
option: Option<RequestOption>,
) -> SDKResult<Message>
pub async fn update( &self, message_id: &str, update_message_request: UpdateMessageRequest, option: Option<RequestOption>, ) -> SDKResult<Message>
更新消息
更新已发送的消息。仅支持更新应用自身发送的文本消息、图片消息和文件消息。
https://open.feishu.cn/document/server-docs/im-v1/message/update
Sourcepub async fn reply(
&self,
message_id: &str,
reply_message_request: CreateMessageRequest,
option: Option<RequestOption>,
) -> SDKResult<Message>
pub async fn reply( &self, message_id: &str, reply_message_request: CreateMessageRequest, option: Option<RequestOption>, ) -> SDKResult<Message>
Trait Implementations§
Source§impl Clone for MessageService
impl Clone for MessageService
Source§fn clone(&self) -> MessageService
fn clone(&self) -> MessageService
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more