Skip to main content

discord_authority/
lib.rs

1//! # discord-authority
2//!
3//! A fast, async Discord selfbot library for Rust.
4//!
5//! ## Warning
6//! Using selfbots is against Discord's Terms of Service and can result in account termination.
7//! Use this library at your own risk.
8//!
9//! ## Example
10//! ```no_run
11//! use discord_authority::{Client, ClientBuilder, EventHandler, User};
12//! use std::sync::Arc;
13//! use async_trait::async_trait;
14//!
15//! struct MyHandler;
16//!
17//! #[async_trait]
18//! impl EventHandler for MyHandler {
19//!     async fn on_ready(&self, user: User) {
20//!         println!("{} is ready!", user.username);
21//!     }
22//! }
23//!
24//! #[tokio::main]
25//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
26//!     let client = ClientBuilder::new("YOUR_TOKEN")
27//!         .event_handler(Arc::new(MyHandler))
28//!         .build()
29//!         .await?;
30//!     
31//!     client.listen().await?;
32//!     Ok(())
33//! }
34//! ```
35
36pub mod client;
37pub mod error;
38pub mod gateway;
39pub mod http;
40pub mod models;
41pub mod events;
42pub mod utils;
43
44// Re-exports
45pub use client::{Client, ClientBuilder};
46pub use error::{Error, Result};
47pub use models::{
48    channel::{Channel, Invite},
49    guild::{Guild, GuildMember, Role, Ban},
50    message::{Message, MessageBuilder},
51    user::User,
52    embed::Embed,
53    presence::{Activity, Presence, CustomStatus, RichPresence, SpotifyRPC},
54    poll::Poll,
55};
56pub use events::{EventHandler, ReactionEvent};
57