Skip to content
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

refactor: make GuildAuditLogsEntry.action return an AuditLogEvent #8256

Merged
merged 1 commit into from
Jul 9, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 2 additions & 55 deletions packages/discord.js/src/structures/GuildAuditLogsEntry.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,59 +80,6 @@ const Targets = {
* @typedef {string} AuditLogTargetType
*/

/**
* The action of an entry. Here are the available actions:
* * GuildUpdate
* * ChannelCreate
* * ChannelUpdate
* * ChannelDelete
* * ChannelOverwriteCreate
* * ChannelOverwriteUpdate
* * ChannelOverwriteDelete
* * MemberKick
* * MemberPrune
* * MemberBanAdd
* * MemberBanRemove
* * MemberUpdate
* * MemberRoleUpdate
* * MemberMove
* * MemberDisconnect
* * BotAdd
* * RoleCreate
* * RoleUpdate
* * RoleDelete
* * InviteCreate
* * InviteUpdate
* * InviteDelete
* * WebhookCreate
* * WebhookUpdate
* * WebhookDelete
* * EmojiCreate
* * EmojiUpdate
* * EmojiDelete
* * MessageDelete
* * MessageBulkDelete
* * MessagePin
* * MessageUnpin
* * IntegrationCreate
* * IntegrationUpdate
* * IntegrationDelete
* * StageInstanceCreate
* * StageInstanceUpdate
* * StageInstanceDelete
* * StickerCreate
* * StickerUpdate
* * StickerDelete
* * GuildScheduledEventCreate
* * GuildScheduledEventUpdate
* * GuildScheduledEventDelete
* * ThreadCreate
* * ThreadUpdate
* * ThreadDelete
* * ApplicationCommandPermissionUpdate
* @typedef {string} AuditLogAction
*/

/**
* Audit logs entry.
*/
Expand Down Expand Up @@ -160,9 +107,9 @@ class GuildAuditLogsEntry {

/**
* Specific action type of this entry in its string presentation
* @type {AuditLogAction}
* @type {AuditLogEvent}
*/
this.action = Object.keys(AuditLogEvent).find(k => AuditLogEvent[k] === data.action_type);
this.action = data.action_type;

/**
* The reason of this entry
Expand Down