Getting error in every interaction

I was opening my old bot that was working perfectly fine but every interaction gives me error without changing any thing in the code throw new DiscordAPIError(data, "code" in data ? data.code : data.error, status, method, url, requestData); ^ DiscordAPIError[10062]: Unknown interaction at handleErrors (C:\Files\BOTS\Yarko\node_modules@discordjs\rest\dist\index.js:722:13) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async BurstHandler.runRequest (C:\Files\BOTS\Yarko\node_modules@discordjs\rest\dist\index.js:826:23) at async _REST.request (C:\Files\BOTS\Yarko\node_modules@discordjs\rest\dist\index.js:1266:22) at async ChatInputCommandInteraction.reply (C:\Files\BOTS\Yarko\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:111:5) { requestBody: { files: [], json: { type: 4, data: { content: 'rjfg', tts: false, nonce: undefined, embeds: undefined, components: undefined, username: undefined, avatar_url: undefined, allowed_mentions: undefined, flags: undefined, message_reference: undefined, attachments: undefined, sticker_ids: undefined, thread_name: undefined } } }, rawError: { message: 'Unknown interaction', code: 10062 }, code: 10062, status: 404, method: 'POST', url: 'https://discord.com/api/v10/interactions/1202619080180371496/aW50ZXJhY3Rpb246MTIwMjYxOTA4MDE4MDM3MTQ5NjpEaE00cnlhZ0I2dW1KZWRDNHlkR3NzMGtGSmg0YVJPUGZ3aVlrUWZpYkRRWGp2VUlkOXBaWTVXdVV3Tk1mTVNGaURaSWZ0QXNyNWMyTVNmNkNmbTNzYWVkaEo2WUJsYjFqWG8ybXRjbTZIYmFkNzBjYWJVUmhjM2VYa1VuOTA4Sg/callback' } discord.js v14.14.1 Node.js v20.11.0 I tried to defer or await but it didn't work
5 Replies
d.js toolkit
d.js toolkit11mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by staff
Yahia
YahiaOP11mo ago
const { SlashCommandBuilder, ChatInputCommandInteraction, Client, PermissionsBitField } = require('discord.js');

module.exports = {
data: new SlashCommandBuilder()
.setName('say')
.setDescription('Say anything you want')
.addStringOption(option =>
option
.setName('input')
.setDescription('The text or link you want me to say')
.setRequired(true)),


/**
*
* @param {ChatInputCommandInteraction} interaction
* @param {Client} client
*/
async execute(interaction, client) {
if(!interaction.member.permissions.has(PermissionsBitField.Flags.Administrator)){
interaction.reply({content :"**You must be an `ADMINISTRATOR`** :x:", ephemeral: true})
}else{
const s = interaction.options.getString('input');
interaction.reply(`${s}`)
}

},
};
const { SlashCommandBuilder, ChatInputCommandInteraction, Client, PermissionsBitField } = require('discord.js');

module.exports = {
data: new SlashCommandBuilder()
.setName('say')
.setDescription('Say anything you want')
.addStringOption(option =>
option
.setName('input')
.setDescription('The text or link you want me to say')
.setRequired(true)),


/**
*
* @param {ChatInputCommandInteraction} interaction
* @param {Client} client
*/
async execute(interaction, client) {
if(!interaction.member.permissions.has(PermissionsBitField.Flags.Administrator)){
interaction.reply({content :"**You must be an `ADMINISTRATOR`** :x:", ephemeral: true})
}else{
const s = interaction.options.getString('input');
interaction.reply(`${s}`)
}

},
};
d.js docs
d.js docs11mo ago
Common causes of DiscordAPIError[10062]: Unknown interaction: - Initial response took more than 3 seconds ➞ defer the response *. - Wrong interaction object inside a collector. - Two processes handling the same command (the first consumes the interaction, so it won't be valid for the other instance) * Note: you cannot defer modal or autocomplete value responses
Yahia
YahiaOP11mo ago
i tried this earlier and nothing worked Fuck LGBTQIA @arcticwolvinny ❄ 🌈 fuck you bitch
treble/luna
treble/luna11mo ago
good luck with getting support
Want results from more Discord servers?
Add your server