Skip to content

Commit

Permalink
chore: make requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
suneettipirneni committed Jan 9, 2022
1 parent 36b5c6c commit 22026c8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 115 deletions.
16 changes: 8 additions & 8 deletions packages/discord.js/src/client/actions/InteractionCreate.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ class InteractionCreateAction extends Action {
// Resolve and cache partial channels for Interaction#channel getter
this.getChannel(data);

let _InteractionType;
let InteractionClass;
switch (data.type) {
case InteractionType.ApplicationCommand:
switch (data.data.type) {
case ApplicationCommandType.ChatInput:
_InteractionType = ChatInputCommandInteraction;
InteractionClass = ChatInputCommandInteraction;
break;
case ApplicationCommandType.User:
_InteractionType = UserContextMenuCommandInteraction;
InteractionClass = UserContextMenuCommandInteraction;
break;
case ApplicationCommandType.Message:
_InteractionType = MessageContextMenuCommandInteraction;
InteractionClass = MessageContextMenuCommandInteraction;
break;
default:
client.emit(
Expand All @@ -41,10 +41,10 @@ class InteractionCreateAction extends Action {
case InteractionType.MessageComponent:
switch (data.data.component_type) {
case ComponentType.Button:
_InteractionType = ButtonInteraction;
InteractionClass = ButtonInteraction;
break;
case ComponentType.SelectMenu:
_InteractionType = SelectMenuInteraction;
InteractionClass = SelectMenuInteraction;
break;
default:
client.emit(
Expand All @@ -55,14 +55,14 @@ class InteractionCreateAction extends Action {
}
break;
case InteractionType.ApplicationCommandAutocomplete:
_InteractionType = AutocompleteInteraction;
InteractionClass = AutocompleteInteraction;
break;
default:
client.emit(Events.DEBUG, `[INTERACTION] Received interaction with unknown type: ${data.type}`);
return;
}

const interaction = new _InteractionType(client, data);
const interaction = new InteractionClass(client, data);

/**
* Emitted when an interaction is created.
Expand Down
107 changes: 0 additions & 107 deletions packages/discord.js/src/structures/GuildAuditLogs.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,113 +53,6 @@ const Targets = {
UNKNOWN: 'UNKNOWN',
};

/**
* The action of an entry. Here are the available actions:
* * ALL: null
* * GUILD_UPDATE: 1
* * CHANNEL_CREATE: 10
* * CHANNEL_UPDATE: 11
* * CHANNEL_DELETE: 12
* * CHANNEL_OVERWRITE_CREATE: 13
* * CHANNEL_OVERWRITE_UPDATE: 14
* * CHANNEL_OVERWRITE_DELETE: 15
* * MEMBER_KICK: 20
* * MEMBER_PRUNE: 21
* * MEMBER_BAN_ADD: 22
* * MEMBER_BAN_REMOVE: 23
* * MEMBER_UPDATE: 24
* * MEMBER_ROLE_UPDATE: 25
* * MEMBER_MOVE: 26
* * MEMBER_DISCONNECT: 27
* * BOT_ADD: 28,
* * ROLE_CREATE: 30
* * ROLE_UPDATE: 31
* * ROLE_DELETE: 32
* * INVITE_CREATE: 40
* * INVITE_UPDATE: 41
* * INVITE_DELETE: 42
* * WEBHOOK_CREATE: 50
* * WEBHOOK_UPDATE: 51
* * WEBHOOK_DELETE: 52
* * EMOJI_CREATE: 60
* * EMOJI_UPDATE: 61
* * EMOJI_DELETE: 62
* * MESSAGE_DELETE: 72
* * MESSAGE_BULK_DELETE: 73
* * MESSAGE_PIN: 74
* * MESSAGE_UNPIN: 75
* * INTEGRATION_CREATE: 80
* * INTEGRATION_UPDATE: 81
* * INTEGRATION_DELETE: 82
* * STAGE_INSTANCE_CREATE: 83
* * STAGE_INSTANCE_UPDATE: 84
* * STAGE_INSTANCE_DELETE: 85
* * STICKER_CREATE: 90
* * STICKER_UPDATE: 91
* * STICKER_DELETE: 92
* * GUILD_SCHEDULED_EVENT_CREATE: 100
* * GUILD_SCHEDULED_EVENT_UPDATE: 101
* * GUILD_SCHEDULED_EVENT_DELETE: 102
* * THREAD_CREATE: 110
* * THREAD_UPDATE: 111
* * THREAD_DELETE: 112
* @typedef {?(number|string)} AuditLogAction
* @see {@link https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-audit-log-events}
*/

/**
* All available actions keyed under their names to their numeric values.
* @name GuildAuditLogs.Actions
* @type {Object<string, number>}
*/
// const Actions = {
// ALL: null,
// GUILD_UPDATE: 1,
// CHANNEL_CREATE: 10,
// CHANNEL_UPDATE: 11,
// CHANNEL_DELETE: 12,
// CHANNEL_OVERWRITE_CREATE: 13,
// CHANNEL_OVERWRITE_UPDATE: 14,
// CHANNEL_OVERWRITE_DELETE: 15,
// MEMBER_KICK: 20,
// MEMBER_PRUNE: 21,
// MEMBER_BAN_ADD: 22,
// MEMBER_BAN_REMOVE: 23,
// MEMBER_UPDATE: 24,
// MEMBER_ROLE_UPDATE: 25,
// MEMBER_MOVE: 26,
// MEMBER_DISCONNECT: 27,
// BOT_ADD: 28,
// ROLE_CREATE: 30,
// ROLE_UPDATE: 31,
// ROLE_DELETE: 32,
// INVITE_CREATE: 40,
// INVITE_UPDATE: 41,
// INVITE_DELETE: 42,
// WEBHOOK_CREATE: 50,
// WEBHOOK_UPDATE: 51,
// WEBHOOK_DELETE: 52,
// EMOJI_CREATE: 60,
// EMOJI_UPDATE: 61,
// EMOJI_DELETE: 62,
// MESSAGE_DELETE: 72,
// MESSAGE_BULK_DELETE: 73,
// MESSAGE_PIN: 74,
// MESSAGE_UNPIN: 75,
// INTEGRATION_CREATE: 80,
// INTEGRATION_UPDATE: 81,
// INTEGRATION_DELETE: 82,
// STAGE_INSTANCE_CREATE: 83,
// STAGE_INSTANCE_UPDATE: 84,
// STAGE_INSTANCE_DELETE: 85,
// STICKER_CREATE: 90,
// STICKER_UPDATE: 91,
// STICKER_DELETE: 92,
// THREAD_CREATE: 110,
// THREAD_UPDATE: 111,
// THREAD_DELETE: 112,
// };

/**
* Audit logs entries are held in this class.
*/
Expand Down

0 comments on commit 22026c8

Please sign in to comment.