# railgun ## A Discord API Library written in Rust using native async/await ## Index - [Brief](#Brief) - [Status](#Status) - [Examples](#Examples) ## [Brief](#Index) Was bored. Started messing around with native async/await in Rust, wanted to test it out whilst writing a discord library. ## [Status](#Index) ### MVP - [ ] REST API Coverage - [ ] Websocket gateway coverage - [ ] Voice support? - [ ] Event listeners via procedural macros ## [Examples](#Index) > *Disclaimer! The examples shown below are what the library is aiming to eventually look like.* ### [Ping pong](#Examples) ```rust use { std::{env, io}, railgun::{Client, register} } #[railgun::event(on = "MESSAGE_CREATE")] async fn on_message(client: &Client, message: Message) -> Option { println!("{:?}", message); if message.content.starts_with("?ping") { client.send(&message.channel, "Pong!").await?; } None } #[tokio::main] async fn main() { Client::default() .mount(register![on_message]) .run(env::var("DISCORD_TOKEN")).await .expect("Could not start discord client."); } ```