9 releases

0.4.0 Mar 21, 2024
0.3.2 Dec 7, 2021
0.3.1 Mar 12, 2021
0.3.0 Jan 5, 2021
0.1.1 Jun 12, 2019

#174 in HTTP client

Download history 68/week @ 2024-07-21 139/week @ 2024-07-28 78/week @ 2024-08-04 186/week @ 2024-08-11 37/week @ 2024-08-18 51/week @ 2024-08-25 57/week @ 2024-09-01 58/week @ 2024-09-08 57/week @ 2024-09-15 71/week @ 2024-09-22 17/week @ 2024-09-29 39/week @ 2024-10-06 49/week @ 2024-10-13 19/week @ 2024-10-20 44/week @ 2024-10-27 61/week @ 2024-11-03

179 downloads per month

MIT/Apache

24KB
562 lines

dbl-rs

crates.io docs.rs Rust version License build status

Rust bindings for the top.gg / discordbots.org API.

Usage

Add this to your Cargo.toml

[dependencies]
dbl-rs = "0.3"

Example

use dbl::types::ShardStats;
use dbl::Client;

#[tokio::main]
async fn main() {
    let token = match std::env::var("DBL_TOKEN") {
        Ok(token) => token,
        _ => panic!("missing token"),
    };

    let client = Client::new(token).expect("failed client");

    let bot = 565_030_624_499_466_240;
    let stats = ShardStats::Cumulative {
        server_count: 1234,
        shard_count: None,
    };

    match client.update_stats(bot, stats).await {
        Ok(_) => println!("Update successful"),
        Err(e) => eprintln!("{}", e),
    }
}

Examples

See examples directory for some getting started examples.

License

Licensed under either of

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~4–17MB
~245K SLoC