Skip to content

Commit

Permalink
Ignore bot name capitalization
Browse files Browse the repository at this point in the history
  • Loading branch information
haecker-felix committed Jul 17, 2021
1 parent e1151e8 commit 9da79e2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ pub fn emoji_cmp(a: &str, b: &str) -> bool {

/// Remove bot name from message
pub fn remove_bot_name(message: &str, bot: &UserId) -> String {
let regex = format!("^@?{}(:{})?:?", bot.localpart(), bot.server_name());
let regex = format!("(?i)^@?{}(:{})?:?", bot.localpart(), bot.server_name());
let re = Regex::new(&regex).unwrap();
let message = re.replace(&message, "");
message.trim().to_string()
Expand Down

0 comments on commit 9da79e2

Please sign in to comment.