zxcv05 / hubbub

Rust library for creating discord self-bots
GNU General Public License v3.0
3 stars 2 forks source link
discord discord-bot discord-selfbot rust rust-library selfbot

Hubbub

Rust library for creating discord self-bots (very early in development)

Current features

Using the library

  1. Add the library to your project using cargo add hubbub
  2. Import hubbub::prelude::*:
  3. Create your model
    struct App {
    // ...
    }
  4. Create the client

    #[tokio::main]
    async fn main() -> anyhow::Result<()> {
    let mut client = Client::new(
        App { /* ... */ },
        /* Event handler */
    ).await?;
    
    client.token(/* Token */).await?;
    client.login().await?;
    client.run().await?;
    }
  5. Create the event handler

    async fn main() {
    // ...
    
    /* Event handler */
    Box::from(
        |ctx: Ctx, ws: Ws, model: Model<App>, msg: DiscordMessage| async move {
            /* do work here */
        }
    )
    
    // ...
    }
  6. Success, hopefully!

Any questions?