Skip to content

Fixed Discord AuditLog Message Delete entry

Mateusz Brawański requested to merge github/fork/Kiritsu/patch-1 into master

Created by: Kiritsu

Make sure you familiarize yourself with our contributing guidelines.

Summary

This fixes the problem with MessageDelete audit log entry where the channel and target were always null

Details

The problem happened because xac.Options?.Id will always be 0 in that audit log type (see discord docs here: https://discordapp.com/developers/docs/resources/audit-log#audit-log-entry-object-optional-audit-entry-info), instead, we must use xac.Options?.ChannelId because it's a MessageDelete entry type

Changes proposed

When we're looking for the channel, just use the ChannelId property instead of Id property that's 0 for that kind of entry (MessageDelete)

Merge request reports

Loading