black
black
DIAdiscord.js - Imagine a boo! 👻
Created by black on 4/2/2024 in #djs-questions
Unknown interaction, sometimes
@Qjuh Update, i just pass the bot project to Docker, and slash commands has work normally now, and in my normal machine, same host, the problem probably came from my system
20 replies
DIAdiscord.js - Imagine a boo! 👻
Created by black on 4/2/2024 in #djs-questions
Unknown interaction, sometimes
Then I'll try to upload it to a VPS or another machine and leave feedback here
20 replies
DIAdiscord.js - Imagine a boo! 👻
Created by black on 4/2/2024 in #djs-questions
Unknown interaction, sometimes
using Htop in linux, my cpu it is normal, network issues i can't monitoring
20 replies
DIAdiscord.js - Imagine a boo! 👻
Created by black on 4/2/2024 in #djs-questions
Unknown interaction, sometimes
It's very random, sometimes I turn on the bot, try to use some command and Unknow Interaction, sometimes I turn on the bot and manage to use it a few times and then it fails
20 replies
DIAdiscord.js - Imagine a boo! 👻
Created by black on 4/2/2024 in #djs-questions
Unknown interaction, sometimes
If I can't use await in the constructor, then there's not much I can do about it
20 replies
DIAdiscord.js - Imagine a boo! 👻
Created by black on 4/2/2024 in #djs-questions
Unknown interaction, sometimes
i use readdirSync in loadEvents and loadSlashCommands
20 replies
DIAdiscord.js - Imagine a boo! 👻
Created by black on 4/2/2024 in #djs-questions
Unknown interaction, sometimes
in constructor of MyClient?
this.loadEvents()
this.loadEvents()
20 replies
DIAdiscord.js - Imagine a boo! 👻
Created by black on 4/2/2024 in #djs-questions
Unknown interaction, sometimes
yes, in MyClient
20 replies
DIAdiscord.js - Imagine a boo! 👻
Created by black on 4/2/2024 in #djs-questions
Unknown interaction, sometimes
async loadEvents(src="./src/events") {
const eventsFolders = readdirSync(src, { withFileTypes: true }).reduce((previousValue, nextValue) => {
return nextValue.isDirectory() ? [...previousValue, nextValue.name] : previousValue;
}, []);
for(const eventFolder of eventsFolders) {
const eventsFiles = readdirSync(`${src}/${eventFolder}`).filter(eventFile => eventFile.endsWith(".js"));
for(const eventFile of eventsFiles) {
const eventPath = join(process.cwd(), src, eventFolder, eventFile);
const { default: EventMap } = await import(eventPath);
const event = new EventMap(this);
if(event.once) {
this.once(event.name, event.execute);
};
if(!event.once) {
this.on(event.name, event.execute);
}
}
}
};
async loadEvents(src="./src/events") {
const eventsFolders = readdirSync(src, { withFileTypes: true }).reduce((previousValue, nextValue) => {
return nextValue.isDirectory() ? [...previousValue, nextValue.name] : previousValue;
}, []);
for(const eventFolder of eventsFolders) {
const eventsFiles = readdirSync(`${src}/${eventFolder}`).filter(eventFile => eventFile.endsWith(".js"));
for(const eventFile of eventsFiles) {
const eventPath = join(process.cwd(), src, eventFolder, eventFile);
const { default: EventMap } = await import(eventPath);
const event = new EventMap(this);
if(event.once) {
this.once(event.name, event.execute);
};
if(!event.once) {
this.on(event.name, event.execute);
}
}
}
};
20 replies
DIAdiscord.js - Imagine a boo! 👻
Created by black on 4/2/2024 in #djs-questions
Unknown interaction, sometimes
oh, just name is wrong, its extends simple EventMap class
export default class EventMap {
constructor(client, options) {
this.client = client,
this.name = options.name,
this.once = options.once || false
};
};
export default class EventMap {
constructor(client, options) {
this.client = client,
this.name = options.name,
this.once = options.once || false
};
};
not is the problem
20 replies
DIAdiscord.js - Imagine a boo! 👻
Created by black on 4/2/2024 in #djs-questions
Unknown interaction, sometimes
sometimes
20 replies
DIAdiscord.js - Imagine a boo! 👻
Created by black on 4/2/2024 in #djs-questions
Unknown interaction, sometimes
yes
20 replies
DIAdiscord.js - Imagine a boo! 👻
Created by black on 4/2/2024 in #djs-questions
Unknown interaction, sometimes
I'm still thinking it strange that the problem is my connection
20 replies
DIAdiscord.js - Imagine a boo! 👻
Created by black on 4/2/2024 in #djs-questions
Unknown interaction, sometimes
node:events:492
throw er; // Unhandled 'error' event
^

