Open Starman3787 opened 7 months ago
Was not able to reproduce this locally, am seeing the audit log reason header respected and creating a corresponding audit log entry with the reason.
I think there's something afoot here, re-opening for investigation.
Yeah sorry the way we were reproducing this in a test environment did not exhibit the issue.
Another really similar issue that is probably related so will post this here
When a bot deletes a message no audit log is getting created whatsoever
X-Audit-Log-Reason
headerEDIT: Ok, that makes sense, I must have missed that
That's by design because otherwise bots can create an excessive amount of entries.
Description
The documentation states that the
POST /channels/{channel.id}/messages/bulk-delete
endpoint supports theX-Audit-Log-Reason
https://discord.com/developers/docs/resources/channel#bulk-delete-messages
However, it is clear that when I try this, no reason is actually being attached to the audit log.
This issue was created over a year ago here, however it was closed despite the issue still occurring and reproducible by another user.
I have taken care to ensure trying it from another channel where no bulk deletes have occurred.
Additionally, I have tested it after the cutoff time in which audit logs are merged.
Still, the bug remains.
Steps to Reproduce
POST /channels/{channel.id}/messages/bulk-delete
with a valid array of message ids in themessages
field, and any valid reason given using theX-Audit-Log-Reason
headerhttps://discord.com/developers/docs/resources/audit-log#get-guild-audit-log
GET /guilds/{guild.id}/audit-logs
withaction_type
set to 73 (MESSAGE_BULK_DELETE
) andlimit
set to 1 (although I doubt this matters, I'm just showing what exactly I tried) and none of the other fields were sethttps://discord.com/developers/docs/resources/audit-log#get-guild-audit-log
Expected Behavior
The
GET
request should return an audit log with areason
field which contains the reason given in the first request with theX-Audit-Log-Reason
headerCurrent Behavior
The
GET
request does not return areason
field, and no reason is shown in the audit logs in the Discord client eitherScreenshots/Videos
Client and System Information
Custom library used when making requests:
https://github.com/quark-bot-discord/gluon
Discord client used to observe whether the reason shows up in the audit logs:
canary 267385 (2f212e6) Host 0.0.420 arm64 macOS 14 (23.1.0)