Expand description
§wecom-agent
wecom-agent
封装了企业微信API的消息发送功能。
§使用方法
use wecom_agent::{
message::{MessageBuilder, Text},
MsgSendResponse, WecomAgent,
};
async fn example() {
let content = Text::new("Hello from Wandering AI!".to_string());
let msg = MessageBuilder::default()
.to_users(vec!["robin", "tom"])
.from_agent(42)
.build(content)
.expect("Massage should be built");
let handle = tokio::spawn(async move {
let wecom_agent = WecomAgent::new("your_corpid", "your_secret");
let response = wecom_agent.send(msg).await;
});
}
Modules§
Structs§
- MsgSend
Response - Wecom
Agent - 企业微信API的轻量封装