Make arguments required

This commit is contained in:
shibedrill 2024-04-25 15:06:43 -04:00
parent 96bd73b783
commit dd696437d4

View File

@ -9,14 +9,14 @@ use rand::*;
#[poise::command(slash_command)] #[poise::command(slash_command)]
pub async fn meow(ctx: Context<'_>) -> Result<(), Error> { pub async fn meow(ctx: Context<'_>) -> Result<(), Error> {
let meows = [ let meows = [
"meow", "meow",
"mrow", "mrow",
"mrrrp", "mrrrp",
"mraaw", "mraaw",
"bwrrrr", "bwrrrr",
"mrrghh", "mrrghh",
"mrowwwwwwwwwwww", "mrowwwwwwwwwwww",
"FUCK", "FUCK",
]; ];
let response = { let response = {
let mut rng = rand::thread_rng(); let mut rng = rand::thread_rng();
@ -36,18 +36,14 @@ pub async fn meow(ctx: Context<'_>) -> Result<(), Error> {
#[poise::command(slash_command)] #[poise::command(slash_command)]
pub async fn penis( pub async fn penis(
ctx: Context<'_>, ctx: Context<'_>,
#[description = "The target user"] target: Option<serenity::User>, #[description = "The target user"] target: serenity::User,
) -> Result<(), Error> { ) -> Result<(), Error> {
if let Some(target_unwrapped) = target { ctx.say(format!(
ctx.say(format!( "<@{}> has been penised. they must penis another user to become un-penised",
"<@{}> has been penised. they must penis another user to become un-penised", target.id
target_unwrapped.id ))
)) .await?;
.await?; info!("Executed command `penis` successfully");
info!("Executed command `penis` successfully");
} else {
error!("Failed to execute command `penis`");
}
Ok(()) Ok(())
} }
@ -55,33 +51,33 @@ pub async fn penis(
#[poise::command(slash_command)] #[poise::command(slash_command)]
pub async fn eightball(ctx: Context<'_>) -> Result<(), Error> { pub async fn eightball(ctx: Context<'_>) -> Result<(), Error> {
let responses = [ let responses = [
"It is certain", "It is certain",
"It is decidedly so", "It is decidedly so",
"Without a doubt", "Without a doubt",
"Yes definitely", "Yes definitely",
"You may rely on it", "You may rely on it",
"As I see it, yes", "As I see it, yes",
"Most likely", "Most likely",
"Outlook good", "Outlook good",
"Yes", "Yes",
"Signs point to yes", "Signs point to yes",
"Reply hazy, try again", "Reply hazy, try again",
"Ask again later", "Ask again later",
"Better not to tell you now", "Better not to tell you now",
"Cannot predict now", "Cannot predict now",
"Concentrate and ask again", "Concentrate and ask again",
"Don't count on it", "Don't count on it",
"My reply is no", "My reply is no",
"My sources say no", "My sources say no",
"Outlook not so good", "Outlook not so good",
"Very doubtful", "Very doubtful",
]; ];
let response = { let response = {
let mut rng = rand::thread_rng(); let mut rng = rand::thread_rng();
responses.choose(&mut rng).unwrap() responses.choose(&mut rng).unwrap()
}; };
ctx.say(format!("Magic 8-ball says: '{}'", *response)) ctx.say(format!("Magic 8-ball says: '{}'", *response))
.await?; .await?;
info!("Executed command `eightball` successfully"); info!("Executed command `eightball` successfully");
Ok(()) Ok(())
} }
@ -90,18 +86,14 @@ pub async fn eightball(ctx: Context<'_>) -> Result<(), Error> {
#[poise::command(slash_command)] #[poise::command(slash_command)]
pub async fn bite( pub async fn bite(
ctx: Context<'_>, ctx: Context<'_>,
#[description = "The target user"] target: Option<serenity::User>, #[description = "The target user"] target: serenity::User,
) -> Result<(), Error> { ) -> Result<(), Error> {
if let Some(target_unwrapped) = target { ctx.say(format!(
ctx.say(format!( "<@{}> has been bitten by <@{}>",
"<@{}> has been bitten by <@{}>", target.id,
target_unwrapped.id, ctx.author().id,
ctx.author().id, ))
)) .await?;
.await?; info!("Executed command `bite` successfully");
info!("Executed command `bite` successfully");
} else {
error!("Failed to execute command `bite`");
}
Ok(()) Ok(())
} }