From 0d0e68fec058b7a8b8e9a4768a183ec08ffad770 Mon Sep 17 00:00:00 2001 From: seth Date: Fri, 7 Apr 2023 22:59:35 -0400 Subject: add bottom subcommands --- src/commands/bottom_decode.rs | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 src/commands/bottom_decode.rs (limited to 'src/commands/bottom_decode.rs') diff --git a/src/commands/bottom_decode.rs b/src/commands/bottom_decode.rs deleted file mode 100644 index fb91756..0000000 --- a/src/commands/bottom_decode.rs +++ /dev/null @@ -1,35 +0,0 @@ -use crate::utils; -use serenity::builder::CreateApplicationCommand; -use serenity::model::prelude::command::CommandOptionType; -use serenity::model::prelude::interaction::application_command::{ - CommandDataOption, CommandDataOptionValue, -}; - -pub async fn run(options: &[CommandDataOption]) -> String { - let err_msg = "expected a copyasta"; - let option = options - .get(0) - .expect(err_msg) - .resolved - .as_ref() - .expect(err_msg); - - if let CommandDataOptionValue::String(msg) = option { - return utils::bottom_decode(msg).await; - } - - "did you forget to enter a message?".to_string() -} - -pub fn register(command: &mut CreateApplicationCommand) -> &mut CreateApplicationCommand { - command - .name("bottom_decode") - .description("teawie will translate something from bottom for you 🥺") - .create_option(|option| { - option - .name("message") - .description("what you want teawie to translate") - .kind(CommandOptionType::String) - .required(true) - }) -} -- cgit v1.2.3