-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(Client): guildAuditLogEntryCreate
event
#9058
feat(Client): guildAuditLogEntryCreate
event
#9058
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should update the list of intents too via the issue tracker.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't work because the gateway event is called GUILD_AUDIT_LOG_ENTRY_CREATE
but this is looking for AUDIT_LOG_ENTRY_CREATE
.
I seem to have found a bug with this event. Use this very basic code sample: import { Client, Events, GatewayIntentBits } from "discord.js";
const client = new Client({ intents: GatewayIntentBits.Guilds | GatewayIntentBits.GuildBans });
client.on("raw", console.log);
client.on(Events.AuditLogEntryCreate, console.log);
client.login(); Upon pinning a message, this event will be received: {
t: 'GUILD_AUDIT_LOG_ENTRY_CREATE',
s: 6,
op: 0,
d: {
user_id: 'user_id',
target_id: 'target_id',
options: {
message_id: 'message_id',
channel_id: 'channel_id'
},
id: 'id',
action_type: 74,
guild_id: 'guild_id'
}
} When discord.js constructs a You can see how these are defined here: discord.js/packages/discord.js/src/structures/GuildAuditLogsEntry.js Lines 127 to 131 in 13ce78a
discord.js/packages/discord.js/src/structures/GuildAuditLogsEntry.js Lines 292 to 297 in 13ce78a
When audit logs are fetched (as they have been all this time), Discord sends across the user objects that the audit log references and we store them safely away. However, the gateway does not do this. These are now potentially |
4207efd
to
5e41087
Compare
@almeidx is attempting to deploy a commit to the discordjs Team on Vercel. A member of the Team first needs to authorize it. |
auditLogEntryCreate
eventguildAuditLogEntryCreate
event
Please describe the changes this PR makes and why it should be merged:
Implements basic support for the
GUILD_AUDIT_LOG_ENTRY_CREATE
eventChanges:
Client#guildAuditLogEntryCreate
eventGuildAuditLogsEntry#targetId
andGuildAuditLogsEntry#executorId
to address feat(Client):guildAuditLogEntryCreate
event #9058 (comment)logs
to the last constructor parameter ofGuildAuditLogsEntry
(which is private) so as to not make it nullable (we don't received it via the gateway)Upstream:
Status and versioning classification: