Skip to main content

Crate wechatbot

Crate wechatbot 

Source
Expand description

§wechatbot

WeChat iLink Bot SDK for Rust.

§Quick Start

use wechatbot::{WeChatBot, BotOptions};

#[tokio::main]
async fn main() {
    let bot = WeChatBot::new(BotOptions::default());
    bot.login(false).await.unwrap();

    bot.on_message(Box::new(|msg| {
        println!("{}: {}", msg.user_id, msg.text);
    })).await;

    bot.run().await.unwrap();
}

Re-exports§

pub use bot::BotOptions;
pub use bot::MessageHandler;
pub use bot::WeChatBot;
pub use crypto::decrypt_aes_ecb;
pub use crypto::decrypt_aes_ecb as download_decrypt;
pub use crypto::encode_aes_key_base64;
pub use crypto::encode_aes_key_hex;
pub use crypto::encrypt_aes_ecb;
pub use crypto::generate_aes_key;
pub use crypto::decode_aes_key;
pub use error::Result;
pub use error::WeChatBotError;
pub use types::*;

Modules§

bot
Main WeChatBot client.
crypto
AES-128-ECB encryption for WeChat CDN media files.
error
protocol
Raw iLink Bot API HTTP calls.
types