Expand description
§discord-authority
A fast, async Discord selfbot library for Rust.
§Warning
Using selfbots is against Discord’s Terms of Service and can result in account termination. Use this library at your own risk.
§Example
use discord_authority::{Client, ClientBuilder, EventHandler, User};
use std::sync::Arc;
use async_trait::async_trait;
struct MyHandler;
#[async_trait]
impl EventHandler for MyHandler {
async fn on_ready(&self, user: User) {
println!("{} is ready!", user.username);
}
}
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = ClientBuilder::new("YOUR_TOKEN")
.event_handler(Arc::new(MyHandler))
.build()
.await?;
client.listen().await?;
Ok(())
}Re-exports§
pub use client::Client;pub use client::ClientBuilder;pub use error::Error;pub use error::Result;pub use models::channel::Channel;pub use models::channel::Invite;pub use models::guild::Guild;pub use models::guild::GuildMember;pub use models::guild::Role;pub use models::guild::Ban;pub use models::message::Message;pub use models::message::MessageBuilder;pub use models::user::User;pub use models::embed::Embed;pub use models::presence::Activity;pub use models::presence::Presence;pub use models::presence::CustomStatus;pub use models::presence::RichPresence;pub use models::presence::SpotifyRPC;pub use models::poll::Poll;pub use events::EventHandler;pub use events::ReactionEvent;