Skip to content

Commit 1759162

Browse files
committed
Special warning text for DM failing due to member not found
1 parent 7412c1e commit 1759162

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Helpers/WarningHelpers.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,10 @@ public static async Task<UserWarning> GiveWarningAsync(DiscordUser targetUser, D
197197
{
198198
// We failed to DM the user.
199199
// Lets log this if it isn't a known cause.
200+
if (e is DSharpPlus.Exceptions.NotFoundException)
201+
{
202+
Program.discord.Logger.LogWarning(e, "Failed to send warning DM to user because they are not in the server: {user}", targetUser.Id);
203+
}
200204
if (e is not DSharpPlus.Exceptions.UnauthorizedException)
201205
{
202206
Program.discord.Logger.LogWarning(e, "Failed to send warning DM to user: {user}", targetUser.Id);

0 commit comments

Comments
 (0)