Skip to content

ImpossibleReality/ataraxy

Repository files navigation

Ataraxy
Discord slash commands framework for Serenity inspired by Poise


Usage

Ataraxy is based off of the #[command] macro, which wraps a function and turns it into a usable command.

/// Says "Hello world"
#[command]
async fn say_hello(
    ctx: Context,
    #[option(channel_type = "text", description = "Text channel to say hello to")]
    channel: ChannelId,
) {
    channel
        .send_message(&ctx.http(), |m| m.content("Hello, world!"))
        .await;
    ctx.reply_ephemeral("Message sent successfully.").await;
}

You can then register commands and command groups to ataraxy's Framework.

let framework = Framework::new().command(test_cmd);

Ataraxy's Framework implements Serenity's EventHandler trait so that you can use it in the serenity Client

let mut client = Client::builder(token)
    .event_handler(framework)
    .application_id(application_id)
    .await
    .expect("Error creating client");

if let Err(why) = client.start().await {
    println!("Client error: {:?}", why);
}

It's as easy as that!

About

Rust slash commands framework for Serenity

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages