From 0025ad5ea8d412aacc3184d18063fd5ff3de0175 Mon Sep 17 00:00:00 2001 From: seth Date: Sat, 2 Dec 2023 07:00:24 -0500 Subject: feat: add per guild configuration --- src/commands/general/random.rs | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/commands/general/random.rs (limited to 'src/commands/general/random.rs') diff --git a/src/commands/general/random.rs b/src/commands/general/random.rs new file mode 100644 index 0000000..9aa282a --- /dev/null +++ b/src/commands/general/random.rs @@ -0,0 +1,29 @@ +use crate::{api, consts, utils, Context}; +use color_eyre::eyre::Result; + +#[poise::command(slash_command, subcommands("lore", "teawie", "shiggy"))] +pub async fn random(_ctx: Context<'_>) -> Result<()> { + Ok(()) +} + +/// get a random piece of teawie lore! +#[poise::command(prefix_command, slash_command)] +pub async fn lore(ctx: Context<'_>) -> Result<()> { + let resp = utils::random_choice(consts::LORE)?; + ctx.say(resp).await?; + Ok(()) +} + +/// get a random teawie +#[poise::command(prefix_command, slash_command)] +pub async fn teawie(ctx: Context<'_>) -> Result<()> { + let url = api::guzzle::get_random_teawie().await?; + utils::send_url_as_embed(ctx, url).await +} + +/// get a random shiggy +#[poise::command(prefix_command, slash_command)] +pub async fn shiggy(ctx: Context<'_>) -> Result<()> { + let url = api::shiggy::get_random_shiggy().await?; + utils::send_url_as_embed(ctx, url).await +} -- cgit v1.2.3