#how can i require my client from another file e.g.index.js
1 messages · Page 1 of 1 (latest)
That will import that specific module. You need to also export the client from index.js
Taking the answer with function in account, you could use something like:
let client;
exports.get_client = () => {} //return client
Though this is not related to Discord.js, is just JS knowledge
Also, it would be better to use the keyword export rather than the object itself
what luna probably means is you can pass it as the function argument in ur case ....snipe.execute(client, interaction); and get that client value in execute async execute(client, interaction) {....