From 1299e0bea296967a6a7daeb3c786952861843bf9 Mon Sep 17 00:00:00 2001 From: tumGER Date: Fri, 28 Jul 2023 00:42:15 +0200 Subject: [PATCH] Fix user check because the is_private check is broken --- src/main.rs | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/main.rs b/src/main.rs index a012559..5be8bc8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -83,17 +83,10 @@ impl EventHandler for Handler { return; } - if !msg.is_private() { - let user = &component.member.as_ref().unwrap().user; - // If the user is the bot return - if user.bot { - return; - } - - // Check whether user is correct - if !msg.content.contains(&user.id.to_string()) { - return; - } + let user = component.user.id.to_string(); + // Check whether user is correct + if !msg.content.contains(&user) { + return; } component