Skip to content

WeCom bot sending group message API (企业微信机器人发送群消息API)

License

Notifications You must be signed in to change notification settings

hackerzgz/wecom_bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WeComBot

This library implements an interface to communicate with a WeCom Bot instance. Not all Message Type are implemented, but patches are welcome.

Build status

Usage

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);
}

License

This project is licensed under Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)

About

WeCom bot sending group message API (企业微信机器人发送群消息API)

Resources

License

Stars

Watchers

Forks

Packages

No packages published