refactor(Interactions): move Structures import out of switch block (#5763)

This commit is contained in:
Nordiago
2021-06-08 09:16:05 -04:00
committed by GitHub
parent e980948de5
commit 84e5b075b4

View File

@@ -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;
}