Cannot use `{data.length}` (Typescript)
i dont know the reason why
{data.length}
get error, it announced that 'data' is of type 'unknown'.ts(18046)
Here is the code:
6 Replies
• What's your exact discord.js
npm list discord.js
and node node -v
version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.REST#put
has a return type of Promise<unknown>
, you can type it with https://discord-api-types.dev/api/discord-api-types-v10#RESTPutAPIApplicationCommandsResult
alternatively i believe using the API
class from @discordjs/core/http-only
can be a good choice https://discord.js.org/docs/packages/core/0.6.0/API:Classwell i decide to do this if possible:
so i think ... it can search for the lenght, will it?
i would guess so, but you can also simply import
RESTPutAPIApplicationCommandsResult
from discord.jsalright thanks ^^
np