i code my discord bots with discord.js and i made another bot and used the same code
const Discord = require("discord.js");
const client = new Discord.Client({
intents:["Guilds", "GuildMessages", "GuildMembers", "MessageContent"],
partials: ["Channel", "Message"]
});
const token = ("*my discord token*")
client.on('ready', async () => {
console.log(`Client has been initiated! ${client.user.name}`)
});
client.on('messageCreate', async (message) => {
if (message.content.toLowerCase() === "hi") {
console.log("hello");
message.reply("Hello!").catch(err => console.error(err));
}
});
client.login(token);
i typed the exact code but it resulted with that same code and i copied the code from on my old bot and it still gives the stupid same error code
New contributor
vee s code guy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.