mirror of
https://github.com/revanced/revanced-discord-bot.git
synced 2025-05-01 15:04:25 +02:00
feat: do not cure bots
This commit is contained in:
parent
5ab333ba5c
commit
97c064ce7f
@ -10,6 +10,11 @@ pub async fn cure(
|
||||
old_if_available: &Option<serenity::Member>,
|
||||
member: &serenity::Member,
|
||||
) {
|
||||
if member.user.bot {
|
||||
trace!("Skipping decancer for bot {}.", member.user.tag());
|
||||
return;
|
||||
}
|
||||
|
||||
let name = member.display_name().to_string();
|
||||
|
||||
if let Some(old) = old_if_available {
|
||||
@ -22,9 +27,10 @@ pub async fn cure(
|
||||
}
|
||||
}
|
||||
|
||||
let mut cured_name = DECANCER
|
||||
.cure(&name)
|
||||
.replace(|c: char| !(c == ' ' || c == '-' || c == '_' || c.is_ascii_alphanumeric()), "");
|
||||
let mut cured_name = DECANCER.cure(&name).replace(
|
||||
|c: char| !(c == ' ' || c == '-' || c == '_' || c.is_ascii_alphanumeric()),
|
||||
"",
|
||||
);
|
||||
|
||||
if cured_name.is_empty() {
|
||||
cured_name = "ReVanced user".to_string();
|
||||
|
Loading…
x
Reference in New Issue
Block a user