I love discord api!!!!

This commit is contained in:
Yash Karandikar 2023-07-10 12:55:32 -05:00
parent 87b8e557fb
commit 1a60af9512

View file

@ -65,7 +65,7 @@ impl<'a> StrChunks<'a> {
async fn create_prefix(msg: &Message, is_reply: bool, http: impl CacheHttp) -> (String, usize) {
// it's okay to unwrap here since we know we're in a guild
let nick = msg.member(http).await.unwrap().display_name().to_owned();
let Ok(nick) = msg.member(http).await.map(|m| m.display_name().to_owned()) else { return ("(reply) ".into(), 400 - "(reply) ".len()) };
let mut chars = nick.char_indices();
let first_char = chars.next().unwrap().1;