Abstract user penalization

This commit is contained in:
2025-08-15 00:41:15 -03:00
parent 7eb2a99b69
commit b9410bedd7
3 changed files with 66 additions and 57 deletions
+6 -8
View File
@@ -1,15 +1,13 @@
use std::sync::Arc;
use twilight_model::{
channel::{Message, message::Embed},
oauth::Application,
};
use twilight_model::{channel::message::Embed, oauth::Application};
use twilight_util::builder::embed::{
EmbedAuthorBuilder, EmbedBuilder, EmbedFieldBuilder, EmbedFooterBuilder, ImageSource,
};
use crate::{
constants::{COLOR_RED, COLOR_YELLOW},
database::models::Message,
discord::images,
groups::calls::moderation::Rule,
utils::ellipse,
@@ -35,7 +33,7 @@ pub fn first_warning_embed(
)
.title("Warning")
.description("You broke [Payphone's code of conduct](https://payphone.lat/code-of-conduct) during a call. Read the code of conduct to prevent getting banned.")
.field(EmbedFieldBuilder::new("What message broke the rules?", ellipse(message.content.clone(), 500)))
.field(EmbedFieldBuilder::new("What message broke the rules?", ellipse(message.data.content.clone(), 500)))
.field(EmbedFieldBuilder::new(
"What rules did you break?",
rules_broken
@@ -78,7 +76,7 @@ pub fn repeat_warning_embed(
)
.title("Long Time no See!")
.description("You broke [Payphone's code of conduct](https://payphone.lat/code-of-conduct) during a call. It's not your first offense, yet you've gone for a long time with a good record so we're making this a warning instead. In case you've forgotten the rules, consider this a reminder to re-read them.")
.field(EmbedFieldBuilder::new("What message broke the rules?", ellipse(message.content.clone(), 500)))
.field(EmbedFieldBuilder::new("What message broke the rules?", ellipse(message.data.content.clone(), 500)))
.field(EmbedFieldBuilder::new(
"What rules did you break?",
rules_broken
@@ -121,7 +119,7 @@ pub fn first_ban_embed(
)
.title("Banned")
.description("You broke [Payphone's code of conduct](https://payphone.lat/code-of-conduct) during a call. This is your first offense, and as such, you are being issued a ban. This ban will last for 24 hours, next one will be permanent.")
.field(EmbedFieldBuilder::new("What message broke the rules?", ellipse(message.content.clone(), 500)))
.field(EmbedFieldBuilder::new("What message broke the rules?", ellipse(message.data.content.clone(), 500)))
.field(EmbedFieldBuilder::new(
"What rules did you break?",
rules_broken
@@ -164,7 +162,7 @@ pub fn final_ban_embed(
)
.title("Permanently Banned")
.description("You broke [Payphone's code of conduct](https://payphone.lat/code-of-conduct) during a call. This is your final offense, and as such, you are being issued a permanent ban.")
.field(EmbedFieldBuilder::new("What message broke the rules?", ellipse(message.content.clone(), 500)))
.field(EmbedFieldBuilder::new("What message broke the rules?", ellipse(message.data.content.clone(), 500)))
.field(EmbedFieldBuilder::new(
"What rules did you break?",
rules_broken