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 toolkit5mo 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
Yahia5mo 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 docs5mo 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
Yahia5mo ago
i tried this earlier and nothing worked Fuck LGBTQIA @arcticwolvinny ❄ 🌈 fuck you bitch
treble/luna
treble/luna5mo ago
good luck with getting support
Want results from more Discord servers?
Add your server
More Posts
Queue to prevent rate limit, but sometimes unreliable. Are there any alternatives or improvements?Hello, I have written a bot that should make it possible to react to a message with embed for a certIs possible to trigger an ephemeral message without setting "ephemeral: true"?I'm having some strange behaviours from my bot recently and i'm not having idea what is happening. RHow would I go about getting the currently applied tags in a Forums channel?I tries this and kept getting `Failed to change thread tags: TypeError: Cannot read properties of unWhat's the preferred way of accessing collections in a command file?Currently I have something like this ```ts try { if (interaction.commandName === 'user') { How would I go about trying to create a discord.js bot to fetch the thread id's in a channel.How would I go about trying to create a discord.js bot to fetch the thread id's in a channel and outQuestion about makeCache and sweepersHi! I'm running a ticket bot which has transcripts, what would be the best settings for message cachInvalid number valueCode: Error: Error retrieving guild stats: Invalid number valueAutocompletion in Slash commandsAuto ocmpletion code: ```js const D = require("discord.js") const fs = require("node:fs/promises") mLow Rate Limit ceiling?I’ve started work on a basic Discord.js bot, and I’ve hit rate limits twice during the development wUnable to delete message from DM``` Error [ChannelNotCached]: Could not find the channel where this message came from in the cache!