Skip to content

Commit

Permalink
Add note to mute DMs mentioning modmail
Browse files Browse the repository at this point in the history
Fixes #259
  • Loading branch information
Erisa committed Jan 22, 2025
1 parent 8eaedec commit 847ec09
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions Helpers/MuteHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -169,26 +169,33 @@ public static (int MuteHours, int WarnsSinceThreshold) GetHoursToMuteFor(Diction
{
try
{
string dmContent = "";

if (permaMute)
{
output.dmMessage = await naughtyMember.SendMessageAsync($"{Program.cfgjson.Emoji.Muted} You have been muted in **{guild.Name}**!\nReason: **{reason}**");
dmContent = $"{Program.cfgjson.Emoji.Muted} You have been muted in **{guild.Name}**!\nReason: **{reason}**";
}

else
{
if (isTqsMute)
{
output.dmMessage = await naughtyMember.SendMessageAsync($"{Program.cfgjson.Emoji.Muted} You have been temporarily muted, in **tech support channels only**, in **{guild.Name}** for **{TimeHelpers.TimeToPrettyFormat(muteDuration, false)}** pending action from a Moderator." +
dmContent = $"{Program.cfgjson.Emoji.Muted} You have been temporarily muted, in **tech support channels only**, in **{guild.Name}** for **{TimeHelpers.TimeToPrettyFormat(muteDuration, false)}** pending action from a Moderator." +
$"\nReason: **{reason}**" +
$"\nMute expires: <t:{TimeHelpers.ToUnixTimestamp(expireTime)}:R>");
$"\nMute expires: <t:{TimeHelpers.ToUnixTimestamp(expireTime)}:R>";
}
else
{
output.dmMessage = await naughtyMember.SendMessageAsync($"{Program.cfgjson.Emoji.Muted} You have been muted in **{guild.Name}** for **{TimeHelpers.TimeToPrettyFormat(muteDuration, false)}**!" +
dmContent = $"{Program.cfgjson.Emoji.Muted} You have been muted in **{guild.Name}** for **{TimeHelpers.TimeToPrettyFormat(muteDuration, false)}**!" +
$"\nReason: **{reason}**" +
$"\nMute expires: <t:{TimeHelpers.ToUnixTimestamp(expireTime)}:R>");
$"\nMute expires: <t:{TimeHelpers.ToUnixTimestamp(expireTime)}:R>";
}
}

if (reason.ToLower().Contains("modmail"))
{
dmContent += $"\n{Program.cfgjson.Emoji.Information} When contacting modmail, make sure to **enable DMs** from the server to allow your message to go through.";
}
output.dmMessage = await naughtyMember.SendMessageAsync(dmContent);
}
catch (Exception e)
{
Expand Down

0 comments on commit 847ec09

Please sign in to comment.