Properly Defining Types for Interactions
Currently migrating my bot from JS(v13) -> TS(v14.3.0) and I've run into a challenge perhaps, I am attempting to call a function and pass the
Interaction<>
or ChatInputCommandInteraction<CacheType>
type to the parameter however it doesn't think its the correct type? Am I just blind and using the wrong type to pass?9 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.
video testing types
So since typescript is set to strict, I presume i should just allow this as an
interaction: unknown
type?
seems either one I pick TS doesnt like it because its top level coming from the event
perhaps my tsconfig.json
is too strict
True, this is specifically handling all Interaction
aliases
but yeah TSS either wants a specific
or notUnknown User•3y ago
Message Not Public
Sign In & Join Server To View
see
im new to TS sorry
thanks for the advice
ill keep researching
i see the methods on that one yea
I understand that, but typescript appears to be taking it literally unless I dont understand how aliases work which is very likely
it exists in ChatInputCommandInteraction
for
.reply()
so i guess i need to add the others
oh i see
interesting
thanks sorry mate
closing this, appreciate it
apologies for lack of knowledge