pub struct EnterpriseDingTalkRobot { /* private fields */ }Expand description
Implementation of the Enterprise Bot interface.
Implementations§
Source§impl EnterpriseDingTalkRobot
impl EnterpriseDingTalkRobot
Sourcepub fn new(appkey: String, appsecret: String, robot_code: String) -> Self
pub fn new(appkey: String, appsecret: String, robot_code: String) -> Self
Creates a new instance of EnterpriseDingTalkRobot.
§Arguments
appkey- The application key.appsecret- The application secret.robot_code- The robot code.
Sourcepub async fn get_access_token(&self) -> Result<String, DingTalkError>
pub async fn get_access_token(&self) -> Result<String, DingTalkError>
Retrieves the access token.
§Returns
A Result containing the access token string or a DingTalkError.
Sourcepub async fn send_group_message(
&self,
open_conversation_id: &str,
title: &str,
text: &str,
) -> Result<String, DingTalkError>
pub async fn send_group_message( &self, open_conversation_id: &str, title: &str, text: &str, ) -> Result<String, DingTalkError>
Sourcepub async fn send_oto_message(
&self,
user_id: &str,
title: &str,
text: &str,
) -> Result<String, DingTalkError>
pub async fn send_oto_message( &self, user_id: &str, title: &str, text: &str, ) -> Result<String, DingTalkError>
Sourcepub async fn reply_message(
&self,
data: &Value,
title: &str,
text: &str,
) -> Result<String, DingTalkError>
pub async fn reply_message( &self, data: &Value, title: &str, text: &str, ) -> Result<String, DingTalkError>
Replies to a message based on the provided data.
Automatically determines whether to send a group chat or private chat message.
§Arguments
data- The JSON value containing the original message data.title- The title of the reply message.text- The content of the reply message.
§Returns
A Result containing the response text or a DingTalkError.
Auto Trait Implementations§
impl Freeze for EnterpriseDingTalkRobot
impl !RefUnwindSafe for EnterpriseDingTalkRobot
impl Send for EnterpriseDingTalkRobot
impl Sync for EnterpriseDingTalkRobot
impl Unpin for EnterpriseDingTalkRobot
impl !UnwindSafe for EnterpriseDingTalkRobot
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more