#I need help to debug my code

24 messages · Page 1 of 1 (latest)

clever kestrel
#

Hey! I need more context to help you.

late veldt
#
Fehler beim Erkunden der Welt: DiscordAPIError[10062]: Unknown interaction
    at handleErrors (/home/discordbot/node_modules/@discordjs/rest/dist/index.js:727:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async BurstHandler.runRequest (/home/discordbot/node_modules/@discordjs/rest/dist/index.js:831:23)
    at async _REST.request (/home/discordbot/node_modules/@discordjs/rest/dist/index.js:1272:22)
    at async ChatInputCommandInteraction.reply (/home/discordbot/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:115:5)
    at async Object.execute (/home/discordbot/commands/explore.js:27:4)
    at async Object.execute (/home/discordbot/events/interactionCreate.js:65:5) {
  requestBody: { files: [], json: { type: 4, data: [Object] } },
  rawError: { message: 'Unknown interaction', code: 10062 },
  code: 10062,
  status: 404,
  method: 'POST',
  url: 'https://discord.com/api/v10/interactions/1315306029193498656/aW50ZXJhY3Rpb246MTMxNTMwNjAyOTE5MzQ5ODY1NjozdGwzOHZwbWVYbzVZYzF0SjB4WUNXa3htRXlzdnpkaVZkdDRKamUxYnlvdFowdHdJSWFZTXdaZE9XR2NBM1B5ZFJZaFhTTXJXU2k4bFBWZHU1Rm9HMFh3ZUhmMnZLNTZlNkVqdVZlVnlRMDFwZmhyN2R2amdvQmttUm5VSHc3Rg/callback'
}
Befehl explore erfolgreich ausgeführt.
Error executing explore
DiscordAPIError[40060]: Interaction has already been acknowledged.
    at handleErrors (/home/discordbot/node_modules/@discordjs/rest/dist/index.js:727:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async BurstHandler.runRequest (/home/discordbot/node_modules/@discordjs/rest/dist/index.js:831:23)
    at async _REST.request (/home/discordbot/node_modules/@discordjs/rest/dist/index.js:1272:22)
    at async ChatInputCommandInteraction.reply (/home/discordbot/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:115:5)
    at async Object.execute (/home/discordbot/commands/explore.js:31:4)
    at async Object.execute (/home/discordbot/events/interactionCreate.js:65:5) {
  requestBody: { files: [], json: { type: 4, data: [Object] } },
  rawError: {
    message: 'Interaction has already been acknowledged.',
    code: 40060
  },
  code: 40060,
  status: 400,
  method: 'POST',
  url: 'https://discord.com/api/v10/interactions/1315306029193498656/aW50ZXJhY3Rpb246MTMxNTMwNjAyOTE5MzQ5ODY1NjozdGwzOHZwbWVYbzVZYzF0SjB4WUNXa3htRXlzdnpkaVZkdDRKamUxYnlvdFowdHdJSWFZTXdaZE9XR2NBM1B5ZFJZaFhTTXJXU2k4bFBWZHU1Rm9HMFh3ZUhmMnZLNTZlNkVqdVZlVnlRMDFwZmhyN2R2amdvQmttUm5VSHc3Rg/callback'
}

#

I can send my GH repo too

clever kestrel
#

oh sorry i am not good with apis

late veldt
#

😅

#

I use discordjs

elder python
late veldt
#

@elder python tyyyyyyyyy

late veldt
elder python
#

I didn't take a look yet

late veldt
#

ahh ok^^

royal pendant
elder python
#

Germans code in german

#

French uses French, etc.

royal pendant
#

man i didnt know ima need google translator to help with with code

elder python
#

@late veldt send your config please.

elder python
#

@royal pendant have you got it started ? I managed to get past the module errors, but i had to tweak the package.json and the config is missing

#

also im not familiar with discord bot building 😂

elder python
#

@late veldt

You invoke the execute method twice on every interaction command, once here : client.on('interactionCreate') (https://github.com/NicolasMatheisen/discordbot/blob/c1b4c3035a168c5f4a61d89fd8a0bd3a5751fa22/index.js#L74)

and once in interactionCreate#execute (https://github.com/NicolasMatheisen/discordbot/blob/c1b4c3035a168c5f4a61d89fd8a0bd3a5751fa22/events/interactionCreate.js#L65)

That provokes errors because the interaction gets the intended reply, but then try to reply again.
Since you're handling the interactionCreate event in a separate file (as it should), I'd suggest to remove the guilty line in index.js for now, and further investigate as to why you need to handle interactionCreate there.

GitHub

Contribute to NicolasMatheisen/discordbot development by creating an account on GitHub.

GitHub

Contribute to NicolasMatheisen/discordbot development by creating an account on GitHub.

elder python
#

I noticed some other things you might want to fix if you're interested just message me.

late veldt
#

hmmm I think I don't have any config.json

#

only I have a .env cause its more saver 🙂 but I can create a copy but U need to fill it with ur own token...