tangled
alpha
login
or
join now
isabelroses.com
/
blahaj
1
fork
atom
silly goober bot
1
fork
atom
overview
issues
pulls
pipelines
MEOW (#14)
authored by
April
and committed by
GitHub
8 months ago
e3e46ea9
99546cb6
+38
-1
3 changed files
expand all
collapse all
unified
split
src
commands
fun
height.rs
mod.rs
main.rs
+35
src/commands/fun/height.rs
···
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
···
1
+
use crate::types::Context;
2
+
use color_eyre::eyre::Result;
3
+
use poise::serenity_prelude::User;
4
+
use rand::Rng;
5
+
6
+
#[poise::command(slash_command)]
7
+
pub async fn height(
8
+
ctx: Context<'_>,
9
+
#[description = "Selected user"] user: Option<User>,
10
+
) -> Result<()> {
11
+
let user = user.as_ref().unwrap_or_else(|| ctx.author());
12
+
13
+
let (feet, inches, cm) = match user.id.get() {
14
+
463566237918691338 => (8, 5, 256),
15
+
474274492810788864 => (4, 1, 124),
16
+
_ => {
17
+
let total_inches = rand::rng().random_range(49..=101);
18
+
let feet = total_inches / 12;
19
+
let inches = total_inches % 12;
20
+
let cm = (total_inches as f32 * 2.54) as u32;
21
+
(feet, inches, cm)
22
+
}
23
+
};
24
+
25
+
ctx.say(format!(
26
+
"🔮 **{}** is **{}'{}\"** (**{} cm**) tall!",
27
+
user.display_name(),
28
+
feet,
29
+
inches,
30
+
cm
31
+
))
32
+
.await?;
33
+
34
+
Ok(())
35
+
}
+2
-1
src/commands/fun/mod.rs
···
1
pub mod bottom;
2
pub mod chance;
0
3
pub mod kittysay;
4
pub mod nix;
5
-
pub mod pet;
···
1
pub mod bottom;
2
pub mod chance;
3
+
pub mod height;
4
pub mod kittysay;
5
pub mod nix;
6
+
pub mod pet;
+1
src/main.rs
···
48
commands::fun::bottom::topify(),
49
commands::fun::bottom::bottomify(),
50
commands::fun::pet::pet(),
0
51
],
52
event_handler: |ctx, event, _, data| {
53
Box::pin(crate::event_handler::event_handler(ctx, event, data))
···
48
commands::fun::bottom::topify(),
49
commands::fun::bottom::bottomify(),
50
commands::fun::pet::pet(),
51
+
commands::fun::height::height(),
52
],
53
event_handler: |ctx, event, _, data| {
54
Box::pin(crate::event_handler::event_handler(ctx, event, data))