UNPKG

sheweny

Version:

The powerful framework for create discord bots

31 lines 1.21 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const constants_js_1 = require("../constants/constants.js"); const index_js_1 = require("../helpers/index.js"); async function run(client, interaction) { try { if (!client.managers.commands) return; /* -----------------COMMAND----------------- */ const commands = client.collections.commands?.get(interaction.commandName); if (!commands || (commands && !commands.length)) return; for (const command of commands) { await (async () => { // eslint-disable-next-line // @ts-ignore if (!command || (command && ![constants_js_1.COMMAND_TYPE.cmdSlash, constants_js_1.COMMAND_TYPE.ctxUser, constants_js_1.COMMAND_TYPE.ctxMsg].includes(command.type))) { return; } if (command.onAutocomplete) await command.onAutocomplete(interaction); })(); } } catch (err) { const e = err; new index_js_1.ShewenyError(client, e); } } exports.default = run; //# sourceMappingURL=interactionAutocompleteCreate.js.map