From f244305ef115ffcbcb340ec7f3b97df31ccd2094 Mon Sep 17 00:00:00 2001 From: Alzalia Date: Sun, 31 Aug 2025 17:12:24 +0200 Subject: [PATCH 1/2] feat: breakdance time --- .gitignore | 1 + src/commands/fun/breakdance.rs | 21 +++++++++++++++++++++ src/commands/fun/mod.rs | 1 + src/main.rs | 6 +++++- 4 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 src/commands/fun/breakdance.rs diff --git a/.gitignore b/.gitignore index fedaa2b..e3990da 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /target +/res .env diff --git a/src/commands/fun/breakdance.rs b/src/commands/fun/breakdance.rs new file mode 100644 index 0000000..7458d59 --- /dev/null +++ b/src/commands/fun/breakdance.rs @@ -0,0 +1,21 @@ +use poise::CreateReply; +use serenity::all::CreateAttachment; + +use crate::{Context, Error}; + +/// A bee will do a lil' breakdance +#[poise::command(slash_command, prefix_command)] +pub async fn breakdance(ctx: Context<'_>) -> Result<(), Error> { + let reply = CreateReply { + content: Some("Time to... BREAKDAAAAAAANCE".to_string()), + attachments: vec![ + CreateAttachment::path("./res/breakdance_bee.webm") + .await + .unwrap(), + ], + ..Default::default() + }; + + ctx.send(reply).await?; + Ok(()) +} diff --git a/src/commands/fun/mod.rs b/src/commands/fun/mod.rs index 567b8dc..d64cb74 100644 --- a/src/commands/fun/mod.rs +++ b/src/commands/fun/mod.rs @@ -1,2 +1,3 @@ +pub mod breakdance; pub mod ping; pub mod roll; diff --git a/src/main.rs b/src/main.rs index 65acc2c..edb3001 100644 --- a/src/main.rs +++ b/src/main.rs @@ -13,7 +13,11 @@ async fn main() { let framework = poise::Framework::builder() .options(poise::FrameworkOptions { - commands: vec![commands::fun::ping::ping(), commands::fun::roll::roll()], + commands: vec![ + commands::fun::ping::ping(), + commands::fun::roll::roll(), + commands::fun::breakdance::breakdance(), + ], ..Default::default() }) .setup(|ctx, _ready, framework| { -- 2.47.3 From b0e0773d691333b98d18e81f31e454f45ee365e2 Mon Sep 17 00:00:00 2001 From: Alzalia Date: Sun, 31 Aug 2025 17:13:18 +0200 Subject: [PATCH 2/2] fix: comments --- src/commands/fun/ping.rs | 2 +- src/commands/fun/roll.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commands/fun/ping.rs b/src/commands/fun/ping.rs index df56db6..f28f58e 100644 --- a/src/commands/fun/ping.rs +++ b/src/commands/fun/ping.rs @@ -1,6 +1,6 @@ use crate::{Context, Error}; -/// Displays your or another user's account creation date +/// Returns a pong #[poise::command(slash_command, prefix_command)] pub async fn ping(ctx: Context<'_>) -> Result<(), Error> { let response = format!("pong {} !", ctx.author().display_name()); diff --git a/src/commands/fun/roll.rs b/src/commands/fun/roll.rs index fbdf8bb..8a5760e 100644 --- a/src/commands/fun/roll.rs +++ b/src/commands/fun/roll.rs @@ -2,7 +2,7 @@ use crate::{Context, Error}; use rand::prelude::*; -/// Displays your or another user's account creation date +/// Will throw a dice of x faces #[poise::command(slash_command, prefix_command)] pub async fn roll( ctx: Context<'_>, -- 2.47.3