srpalha
DIAdiscord.js - Imagine an app
•Created by srpalha on 10/27/2023 in #djs-questions
Error in discord.js v14
throw new DiscordAPIError(data, "code" in data ? data.code : data.error, status, method, url, requestData);
^
DiscordAPIError[10062]: Unknown interaction
at handleErrors (/Users/macbookdrink/node_modules/@discordjs/rest/dist/index.js:687:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async BurstHandler.runRequest (/Users/macbookdrink/node_modules/@discordjs/rest/dist/index.js:786:23)
at async _REST.request (/Users/macbookdrink/node_modules/@discordjs/rest/dist/index.js:1218:22)
at async ChatInputCommandInteraction.reply (/Users/macbookdrink/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:111:5) {
requestBody: {
files: [],
json: {
type: 4,
data: {
content: 'Ocorreu um erro ao buscar informações do invocador.',
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/1167555442663239761/aW50ZXJhY3Rpb246MTE2NzU1NTQ0MjY2MzIzOTc2MToxRjUxd3dxRnBZR2tCSGpabGtRWm5BVUpMQnN0bmpEODEySnRiOXZJRVVTY0EwWVZWUGt3Um1Dd01qb1dGOVU3cG1ZWkU1VXlsa3lMcGxTRmpYc285RmVDMVhEaVFDR3ZiYmVLWWo2aGR0MjBnSURBNWswSTlxNG9KR25HMzBVVQ/callback'
}
Node.js v18.17.1
macbookdrink@MacBook-Pro-de-Patrik Rito Gomes %
https://pastebin.com/mphtnzES my elo.js
https://pastebin.com/jDvAThkP also index.js5 replies
DIAdiscord.js - Imagine an app
•Created by srpalha on 10/27/2023 in #djs-questions
problem with interactionCreate
i am receiving this error
/Users/macbookdrink/Desktop/Rito Gomes/events/discord/interactionCreate.js:17
command.run(client, interaction);
^
TypeError: command.run is not a function
at module.exports (/Users/macbookdrink/Desktop/Rito Gomes/events/discord/interactionCreate.js:17:13)
at Client.emit (node:events:514:28)
at InteractionCreateAction.handle (/Users/macbookdrink/node_modules/discord.js/src/client/actions/InteractionCreate.js:97:12)
at module.exports [as INTERACTION_CREATE] (/Users/macbookdrink/node_modules/discord.js/src/client/websocket/handlers/INTERACTION_CREATE.js:4:36)
at WebSocketManager.handlePacket (/Users/macbookdrink/node_modules/discord.js/src/client/websocket/WebSocketManager.js:355:31)
at WebSocketManager.<anonymous> (/Users/macbookdrink/node_modules/discord.js/src/client/websocket/WebSocketManager.js:239:12)
at WebSocketManager.emit (/Users/macbookdrink/node_modules/@vladfrangu/async_event_emitter/dist/index.js:282:31)
at WebSocketShard.<anonymous> (/Users/macbookdrink/node_modules/@discordjs/ws/dist/index.js:1173:51)
at WebSocketShard.emit (/Users/macbookdrink/node_modules/@vladfrangu/async_event_emitter/dist/index.js:282:31)
at WebSocketShard.onMessage (/Users/macbookdrink/node_modules/@discordjs/ws/dist/index.js:988:14)
Node.js v18.17.1
this is my interactionCreate.js
module.exports = (client, interaction) => {
// Verifique se nossa interação é um comando de barra
if (interaction.isCommand()) {
// Obtenha o comando da nossa coleção de comandos de barra
const command = client.interactions.get(interaction.commandName);
// Se o comando não existir, retorne uma mensagem de erro
if (!command) {
return interaction.reply({
content: "Algo deu errado. Talvez o comando não esteja registrado?",
ephemeral: true
});
}
// Execute o comando com o cliente e a interação como parâmetros
command.run(client, interaction);
}
}
and this is what i am executing
https://pastebin.com/UKHd2hnihttps://pastebin.com/UKHd2hni10 replies
DIAdiscord.js - Imagine an app
•Created by srpalha on 8/20/2023 in #djs-questions
throw er; // Unhandled 'error' event
how can i solv this?
node:events:492
throw er; // Unhandled 'error' event
^
ReferenceError: channel is not defined
at module.exports (/Users/macbookdrink/Desktop/Astarion-Bot/events/interactionCreate.js:18:17)
at Client.emit (node:events:514:28)
at InteractionCreateAction.handle (/Users/macbookdrink/Desktop/Astarion-Bot/node_modules/discord.js/src/client/actions/InteractionCreate.js:97:12)
at module.exports [as INTERACTION_CREATE] (/Users/macbookdrink/Desktop/Astarion-Bot/node_modules/discord.js/src/client/websocket/handlers/INTERACTION_CREATE.js:4:36)
at WebSocketManager.handlePacket (/Users/macbookdrink/Desktop/Astarion-Bot/node_modules/discord.js/src/client/websocket/WebSocketManager.js:355:31)
at WebSocketManager.<anonymous> (/Users/macbookdrink/Desktop/Astarion-Bot/node_modules/discord.js/src/client/websocket/WebSocketManager.js:239:12)
at WebSocketManager.emit (/Users/macbookdrink/Desktop/Astarion-Bot/node_modules/@vladfrangu/async_event_emitter/dist/index.js:282:31)
at WebSocketShard.<anonymous> (/Users/macbookdrink/Desktop/Astarion-Bot/node_modules/@discordjs/ws/dist/index.js:1173:51)
at WebSocketShard.emit (/Users/macbookdrink/Desktop/Astarion-Bot/node_modules/@vladfrangu/async_event_emitter/dist/index.js:282:31)
at WebSocketShard.onMessage (/Users/macbookdrink/Desktop/Astarion-Bot/node_modules/@discordjs/ws/dist/index.js:988:14)
Emitted 'error' event on Client instance at:
at emitUnhandledRejectionOrErr (node:events:395:10)
at process.processTicksAndRejections (node:internal/process/task_queues:84:21)
Node.js v18.17.1
7 replies
DIAdiscord.js - Imagine an app
•Created by srpalha on 8/20/2023 in #djs-questions
Something with BitFieldInvalid error on my bot.
i am trying to solve this problem, he start about 1h ago
/Users/macbookdrink/Desktop/Astarion-Bot/node_modules/discord.js/src/util/BitField.js:172
throw new DiscordjsRangeError(ErrorCodes.BitFieldInvalid, bit);
^
RangeError [BitFieldInvalid]: Invalid bitfield flag or number: GUILDS.
at IntentsBitField.resolve (/Users/macbookdrink/Desktop/Astarion-Bot/node_modules/discord.js/src/util/BitField.js:172:11)
at /Users/macbookdrink/Desktop/Astarion-Bot/node_modules/discord.js/src/util/BitField.js:167:54
at Array.map (<anonymous>)
at IntentsBitField.resolve (/Users/macbookdrink/Desktop/Astarion-Bot/node_modules/discord.js/src/util/BitField.js:167:40)
at new BitField (/Users/macbookdrink/Desktop/Astarion-Bot/node_modules/discord.js/src/util/BitField.js:33:38)
at new IntentsBitField (/Users/macbookdrink/Desktop/Astarion-Bot/node_modules/discord.js/src/util/IntentsBitField.js:9:1)
at Client._validateOptions (/Users/macbookdrink/Desktop/Astarion-Bot/node_modules/discord.js/src/client/Client.js:511:25)
at new Client (/Users/macbookdrink/Desktop/Astarion-Bot/node_modules/discord.js/src/client/Client.js:78:10)
at Object.<anonymous> (/Users/macbookdrink/Desktop/Astarion-Bot/index.js:2:16)
at Module._compile (node:internal/modules/cjs/loader:1256:14) {
code: 'BitFieldInvalid'
}
Node.js v18.17.1
16 replies