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