Potato
Potato
DIAdiscord.js - Imagine an app
Created by Potato on 1/12/2024 in #djs-questions
Random "DiscordAPIError[10062]: Unknown Interaction"
ok thanks alot!
17 replies
DIAdiscord.js - Imagine an app
Created by Potato on 1/12/2024 in #djs-questions
Random "DiscordAPIError[10062]: Unknown Interaction"
is there any recommended free server for hosting discord bot?
17 replies
DIAdiscord.js - Imagine an app
Created by Potato on 1/12/2024 in #djs-questions
Random "DiscordAPIError[10062]: Unknown Interaction"
ok I will try put on host to try
17 replies
DIAdiscord.js - Imagine an app
Created by Potato on 1/12/2024 in #djs-questions
Random "DiscordAPIError[10062]: Unknown Interaction"
i just started learning discord.js, following discord.js guide
17 replies
DIAdiscord.js - Imagine an app
Created by Potato on 1/12/2024 in #djs-questions
Random "DiscordAPIError[10062]: Unknown Interaction"
i run on my own laptop
17 replies
DIAdiscord.js - Imagine an app
Created by Potato on 1/12/2024 in #djs-questions
Random "DiscordAPIError[10062]: Unknown Interaction"
yes, I run the .execute in this 'InteractionCreate.js' file
const { Events } = require('discord.js');

module.exports = {
name: Events.InteractionCreate,
async execute(interaction) {
if (!interaction.isChatInputCommand()) return;

const command = interaction.client.commands.get(interaction.commandName);
console.log(command.data.name);

if (!command) {
console.error(`No command matching ${interaction.commandName} was found.`);
return;
}

try {
console.log(`executing /${command.data.name}`);
await command.execute(interaction);
} catch (error) {
console.error(error);
if (interaction.replied || interaction.deferred) {
await interaction.followUp({ content: 'There was an error while executing this command!', ephemeral: true });
} else {
await interaction.reply({ content: 'There was an error while executing this command!', ephemeral: true });
}
}
},
};
const { Events } = require('discord.js');

module.exports = {
name: Events.InteractionCreate,
async execute(interaction) {
if (!interaction.isChatInputCommand()) return;

const command = interaction.client.commands.get(interaction.commandName);
console.log(command.data.name);

if (!command) {
console.error(`No command matching ${interaction.commandName} was found.`);
return;
}

try {
console.log(`executing /${command.data.name}`);
await command.execute(interaction);
} catch (error) {
console.error(error);
if (interaction.replied || interaction.deferred) {
await interaction.followUp({ content: 'There was an error while executing this command!', ephemeral: true });
} else {
await interaction.reply({ content: 'There was an error while executing this command!', ephemeral: true });
}
}
},
};
17 replies