Crate discord_selfbot

Crate discord_selfbot 

Source
Expand description

§Discord Selfbot

An unofficial Discord API library for user accounts (selfbots) in 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_selfbot::{Client, ClientBuilder, EventHandler, User};
use std::sync::Arc;
use async_trait::async_trait;

struct MyHandler;

#[async_trait]
impl EventHandler for MyHandler {
    async fn 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::guild::Guild;
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;

Modules§

client
error
events
gateway
http
models
utils