Fix playerButtons + generatePlayer
This commit is contained in:
@@ -7,8 +7,17 @@ const playerButtons = require(appDir + '/utilsPlayer/buttons.js')
|
||||
module.exports = {
|
||||
name: Events.InteractionCreate,
|
||||
async execute(interaction) {
|
||||
if (!interaction.isAutocomplete() && !interaction.isChatInputCommand() && !interaction.isButton()) return console.error(`Interaction ${interaction.commandName} is not a command.`)
|
||||
//if (!interaction.isAutocomplete() && !interaction.isChatInputCommand() && !interaction.isButton()) return console.error(`Interaction ${interaction.commandName} is not a command.`)
|
||||
|
||||
if (interaction.isChatInputCommand()) {
|
||||
let command = interaction.client.commands.get(interaction.commandName)
|
||||
if (!command) return console.error(`No command matching ${interaction.commandName} was found.`)
|
||||
|
||||
console.log(`\u001b[1;33m Command '${interaction.commandName}' launched by ${interaction.user.tag}`)
|
||||
|
||||
try { await command.execute(interaction) }
|
||||
catch (error) { console.error(`Error executing ${interaction.commandName}:`, error) }
|
||||
}
|
||||
else if (interaction.isAutocomplete()) {
|
||||
let autoCompleteRun = interaction.client.commands.get(interaction.commandName)
|
||||
if (!autoCompleteRun) return console.error(`No autoCompleteRun matching ${interaction.commandName} was found.`)
|
||||
@@ -18,17 +27,6 @@ module.exports = {
|
||||
try { await autoCompleteRun.autocompleteRun(interaction) }
|
||||
catch (error) { console.error(`Error autocompleting ${interaction.commandName}:`, error) }
|
||||
}
|
||||
|
||||
else if (interaction.isChatInputCommand()) {
|
||||
let command = interaction.client.commands.get(interaction.commandName)
|
||||
if (!command) return console.error(`No command matching ${interaction.commandName} was found.`)
|
||||
|
||||
console.log(`\u001b[1;33m Command '${interaction.commandName}' launched by ${interaction.user.tag}`)
|
||||
|
||||
try { await command.execute(interaction) }
|
||||
catch (error) { console.error(`Error executing ${interaction.commandName}:`, error) }
|
||||
}
|
||||
|
||||
else if (interaction.isButton()) {
|
||||
let button = interaction.client.buttons.get(interaction.customId)
|
||||
if (!button) return console.error(`No button id matching ${interaction.customId} was found.`)
|
||||
|
||||
Reference in New Issue
Block a user