#Error in the code

1 messages · Page 1 of 1 (latest)

wanton marten
#

Hi so I’m coding this bot to power up yk and it seems to not be working i keep getting missing module

distant marshBOT
#

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

wanton marten
#

// 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);

maiden bronze
wanton marten
wanton marten
#

Kinda it but cut off

#

It’s mainly missing module

maiden bronze
#

Have you installed the module in the directory you are working with?

wanton marten
#

Okay ty I forgot to install discord.js