mirror of
https://github.com/revanced/revanced-discord-bot.git
synced 2025-05-02 15:34:24 +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>,
|
old_if_available: &Option<serenity::Member>,
|
||||||
member: &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();
|
let name = member.display_name().to_string();
|
||||||
|
|
||||||
if let Some(old) = old_if_available {
|
if let Some(old) = old_if_available {
|
||||||
@ -22,9 +27,10 @@ pub async fn cure(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut cured_name = DECANCER
|
let mut cured_name = DECANCER.cure(&name).replace(
|
||||||
.cure(&name)
|
|c: char| !(c == ' ' || c == '-' || c == '_' || c.is_ascii_alphanumeric()),
|
||||||
.replace(|c: char| !(c == ' ' || c == '-' || c == '_' || c.is_ascii_alphanumeric()), "");
|
"",
|
||||||
|
);
|
||||||
|
|
||||||
if cured_name.is_empty() {
|
if cured_name.is_empty() {
|
||||||
cured_name = "ReVanced user".to_string();
|
cured_name = "ReVanced user".to_string();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user