LucasB25
DIAdiscord.js - Imagine an app
•Created by LucasB25 on 10/17/2024 in #djs-questions
Session WS
41 replies
DIAdiscord.js - Imagine an app
•Created by LucasB25 on 2/27/2024 in #djs-questions
DiscordAPIError[10062]: Unknown interaction
await interaction.deferReply();
const embed = new EmbedBuilder()
.setDescription(`\`🏓\` | **Pong:** \`${Math.round(client.ws.ping)}ms\``)
.setColor(client.color.get(interaction.guild.id));
return interaction.editReply({ embeds: [embed], ephemeral: true });
await interaction.deferReply();
const embed = new EmbedBuilder()
.setDescription(`\`🏓\` | **Pong:** \`${Math.round(client.ws.ping)}ms\``)
.setColor(client.color.get(interaction.guild.id));
return interaction.editReply({ embeds: [embed], ephemeral: true });
[AntiCrash] | [UnhandledRejection_Logs] | [start] : ===============
Unhandled Rejection at: Promise {
<rejected> DiscordAPIError[10062]: Unknown interaction
at handleErrors (/home/pi/PanaisTest/node_modules/@discordjs/rest/dist/index.js:722:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async BurstHandler.runRequest (/home/pi/PanaisTest/node_modules/@discordjs/rest/dist/index.js:826:23)
at async _REST.request (/home/pi/PanaisTest/node_modules/@discordjs/rest/dist/index.js:1266:22)
at async ChatInputCommandInteraction.deferReply (/home/pi/PanaisTest/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:69:5)
at async Object.run (/home/pi/PanaisTest/src/commands/Slash/Information/Ping.js:28:16) {
requestBody: { files: undefined, json: [Object] },
rawError: { message: 'Unknown interaction', code: 10062 },
code: 10062,
status: 404,
method: 'POST',
url: 'https://discord.com/api/v10/interactions/1212140133776891904/aW50ZXJhY3Rpb246MTIxMjE0MDEzMzc3Njg5MTkwNDpMNkRoUEJjUTFqdGdKR1NUckFNMlFnQjJCOUR2ODRqNXhMbmJhRkk0NDlsWE55dlViZHNYN25KemN0UkowblRpcVZSeUhZY0dnOG9mZTBOMUVrRGFrVWprZ2c3dHBkOGttRWFUUUFpOTRNaHBVUUFYQ0lFMUI2MGtuYnYxYWI0cA/callback'
}
} reason: DiscordAPIError[10062]: Unknown interaction
at handleErrors (/home/pi/PanaisTest/node_modules/@discordjs/rest/dist/index.js:722:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async BurstHandler.runRequest (/home/pi/PanaisTest/node_modules/@discordjs/rest/dist/index.js:826:23)
at async _REST.request (/home/pi/PanaisTest/node_modules/@discordjs/rest/dist/index.js:1266:22)
at async ChatInputCommandInteraction.deferReply (/home/pi/PanaisTest/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:69:5)
at async Object.run (/home/pi/PanaisTest/src/commands/Slash/Information/Ping.js:28:16) {
requestBody: { files: undefined, json: { type: 5, data: [Object] } },
rawError: { message: 'Unknown interaction', code: 10062 },
code: 10062,
status: 404,
method: 'POST',
url: 'https://discord.com/api/v10/interactions/1212140133776891904/aW50ZXJhY3Rpb246MTIxMjE0MDEzMzc3Njg5MTkwNDpMNkRoUEJjUTFqdGdKR1NUckFNMlFnQjJCOUR2ODRqNXhMbmJhRkk0NDlsWE55dlViZHNYN25KemN0UkowblRpcVZSeUhZY0dnOG9mZTBOMUVrRGFrVWprZ2c3dHBkOGttRWFUUUFpOTRNaHBVUUFYQ0lFMUI2MGtuYnYxYWI0cA/callback'
}
[AntiCrash] | [UnhandledRejection_Logs] | [start] : ===============
Unhandled Rejection at: Promise {
<rejected> DiscordAPIError[10062]: Unknown interaction
at handleErrors (/home/pi/PanaisTest/node_modules/@discordjs/rest/dist/index.js:722:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async BurstHandler.runRequest (/home/pi/PanaisTest/node_modules/@discordjs/rest/dist/index.js:826:23)
at async _REST.request (/home/pi/PanaisTest/node_modules/@discordjs/rest/dist/index.js:1266:22)
at async ChatInputCommandInteraction.deferReply (/home/pi/PanaisTest/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:69:5)
at async Object.run (/home/pi/PanaisTest/src/commands/Slash/Information/Ping.js:28:16) {
requestBody: { files: undefined, json: [Object] },
rawError: { message: 'Unknown interaction', code: 10062 },
code: 10062,
status: 404,
method: 'POST',
url: 'https://discord.com/api/v10/interactions/1212140133776891904/aW50ZXJhY3Rpb246MTIxMjE0MDEzMzc3Njg5MTkwNDpMNkRoUEJjUTFqdGdKR1NUckFNMlFnQjJCOUR2ODRqNXhMbmJhRkk0NDlsWE55dlViZHNYN25KemN0UkowblRpcVZSeUhZY0dnOG9mZTBOMUVrRGFrVWprZ2c3dHBkOGttRWFUUUFpOTRNaHBVUUFYQ0lFMUI2MGtuYnYxYWI0cA/callback'
}
} reason: DiscordAPIError[10062]: Unknown interaction
at handleErrors (/home/pi/PanaisTest/node_modules/@discordjs/rest/dist/index.js:722:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async BurstHandler.runRequest (/home/pi/PanaisTest/node_modules/@discordjs/rest/dist/index.js:826:23)
at async _REST.request (/home/pi/PanaisTest/node_modules/@discordjs/rest/dist/index.js:1266:22)
at async ChatInputCommandInteraction.deferReply (/home/pi/PanaisTest/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:69:5)
at async Object.run (/home/pi/PanaisTest/src/commands/Slash/Information/Ping.js:28:16) {
requestBody: { files: undefined, json: { type: 5, data: [Object] } },
rawError: { message: 'Unknown interaction', code: 10062 },
code: 10062,
status: 404,
method: 'POST',
url: 'https://discord.com/api/v10/interactions/1212140133776891904/aW50ZXJhY3Rpb246MTIxMjE0MDEzMzc3Njg5MTkwNDpMNkRoUEJjUTFqdGdKR1NUckFNMlFnQjJCOUR2ODRqNXhMbmJhRkk0NDlsWE55dlViZHNYN25KemN0UkowblRpcVZSeUhZY0dnOG9mZTBOMUVrRGFrVWprZ2c3dHBkOGttRWFUUUFpOTRNaHBVUUFYQ0lFMUI2MGtuYnYxYWI0cA/callback'
}
reply
except that overnight my bot these to no longer respond with the error of the bot exceeding 3 seconds of non-response
so I used deferReply
instead to see if it responded, it acts exactly the same on every order
Discord support tells me there are no API issues Nis no ratelimit applied to the bot
While this passes it the bot never had them worries for months and overnight while I made no changes to the code plus no response9 replies
DIAdiscord.js - Imagine an app
•Created by LucasB25 on 12/6/2022 in #djs-questions
Localizations (stupid)
For it works this way when there would be another even simpler way ?
Now:
After:
const data = new SlashCommandBuilder()
.setName('dog')
.setNameLocalizations({
pl: 'pies',
de: 'hund',
})
.setDescription('Get a cute picture of a dog!')
.setDescriptionLocalizations({
pl: 'Słodkie zdjęcie pieska!',
de: 'Poste ein niedliches Hundebild!',
})
const data = new SlashCommandBuilder()
.setName('dog')
.setNameLocalizations({
pl: 'pies',
de: 'hund',
})
.setDescription('Get a cute picture of a dog!')
.setDescriptionLocalizations({
pl: 'Słodkie zdjęcie pieska!',
de: 'Poste ein niedliches Hundebild!',
})
const data = new SlashCommandBuilder()
.setNameLocalizations({
pl: 'pies', default: true,
de: 'hund',
en: 'dog',
})
.setDescriptionLocalizations({
pl: 'Słodkie zdjęcie pieska!', default: true,
de: 'Poste ein niedliches Hundebild!',
de: 'Get a cute picture of a dog!',
})
const data = new SlashCommandBuilder()
.setNameLocalizations({
pl: 'pies', default: true,
de: 'hund',
en: 'dog',
})
.setDescriptionLocalizations({
pl: 'Słodkie zdjęcie pieska!', default: true,
de: 'Poste ein niedliches Hundebild!',
de: 'Get a cute picture of a dog!',
})
51 replies