panda 0.2.1

An async Rust library for Discord
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#[async_std::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let mut client = panda::new("your token here").await?;

    client.on_message_create(|s, msg| async move {
        if msg.content() == "!ping" {
            msg.send_message(&s.http, "!pong").await?;
        }

        Ok(())
    });

    client.start().await?;
    Ok(())
}