Sheweny/framework

Parameter args for client.on event

Closed this issue · 7 comments

In EventHandler file, why the args parameter in client.on is an array of string ?

this.client.on(name, (...args: string[] => evt.execute(args))

i dont know which type would be best, any[] ?

We have WSEventType to find the type of argument

https://discord.js.org/#/docs/main/stable/typedef/WSEventType

Yes but it's not the type of arguments of events

The code ...args: string[] represent the arguments of the event no the event name

Yes i now, but with this we can find the type of the argument, if we can't put any type

It would be necessary to create an interface for each event and to make conditions. I think the any type is therefore the best

Yes i think that as well !

this.client.on(name, (...args: any[] => evt.execute(args));