Discord Bot is online But Does not reply

Viewed 14

My discord bot is online but there is something wrong. The bot does not reply my code.

const { Client, GatewayIntentBits } = require('discord.js');
const Discord = require("discord.js")
const TOKEN = "MyToken"

const client = new Discord.Client({
  intents: [
    GatewayIntentBits.Guilds,
    GatewayIntentBits.GuildMessages,
  ]
})

client.on("ready", () => {
  console.log(`Logged in as ${client.user.tag}`)
})

client.on("messageCreate", (message) => {
  if (message.content === "hi") {
    message.reply("Hello World")
  }
})

client.login(TOKEN)

Bot does not reply the code

1 Answers

Check the permissions in the invite link and intents you set of the bot.

Related