#Export Problem

9 messages · Page 1 of 1 (latest)

south summit

Hi How can I use const client = new Client in the another file. I export it but when I logged it, got undefined.

wheat mauveBOT
  • 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!
light creek

virtually all djs structures have a client property so you shouldn't need to export

south summit

But I cant use it like const client = require("../index.js");

light creek

but why. Just make a function that takes a client as a parameter and call that function in your ready event

south summit

Yea I know it but I use in database file.

I dont understand how can I do that.... sorry

light creek

you should know how to create and export a function by now