From 17850775105064398ae3066ca624f5c8322d1315 Mon Sep 17 00:00:00 2001 From: Agatha Date: Fri, 3 Apr 2020 02:58:00 +0300 Subject: [PATCH] Update help command Rewrite ship compatibility bar code --- src/main.rs | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/src/main.rs b/src/main.rs index f039d75..f696464 100755 --- a/src/main.rs +++ b/src/main.rs @@ -315,19 +315,8 @@ fn ship(ctx: &mut Context, message: &Message, args: Args) -> CommandResult { let compat: u64 = StdRng::seed_from_u64(calculate_hash(&names)).gen_range(50, 100); // Initialize a bar to display compatibility percentage - let mut compbar = String::new(); - - let mut num = 0; - while num < compat / 10 { - compbar.push('▬'); - num += 1; - } - compbar.push_str(":purple_heart:"); - num = 0; - while num < (10 - compat / 10) { - compbar.push('▬'); - num += 1; - } + let mut compbar = String::from("----------"); + compbar.insert_str((compat / 10) as usize, ":purple_heart:"); // Convert names to a Vec let names = names @@ -485,17 +474,17 @@ fn help(ctx: &mut Context, message: &Message) -> CommandResult { "Find a definition of word", false, ), + ( + "owo embed ``[args]``", + "Create an embed from a Toml object", + false, + ), ("owo ship ``[names]``", "*shipping intensifies*", false), ("owo headpat ``name``", "Headpat someone", false), ("owo owo ``text``", "owoify input text", false), ("\u{200B}", "**Admin commands:**", false), ("owo halt", "kill me", false), ("owo list_srv", "list my servers", false), - ( - "owo embed ``[args]``", - "Create an embed from a Toml object", - false, - ), ("owo host", "Display host info", false), ]) .color(0xffd1dc)