#I want to add custom (typed) events to the Client class.

5 messages · Page 1 of 1 (latest)

candid lake
#

So i have this class that extends the Client class and it just adds some utilities i use. I want to add a few more events to that extending class.

Now usually this would be no problem as I just emit using the already baked-in EventEmitter in the Client class. However, I would like to additionally add typings using the same already integrated system that DJS uses.

Is this even possible?

FYI, by typings i mean types for the parameters when i listen to an event:

clientV2.on("customEventName", (thisIsTypedAutomatically) => {...});
slate garnetBOT
#
  • What's your exact discord.js npm list discord.js and node node -v version?
  • Not a discord.js issue? Check out #1081585952654360687.
  • Consider reading #how-to-get-help to improve your question!
  • Explain what exactly your issue is.
  • Post the full error stack trace, not just the top part!
  • Show your code!
  • Issue solved? Press the button!
  • Marked as resolved by OP
dense gull
candid lake
#

Fair enough, thanks nonetheless!

dense gull