Skip to content

Commit 847ec09

Browse files
committed
Add note to mute DMs mentioning modmail
Fixes #259
1 parent 8eaedec commit 847ec09

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

Helpers/MuteHelpers.cs

+13-6
Original file line numberDiff line numberDiff line change
@@ -169,26 +169,33 @@ public static (int MuteHours, int WarnsSinceThreshold) GetHoursToMuteFor(Diction
169169
{
170170
try
171171
{
172+
string dmContent = "";
173+
172174
if (permaMute)
173175
{
174-
output.dmMessage = await naughtyMember.SendMessageAsync($"{Program.cfgjson.Emoji.Muted} You have been muted in **{guild.Name}**!\nReason: **{reason}**");
176+
dmContent = $"{Program.cfgjson.Emoji.Muted} You have been muted in **{guild.Name}**!\nReason: **{reason}**";
175177
}
176-
177178
else
178179
{
179180
if (isTqsMute)
180181
{
181-
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." +
182+
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." +
182183
$"\nReason: **{reason}**" +
183-
$"\nMute expires: <t:{TimeHelpers.ToUnixTimestamp(expireTime)}:R>");
184+
$"\nMute expires: <t:{TimeHelpers.ToUnixTimestamp(expireTime)}:R>";
184185
}
185186
else
186187
{
187-
output.dmMessage = await naughtyMember.SendMessageAsync($"{Program.cfgjson.Emoji.Muted} You have been muted in **{guild.Name}** for **{TimeHelpers.TimeToPrettyFormat(muteDuration, false)}**!" +
188+
dmContent = $"{Program.cfgjson.Emoji.Muted} You have been muted in **{guild.Name}** for **{TimeHelpers.TimeToPrettyFormat(muteDuration, false)}**!" +
188189
$"\nReason: **{reason}**" +
189-
$"\nMute expires: <t:{TimeHelpers.ToUnixTimestamp(expireTime)}:R>");
190+
$"\nMute expires: <t:{TimeHelpers.ToUnixTimestamp(expireTime)}:R>";
190191
}
191192
}
193+
194+
if (reason.ToLower().Contains("modmail"))
195+
{
196+
dmContent += $"\n{Program.cfgjson.Emoji.Information} When contacting modmail, make sure to **enable DMs** from the server to allow your message to go through.";
197+
}
198+
output.dmMessage = await naughtyMember.SendMessageAsync(dmContent);
192199
}
193200
catch (Exception e)
194201
{

0 commit comments

Comments
 (0)