Parameter args for client.on event
Closed this issue · 7 comments
Natchi59 commented
In EventHandler file, why the args parameter in client.on is an array of string ?
this.client.on(name, (...args: string[] => evt.execute(args))
Smaug6739 commented
i dont know which type would be best, any[]
?
Natchi59 commented
We have WSEventType to find the type of argument
https://discord.js.org/#/docs/main/stable/typedef/WSEventType
Smaug6739 commented
Yes but it's not the type of arguments of events
Smaug6739 commented
The code ...args: string[]
represent the arguments of the event no the event name
Natchi59 commented
Yes i now, but with this we can find the type of the argument, if we can't put any
type
Smaug6739 commented
It would be necessary to create an interface for each event and to make conditions. I think the any
type is therefore the best
Natchi59 commented
Yes i think that as well !
this.client.on(name, (...args: any[] => evt.execute(args));