Skip to content

Commit

Permalink
Fix user check because the is_private check is broken
Browse files Browse the repository at this point in the history
  • Loading branch information
AnnsAnns committed Jul 27, 2023
1 parent ac7d189 commit 1299e0b
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1299e0b

Please sign in to comment.