-- Client Function File -- const botConfig = require("../botconfig.json"); const { GatewayIntentBits, Partials } = require("discord.js") const discord = require("discord.js") const client = new discord.Client({ intents: [ GatewayIntentBits.Guilds, GatewayIntentBits.GuildMembers, GatewayIntentBits.GuildBans, GatewayIntentBits.GuildInvites, GatewayIntentBits.GuildMessages, GatewayIntentBits.GuildMessageReactions, GatewayIntentBits.GuildMembers, GatewayIntentBits.MessageContent, GatewayIntentBits.GuildVoiceStates ], partials: [Partials.Message, Partials.Channel, Partials.Reaction, Partials.GuildMember, Partials.GuildScheduledEvent, Partials.User] }) client.commands = new discord.Collection(); client.login("other token to try if its working."); module.exports.GetClient = async () => { return client } -- Index.js -- //Get the client const ClientFile = require("../App/functions/client"); const apiClient = ClientFile.GetClient(); console.log(apiClient.user)