| Crates.io | wecom_bot |
| lib.rs | wecom_bot |
| version | 0.2.0 |
| created_at | 2023-03-06 15:45:04.566687+00 |
| updated_at | 2023-05-04 06:14:27.28976+00 |
| description | A WeCom Bot API lib for sending group messages |
| homepage | |
| repository | |
| max_upload_size | |
| id | 802723 |
| size | 154,597 |
This library implements an interface to communicate with a WeCom Bot instance. Not all Message Type are implemented, but patches are welcome.
Add this to your Cargo.toml or run cargo add wecom_bot:
[dependencies]
wecom_bot = "0.2.0"
If you need to use async client:
$ cargo add wecom_bot --features=async_api
Here's a simple example that send markdown and text messages by using blocking api:
use wecom_bot::{WeComBot, Message, SendResp};
fn main() {
let bot = WeComBot::new("YOUR-BOT-KEY".to_string());
let rsp: SendResp = bot.send(Message::markdown("> hello world"));
assert_eq!(rsp.err_code, 0);
let rsp: SendResp = bot.send(Message::text("hello world").mentioned_list(vec!["1000"]));
assert_eq!(rsp.err_code, 0);
}
This project is licensed under Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)