discordjs / discord.js

A powerful JavaScript library for interacting with the Discord API
https://discord.js.org
Apache License 2.0
25.36k stars 3.97k forks source link

`followUp()` not working on latest update #6524

Closed ghost closed 3 years ago

ghost commented 3 years ago

Please describe the problem you are having in as much detail as possible: Hello. I discovered a problem. After updating Discord.JS v13 to the latest version, the followUp feature no longer works properly. Every time I use it, I get the Unknown webhook error. My code:

await interaction.defer();

/* 
rest of code ...

Sender - embed sender
lang - language handler
userData - user economy data
*/

await interaction.followUp({
     embeds: [sender.success().addFields([
           { name: lang.get("DATA_COMMANDS_BALANCE_CASH"), value: userData.cash.toString() },
           { name: lang.get("DATA_COMMANDS_BALANCE_BANK"), value: userData.bank.toString() },
           { name: lang.get("DATA_COMMANDS_BALANCE_TOTAL"), value: (userData.cash + userData.bank).toString() }
     ])]
});

Further details:

SpaceEEC commented 3 years ago

I'm unsure how you are encountering this error. discord.js does not seem to define a defer method on any class deriving from Interaction (or rather on no class at all).


Note that latest is not a version, but a tag. A version would be, for example, 12.0.0.


Please update your code and the discord.js version so this can be reproduced.

iCrawl commented 3 years ago

Additionally to top:

The issue tracker is only for bug reports and enhancement suggestions. If you have a question, please ask it in the Discord server instead of opening an issue – you will get redirected there anyway.

ghost commented 3 years ago

I replaced defer to deferReply and this is working now. Thanks.