From 0967f5bd8e2e60fc3f1d0d92d247b45432f9fa14 Mon Sep 17 00:00:00 2001 From: shibedrill Date: Mon, 4 Nov 2024 22:00:56 -0500 Subject: [PATCH] Added curbstomp command --- Cargo.lock | 2 +- Cargo.toml | 2 +- README.md | 2 +- src/command/fun.rs | 22 ++++++++++++++++++++++ src/main.rs | 1 + 5 files changed, 26 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bf74d79..9811c18 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1563,7 +1563,7 @@ dependencies = [ [[package]] name = "shibe-bot" -version = "0.4.1" +version = "0.4.2" dependencies = [ "anyhow", "dotenvy", diff --git a/Cargo.toml b/Cargo.toml index d4cbf4c..474980a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ name = "shibe-bot" description = "A Discord bot written in Rust, using Poise." license = "MIT" readme = "README.md" -version = "0.4.1" +version = "0.4.2" edition = "2021" build = "build.rs" diff --git a/README.md b/README.md index d8ff59b..c827d8e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Shibe Bot 0.4.1 +# Shibe Bot 0.4.2 [![Rust](https://github.com/shibedrill/shibe-bot/actions/workflows/rust.yml/badge.svg)](https://github.com/shibedrill/shibe-bot/actions/workflows/rust.yml) [![GitHub License](https://img.shields.io/github/license/shibedrill/shibe-bot)](LICENSE.txt) diff --git a/src/command/fun.rs b/src/command/fun.rs index d6ac574..41d5600 100644 --- a/src/command/fun.rs +++ b/src/command/fun.rs @@ -78,6 +78,28 @@ pub async fn whack( Ok(()) } +// For your enemies! +#[poise::command(slash_command)] +pub async fn curbstomp( + ctx: Context<'_>, + #[description = "The target user"] target: serenity::User, +) -> Result<(), Error> { + let response: &str = if &target == ctx.author() { + "I don't think you can curbstomp yourself." + } else if target == **ctx.cache().current_user() { + "nice try lol" + } else { + &format!( + "{} made {} eat pavement.", + ctx.author(), + target + ) + }; + ctx.say(response).await?; + info!("Executed command `whack` successfully"); + Ok(()) +} + /// Magic 8-ball #[poise::command(slash_command)] pub async fn eightball(ctx: Context<'_>) -> Result<(), Error> { diff --git a/src/main.rs b/src/main.rs index 150c930..8d82a16 100644 --- a/src/main.rs +++ b/src/main.rs @@ -87,6 +87,7 @@ async fn main() { eightball(), bite(), deer(), + curbstomp(), ], initialize_owners: true, event_handler: |ctx, event, framework, data| {