const Discord = require("discord.js")
const client = new Discord.Client()
client.on("ready", () => {
console.log(`Logged in as ${client.user.tag}.`)
})
client.on("message", msg => {
if (msg.content === "hi") {
msg.reply("hey")
}
})
client.login(process.env.TOKEN)
const mySecret = process.env['TOKEN']
in future, please send the error message
What do i write now?
oh, mb you also have to enable the MESSAGE CONTENT INTENT in the Bot tab of your app in the Discord Developer Portal
1 Like