diff options
Diffstat (limited to 'src/commands/general/random.rs')
| -rw-r--r-- | src/commands/general/random.rs | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/src/commands/general/random.rs b/src/commands/general/random.rs index 7c7ceff..92e9188 100644 --- a/src/commands/general/random.rs +++ b/src/commands/general/random.rs @@ -1,31 +1,34 @@ -use crate::{api, consts, utils, Context}; +use crate::{api, consts, utils, Context, Error}; -use eyre::Result; - -#[allow(clippy::unused_async)] #[poise::command(slash_command, subcommands("lore", "teawie", "shiggy"))] -pub async fn random(_ctx: Context<'_>) -> Result<()> { +#[allow(clippy::unused_async)] +pub async fn random(_: Context<'_>) -> Result<(), Error> { Ok(()) } /// Get a random piece of teawie lore! #[poise::command(prefix_command, slash_command)] -pub async fn lore(ctx: Context<'_>) -> Result<()> { +pub async fn lore(ctx: Context<'_>) -> Result<(), Error> { 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 +pub async fn teawie(ctx: Context<'_>) -> Result<(), Error> { + let url = api::guzzle::random_teawie().await?; + utils::send_url_as_embed(ctx, url).await?; + + Ok(()) } /// 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 +pub async fn shiggy(ctx: Context<'_>) -> Result<(), Error> { + let url = api::shiggy::random_shiggy().await?; + utils::send_url_as_embed(ctx, url).await?; + + Ok(()) } |
