Crates.io | eludrs |
lib.rs | eludrs |
version | 0.3.3 |
source | src |
created_at | 2023-01-22 11:36:41.119449 |
updated_at | 2023-05-23 21:55:12.341085 |
description | A simple API wrapper for Eludris built on Tokio |
homepage | https://github.com/eludris-community/eludrs |
repository | https://github.com/eludris-community/eludrs |
max_upload_size | |
id | 764921 |
size | 17,521 |
A simple asynchronous wrapper for the Eludris API
Just run the following command:
cargo add --git eludrs
While an API wrapper has many uses, here's an example of what most people will end up using this for, making Bots:
use eludrs::HttpClient;
use futures::stream::StreamExt;
#[tokio::main]
async fn main() {
let mut http = HttpClient::new().name("Uwuki".to_string());
let gateway = http.create_gateway.await?;
let mut events = gateway.get_events().await.unwrap();
while let Some(msg) = events.next().await {
if msg.content == "!ping" {
http.send("Pong").await.unwrap();
}
}
}
If you want documentation you can currently get that by going to your project and running
cargo doc -p eludrs --open