Skip to content

Commit

Permalink
refactor: make GuildAuditLogsEntry.action return an AuditLogEvent (
Browse files Browse the repository at this point in the history
  • Loading branch information
Eejit43 committed Jul 9, 2022
1 parent 7525615 commit f0b68d5
Showing 1 changed file with 2 additions and 55 deletions.
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

0 comments on commit f0b68d5

Please sign in to comment.