#Error in the code
1 messages · Page 1 of 1 (latest)
Thanks for your question :clap:, if someone gives you an answer it would be great if you thanked them with a :white_check_mark: in response. This response will earn you both points for special roles on this server.
Error in the code
// discord-bot.js
const { Client, GatewayIntentBits } = require('discord.js');
require('dotenv').config(); // loads BOT_TOKEN from .env
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent
],
});
client.once('ready', () => {
console.log(✅ Logged in as ${client.user.tag});
});
client.on('messageCreate', message => {
if (message.author.bot) return; // ignore bot messages
if (message.content === '!ping') {
message.reply('Pong!');
}
});
// Login using the token from your .env file
client.login(process.env.BOT_TOKEN);
Can you share the error message?
I can when I get home yes
Kinda it but cut off
It’s mainly missing module
Have you installed the module in the directory you are working with?
Oooo

Okay ty I forgot to install discord.js