summaryrefslogtreecommitdiff
path: root/src/commands/random.rs
blob: 6c61fdc489ec38e61aae4761e77b89a494244ba7 (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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
use crate::{api, consts, utils, Context, Error};

#[poise::command(slash_command, subcommands("lore", "teawie", "shiggy"))]
pub async fn random(_ctx: Context<'_>) -> Result<(), Error> {
	Ok(())
}

/// get a random piece of teawie lore!
#[poise::command(prefix_command, slash_command)]
pub async fn lore(ctx: Context<'_>) -> Result<(), Error> {
	match utils::random_choice(consts::LORE) {
		Ok(resp) => {
			ctx.say(resp).await?;
			Ok(())
		}
		Err(why) => {
			ctx.say("i can't think of any right now :(").await?;
			Err(why)
		}
	}
}

/// get a random teawie
#[poise::command(prefix_command, slash_command)]
pub async fn teawie(ctx: Context<'_>) -> Result<(), Error> {
	match api::guzzle::get_random_teawie().await {
		Ok(resp) => {
			ctx.say(resp).await?;
			Ok(())
		}
		Err(why) => {
			ctx.say("i'm too lazy to send a selfie").await?;
			Err(why)
		}
	}
}

/// get a random shiggy
#[poise::command(prefix_command, slash_command)]
pub async fn shiggy(ctx: Context<'_>) -> Result<(), Error> {
	match api::shiggy::get_random_shiggy().await {
		Ok(resp) => {
			ctx.say(resp).await?;
			Ok(())
		}
		Err(why) => {
			ctx.say("i can't get a shiggy right now :(").await?;
			Err(why)
		}
	}
}