Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Discord.js V14 interaction.editReply gives a invalid webhook token error

When I try to edit a reply to a slash command using interaction.editReply() after having deferred it using interaction.deferReply() I get a DiscordAPIError[50027]: Invalid Webhook Token.

The deferReply goes through without a problem because I do get the bot is thinking... message, but as soon as I call the editReply it triggers the error message. Using interaction.reply()does not throw this error, but I can not confidently say that all interactions can be replied to within 3 seconds because data has to be fetched from a database.

I am completely lost as to what could cause this error, especially because I can not remember changing anything in the code that could have any influence on this which is backed up by the fact that a older version of this project is giving me the same error while it did work literally yesterday.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Here is the full error message I am getting:

E:\OneDrive\Developing\Discord\JavaScript\Discord bot\Code\node_modules\@discordjs\rest\dist\index.js:748
        throw new DiscordAPIError(data, "code" in data ? data.code : data.error, status, method, url, requestData);
              ^

DiscordAPIError[50027]: Invalid Webhook Token
    at SequentialHandler.runRequest (E:\OneDrive\Developing\Discord\JavaScript\Discord bot\Code\node_modules\@discordjs\rest\dist\index.js:748:15)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async SequentialHandler.queueRequest (E:\OneDrive\Developing\Discord\JavaScript\Discord bot\Code\node_modules\@discordjs\rest\dist\index.js:560:14)
    at async REST.request (E:\OneDrive\Developing\Discord\JavaScript\Discord bot\Code\node_modules\@discordjs\rest\dist\index.js:1000:22)
    at async InteractionWebhook.editMessage (E:\OneDrive\Developing\Discord\JavaScript\Discord bot\Code\node_modules\discord.js\src\structures\Webhook.js:324:15)
    at async ChatInputCommandInteraction.editReply (E:\OneDrive\Developing\Discord\JavaScript\Discord bot\Code\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:150:21)
    at async E:\OneDrive\Developing\Discord\JavaScript\Discord bot\Code\commands\raids\account.js:68:21 {
  rawError: { message: 'Invalid Webhook Token', code: 50027 },
  code: 50027,
  status: 401,
  method: 'PATCH',
  url: 'https://discord.com/api/v10/webhooks/997498462792859720/aW50ZXJhY3Rpb246MTAwMDAyNTAzNTM0NTUxMDQxMDpvUEVwOXNZWEYwU2F3THFHazgyMGZESXIyOXpaS0Y0NE1IdHdZZzk4WjFnbmR2bVcyWU03SGF4bWhXbzF3S0NCREJqbzhQZmNTRUljV0U0N2dhR2xtNTNXRnBuNzg5ZGZ3M2lXN2NjQTgyUU1MbkhKdEE5NUVWRFIzM0NYdFo4WQ/messages/@original',
  requestBody: {
    files: [],
    json: {
      content: undefined,
      tts: false,
      nonce: undefined,
      embeds: [
        {
          title: 'Switch account',
          description: 'Choose your new active account from the list below.',
          color: 2132654
        }
      ],
      components: [ { type: 1, components: [ [Object] ] } ],
      username: undefined,
      avatar_url: undefined,
      allowed_mentions: undefined,
      flags: 64,
      message_reference: undefined,
      attachments: undefined,
      sticker_ids: undefined
    }
  }
}

Any help is greatly appreciated.

>Solution :

Don’t worry it’s Discord’s fault, it should be fixed shortly

Hi everyone. There is currently an issue being investigated with interaction edits, deletes, and followups. This issue results in receiving 50027: Invalid Webhook Token errors when trying to edit, delete, follow up, or take some other actions on interaction webhooks.
Discord Developers #discord-api-annoncements

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading