Here's my index.js file:
app.get("/bots/host", auth, async (req, res) => {
const client = require("./bot")
client.login(data.token)
client.on('ready', () => {
console.log("Bot ready from the panel")
})
})
This is my bot.js file:
const client = new Discord.Client()
client.on('ready', () => {
console.log(client.user.username)
})
module.exports = client
All I want to do is get the client and create a new one like this
const client = new require("./bot")