mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
refactor(Interactions): move Structures import out of switch block (#5763)
This commit is contained in:
@@ -1,22 +1,18 @@
|
||||
'use strict';
|
||||
|
||||
const { Events, InteractionTypes } = require('../../../util/Constants');
|
||||
let Structures;
|
||||
const Structures = require('../../../util/Structures');
|
||||
|
||||
module.exports = (client, { d: data }) => {
|
||||
let interaction;
|
||||
switch (data.type) {
|
||||
case InteractionTypes.APPLICATION_COMMAND: {
|
||||
if (!Structures) Structures = require('../../../util/Structures');
|
||||
const CommandInteraction = Structures.get('CommandInteraction');
|
||||
|
||||
interaction = new CommandInteraction(client, data);
|
||||
break;
|
||||
}
|
||||
case InteractionTypes.MESSAGE_COMPONENT: {
|
||||
if (!Structures) Structures = require('../../../util/Structures');
|
||||
const MessageComponentInteraction = Structures.get('MessageComponentInteraction');
|
||||
|
||||
interaction = new MessageComponentInteraction(client, data);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user