summaryrefslogtreecommitdiff
path: root/src/commands/general/random.rs
blob: 9595d0975370dc904a618a5edd6f3211b5a9a3f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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
}