mirror of
https://github.com/revanced/revanced-discord-bot.git
synced 2025-05-01 15:04:25 +02:00
refactor(censor): deduplicate code and move it
This commit is contained in:
parent
0ae568aceb
commit
0187447d88
@ -10,9 +10,15 @@ 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 data_lock = get_data_lock(ctx).await;
|
||||
let additions = &data_lock.read().await.configuration.general.censor.additions;
|
||||
let removals = &data_lock.read().await.configuration.general.censor.removals;
|
||||
let censor = &data_lock.read().await.configuration.general.censor;
|
||||
let additions = &censor.additions;
|
||||
let removals = &censor.removals;
|
||||
|
||||
let mut censor = Standard;
|
||||
|
||||
@ -24,11 +30,6 @@ pub async fn cure(
|
||||
censor -= removal;
|
||||
}
|
||||
|
||||
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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user