Added curbstomp command

This commit is contained in:
August 2024-11-04 22:00:56 -05:00
parent 45fb4171f0
commit 0967f5bd8e
Signed by: shibedrill
GPG Key ID: 5FE0CB25945EFAA2
5 changed files with 26 additions and 3 deletions

2
Cargo.lock generated
View File

@ -1563,7 +1563,7 @@ dependencies = [
[[package]]
name = "shibe-bot"
version = "0.4.1"
version = "0.4.2"
dependencies = [
"anyhow",
"dotenvy",

View File

@ -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"

View File

@ -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)

View File

@ -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> {

View File

@ -87,6 +87,7 @@ async fn main() {
eightball(),
bite(),
deer(),
curbstomp(),
],
initialize_owners: true,
event_handler: |ctx, event, framework, data| {