Skip to content

Commit

Permalink
Add GreetMute tag to mod cases
Browse files Browse the repository at this point in the history
  • Loading branch information
FeroxFoxxo committed Nov 6, 2023
1 parent b81bda6 commit dc3731d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 3 additions & 2 deletions backend/Greeting/Commands/GreeterMute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public async Task MuteCommand(

var modCase = new ModCase
{
Title = $"GREETMUTE: {title}",
Title = title,
GuildId = Context.Guild.Id,
UserId = user.Id,
ModId = Identity.GetCurrentUser().Id,
Expand All @@ -65,7 +65,8 @@ public async Task MuteCommand(
PunishmentActive = true,
Severity = SeverityType.Low,
PunishedUntil = DateTime.UtcNow + greetGate.PunishmentTime,
CreationType = CaseCreationType.ByCommand
CreationType = CaseCreationType.ByCommand,
Labels = ["GreetMute"]
};

await RunModCase(modCase);
Expand Down
6 changes: 4 additions & 2 deletions backend/Punishments/Extensions/PunishmentEmbedCreator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,10 @@ public static async Task<EmbedBuilder> CreateModCaseEmbed(this ModCase modCase,
if (suspect != null)
embed.WithThumbnailUrl(suspect.GetAvatarOrDefaultUrl());

embed.AddField($"**{translator.Get<BotTranslator>().Description()}**", modCase.Description.Truncate(1000))
.WithTitle($"#{modCase.CaseId} {modCase.Title}")
if (modCase.Title != modCase.Description)
embed.AddField($"**{translator.Get<BotTranslator>().Description()}**", modCase.Description.Truncate(1000));

embed.WithTitle($"#{modCase.CaseId} {modCase.Title}")
.WithFooter(
$"{translator.Get<BotTranslator>().UserId()}: {modCase.Id} | {translator.Get<PunishmentTranslator>().CaseId()}: {modCase.CaseId}")
.AddField($"⚖️ - {translator.Get<PunishmentTranslator>().Punishment()}",
Expand Down

0 comments on commit dc3731d

Please sign in to comment.