[][src]Crate discord_api

A library for fetching various structures from the Discord API. This is not a fully fledged Discord wrapper nor does it attempt to be. It contains some structures deemed useful.

This library should maintain feature parity with the included binary, available at https://github.com/jos-b/discord in that all new structures added to this library should be accessible in some way through the binary.

Examples

Fetch a guild name from an invite code

use discord_api::get_invite;
let invite = get_invite("python").await?;

if let Some(guild) = invite.guild {
  println!("Invite for: {}", guild.name);
}

Fetch a guild invite and list the features

use discord_api::get_invite;

let invite = get_invite("python").await?;

if let Some(guild) = invite.guild {
  for feature in guild.features {
    println!("{}", feature);
  }
}

Re-exports

pub use http::get_invite;

Modules

http
models

Module containing various structures received from the Discord API.