Skip to content

Commit

Permalink
Special warning text for DM failing due to member not found
Browse files Browse the repository at this point in the history
  • Loading branch information
Erisa committed Oct 1, 2024
1 parent 7412c1e commit 1759162
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Helpers/WarningHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,10 @@ public static async Task<UserWarning> GiveWarningAsync(DiscordUser targetUser, D
{
// We failed to DM the user.
// Lets log this if it isn't a known cause.
if (e is DSharpPlus.Exceptions.NotFoundException)
{
Program.discord.Logger.LogWarning(e, "Failed to send warning DM to user because they are not in the server: {user}", targetUser.Id);
}
if (e is not DSharpPlus.Exceptions.UnauthorizedException)
{
Program.discord.Logger.LogWarning(e, "Failed to send warning DM to user: {user}", targetUser.Id);
Expand Down

0 comments on commit 1759162

Please sign in to comment.