mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
refactor: make GuildAuditLogsEntry.action return an AuditLogEvent (#8256)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user