TOKEN_INVALID
I'm not able to fix this. Tried resetting the token and adding the new token in secrets
5 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- 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!Djs is 13.11.0 and node vers is 16.7.0
const express =require("express");
const app = express()
const Discord = require("discord.js")
const client = new Discord.Client ( {intents: [ "GUILDS", "GUILD_MESSAGES", "GUILD_PRESENCES"]
});
const fs = require("fs");
const prefix = 'pls'
client.commands = new Discord.Collection();
const commands = fs.readdirSync("./Commands").filter(file => file.endsWith(".js"));
for (file of commands) {
const commandName = file.split(".")[0]
const command = require(
./Commands/${commandName})
client.commands.set(command.name,
command)
}
client.on("ready", () => {
console.log("online.")
let servers = client.guilds.cache.size
let servercount = client.guilds.cache.reduce((a,b) => a+b.memberCount, 0)
client.user.setActivity(
${client.guilds.cache.size} Servers and ${client.guilds.cache.reduce((a,b) => a+b.memberCount, 0)} Members, { type: "WATCHING" })
});
client.on("messageCreate", message => {
if(message.content.startsWith(prefix)) {
const args = message.content.slice(prefix.length).trim().split(/ +/g)
const commandName = args.shift().toLowerCase()
const command = client.commands.get(commandName)
if(!command) return
command.run(client, message, args)
}
})
client.login(process.env.token);
code in index.jsreset your token and try it with that
Unknown User•9mo ago
Message Not Public
Sign In & Join Server To View