DiscordAPIError[10062]: Unknown interaction
at handleErrors (/home/junior-light/Desktop/discord-js-test-0/node_modules/.pnpm/@[email protected]/node_modules/@discordjs/rest/dist/index.js:722:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async BurstHandler.runRequest (/home/junior-light/Desktop/discord-js-test-0/node_modules/.pnpm/@[email protected]/node_modules/@discordjs/rest/dist/index.js:826:23)
at async _REST.request (/home/junior-light/Desktop/discord-js-test-0/node_modules/.pnpm/@[email protected]/node_modules/@discordjs/rest/dist/index.js:1266:22)
at async ChatInputCommandInteraction.deferReply (/home/junior-light/Desktop/discord-js-test-0/node_modules/.pnpm/[email protected]/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:69:5)
at async MyClient.execute (file:///home/junior-light/Desktop/discord-js-test-0/src/events/Interaction/InteractionCreate.js:20:9)
Emitted 'error' event on MyClient instance at:
at emitUnhandledRejectionOrErr (node:events:397:10)
at process.processTicksAndRejections (node:internal/process/task_queues:84:21) {
requestBody: { files: undefined, json: { type: 5, data: { flags: undefined } } },
rawError: { message: 'Unknown interaction', code: 10062 },
code: 10062,
status: 404,
method: 'POST',
url: 'https://discord.com/api/v10/interactions/1224707594568994958/aW50ZXJhY3Rpb246MTIyNDcwNzU5NDU2ODk5NDk1ODp4U0t4YkxBS3VxZUxlT2xONklCN1NtUmxCOEE1M1ZmMGZqejZXOE42bjdMcXpXU1gzcWw3eURYMzg1RFR0QWNGZFVsbHdJTkxDTVQ4U1R4S2NQMnpOVTVkQ0t2ZlhLZnpvQVZZdFE5b1hUR0g2N0pBS3hyUHZTZHhmdElMZXJ5Tg/callback'
}
node:events:492
throw er; // Unhandled 'error' event
^

DiscordAPIError[10062]: Unknown interaction
at handleErrors (/home/junior-light/Desktop/discord-js-test-0/node_modules/.pnpm/@[email protected]/node_modules/@discordjs/rest/dist/index.js:722:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async BurstHandler.runRequest (/home/junior-light/Desktop/discord-js-test-0/node_modules/.pnpm/@[email protected]/node_modules/@discordjs/rest/dist/index.js:826:23)
at async _REST.request (/home/junior-light/Desktop/discord-js-test-0/node_modules/.pnpm/@[email protected]/node_modules/@discordjs/rest/dist/index.js:1266:22)
at async ChatInputCommandInteraction.deferReply (/home/junior-light/Desktop/discord-js-test-0/node_modules/.pnpm/[email protected]/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:69:5)
at async MyClient.execute (file:///home/junior-light/Desktop/discord-js-test-0/src/events/Interaction/InteractionCreate.js:20:9)
Emitted 'error' event on MyClient instance at:
at emitUnhandledRejectionOrErr (node:events:397:10)
at process.processTicksAndRejections (node:internal/process/task_queues:84:21) {
requestBody: { files: undefined, json: { type: 5, data: { flags: undefined } } },
rawError: { message: 'Unknown interaction', code: 10062 },
code: 10062,
status: 404,
method: 'POST',
url: 'https://discord.com/api/v10/interactions/1224707594568994958/aW50ZXJhY3Rpb246MTIyNDcwNzU5NDU2ODk5NDk1ODp4U0t4YkxBS3VxZUxlT2xONklCN1NtUmxCOEE1M1ZmMGZqejZXOE42bjdMcXpXU1gzcWw3eURYMzg1RFR0QWNGZFVsbHdJTkxDTVQ4U1R4S2NQMnpOVTVkQ0t2ZlhLZnpvQVZZdFE5b1hUR0g2N0pBS3hyUHZTZHhmdElMZXJ5Tg/callback'
}
20 replies
DIAdiscord.js - Imagine a boo! 👻
Created by black on 4/2/2024 in #djs-questions
Unknown interaction, sometimes
{
requestBody: { files: undefined, json: { type: 5, data: { flags: undefined } } },
rawError: { message: 'Unknown interaction', code: 10062 },
code: 10062,
status: 404,
method: 'POST',
....
{
requestBody: { files: undefined, json: { type: 5, data: { flags: undefined } } },
rawError: { message: 'Unknown interaction', code: 10062 },
code: 10062,
status: 404,
method: 'POST',
....
defer is not the problem, I tried without it too, just with await interaction.reply in the ping command file and I get the same result, sometimes it works and sometimes it gives the error
20 replies
DIAdiscord.js - Imagine a boo! 👻
Created by black on 4/2/2024 in #djs-questions
Unknown interaction, sometimes
in theory even if my connection was very bad, with defer it wouldn't be a problem
20 replies
DIAdiscord.js - Imagine a boo! 👻
Created by black on 4/2/2024 in #djs-questions
Unknown interaction, sometimes
Isn't it an error related to interactionCreate or something like that?
20 replies
DIAdiscord.js - Imagine a boo! 👻
Created by black on 4/1/2024 in #djs-questions
How this method works?
thanks ❤️
7 replies
DIAdiscord.js - Imagine a boo! 👻
Created by black on 4/1/2024 in #djs-questions
How this method works?
where can i find these codes "under the hood"? and in specific ...commands.set()
7 replies