Crates.io | dbl-rs |
lib.rs | dbl-rs |
version | 0.4.0 |
source | src |
created_at | 2019-06-11 15:23:28.921143 |
updated_at | 2024-03-21 16:13:38.897813 |
description | API Bindings for top.gg / discordbots.org |
homepage | |
repository | https://github.com/nickelc/dbl-rs |
max_upload_size | |
id | 140403 |
size | 67,255 |
Rust bindings for the top.gg / discordbots.org API.
Add this to your Cargo.toml
[dependencies]
dbl-rs = "0.3"
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),
}
}
See examples directory for some getting started examples.
Licensed under either of
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.