From 0ea6e18475e79bb0a932c73b0534735913aede9f Mon Sep 17 00:00:00 2001 From: missing <4a656666official@gmail.com> Date: Wed, 15 Jun 2022 13:03:52 -0500 Subject: [PATCH] first_char --- src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 2edce6f..fcfdfe1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -93,8 +93,8 @@ async fn create_prefix(msg: &Message, is_reply: bool, http: impl CacheHttp) -> ( _ => Cow::Borrowed(&msg.author.name), }; - let byte = nick.bytes().next().unwrap(); - let colour_index = (byte as usize + nick.len()) % 12; + let first_char = nick.chars().next().unwrap(); + let colour_index = (first_char as usize + nick.len()) % 12; let mut first_char = 1; loop {