diff --git a/src/actions/ban.rs b/src/actions/ban.rs index 46fe8b6..0b44fa6 100644 --- a/src/actions/ban.rs +++ b/src/actions/ban.rs @@ -41,7 +41,7 @@ pub async fn ban_member( { Ok(EventReturn::Cancel) } else { - let banned_user_name: String = user.get_user_name(&bot, &message).await.unwrap(); + let banned_user_name: Box = user.get_user_name(&bot, &message).await.unwrap(); sender_builder .reply_to(message.id()) diff --git a/src/actions/mute.rs b/src/actions/mute.rs index 92e17b2..f91edcf 100644 --- a/src/actions/mute.rs +++ b/src/actions/mute.rs @@ -45,7 +45,7 @@ pub async fn mute_member( { Ok(EventReturn::Cancel) } else { - let muted_user_name: String = user.get_user_name(&bot, &message).await.unwrap(); + let muted_user_name: Box = user.get_user_name(&bot, &message).await.unwrap(); sender_builder .reply_to(message.id()) diff --git a/src/actions/unmute.rs b/src/actions/unmute.rs index 4a6f016..f3b2db6 100644 --- a/src/actions/unmute.rs +++ b/src/actions/unmute.rs @@ -46,7 +46,7 @@ pub async fn unmute_member( Ok(EventReturn::Cancel) } else { - let muted_user_name: String = user.get_user_name(&bot, &message).await.unwrap(); + let muted_user_name: Box = user.get_user_name(&bot, &message).await.unwrap(); sender_builder .reply_to(message.id()) diff --git a/src/types/enums/target_user.rs b/src/types/enums/target_user.rs index 8cca6ad..54fa7b7 100644 --- a/src/types/enums/target_user.rs +++ b/src/types/enums/target_user.rs @@ -21,7 +21,7 @@ impl TargetUser { Self::Id(_id) => true, Self::Reply(msg) => { if let Some(replied_msg) = msg.reply_to_message() { - return replied_msg.from().map(|user| user.id).is_some(); + replied_msg.from().map(|user| user.id).is_some() } else { false } @@ -46,7 +46,7 @@ impl TargetUser { } } - pub async fn get_user_name(&self, bot: &Bot, msg: &Message) -> Option { + pub async fn get_user_name(&self, bot: &Bot, msg: &Message) -> Option> { match self { Self::Id(id) => { let get_chat_member_result: Result =