MEOW (#14)

authored by April and committed by GitHub e3e46ea9 99546cb6

Changed files
+38 -1
src
commands
+35
src/commands/fun/height.rs
··· 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 1 pub mod bottom; 2 2 pub mod chance; 3 + pub mod height; 3 4 pub mod kittysay; 4 5 pub mod nix; 5 - pub mod pet; 6 + pub mod pet;
+1
src/main.rs
··· 48 48 commands::fun::bottom::topify(), 49 49 commands::fun::bottom::bottomify(), 50 50 commands::fun::pet::pet(), 51 + commands::fun::height::height(), 51 52 ], 52 53 event_handler: |ctx, event, _, data| { 53 54 Box::pin(crate::event_handler::event_handler(ctx, event, data))