why set event return type to void instead of any?
typescript error (simplified):
i didnt use typescript before djs v14 but why not set the type to
Promise<any>
? is there a specific reason11 Replies
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Unless im missing something, arent you the one that can change what the function will expect to receive?
If you want to to receive Promise<any>, just put it
im sorry i dont get what do u mean
(param1, param2): returnType => {}
u mean changing the callback to something like
Just use Promise<any>...
yea mb i typed wrong
but thats just unnecessary complication
Doubt you need
as any as Promise<any>
Else you can also do Promise<Message> if you will always return a messagebut that wont go with the event's expected return
do u want me to show u what the error says? its long
na i do need it
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Use void if you want to make ts happy
return void await …