#attach class to client

4 messages · Page 1 of 1 (latest)

lean thorn

let's say you need 1 instance of a class for you bot. do you normally attach it to the client as a new object so you can reference it from client? i.e. client.theClass = new theClass();

idle hollowBOT
  • 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
red pantherBOT

We highly recommend you extend the Client structure properly instead of just attaching custom properties like .commands to the regular discord.js Client instance.