refactor: make GuildAuditLogsEntry.action return an AuditLogEvent (#8256)

This commit is contained in:
Eejit
2022-07-09 13:55:24 -04:00
committed by GitHub
parent 75256153a9
commit f0b68d5736

View File

@@ -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.
*/
@@ -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