feat: add roll slash command

This commit is contained in:
2025-09-02 15:18:01 +02:00
parent 713d264544
commit 9c6249ca41
3 changed files with 76 additions and 1 deletions

View File

@@ -2,6 +2,10 @@ use color_eyre::eyre::{Error, Result};
use poise::serenity_prelude::{self as serenity, FullEvent};
use tracing::info;
mod roll;
type Context<'a> = poise::Context<'a, (), Error>;
fn event_handler(_ctx: serenity::Context, event: &FullEvent) {
if let FullEvent::Ready { data_about_bot } = event {
info!("Logged in as {}", data_about_bot.user.name);
@@ -13,7 +17,7 @@ pub async fn make_bot() -> Result<serenity::Client> {
let intents = serenity::GatewayIntents::non_privileged();
let framework = poise::Framework::<(), Error>::builder()
.options(poise::FrameworkOptions {
commands: vec![],
commands: vec![roll::roll()],
event_handler: |ctx, event, _framework: poise::FrameworkContext<'_, (), _>, _data| {
Box::pin(async move {
event_handler(ctx.clone(), event);