I need help with my code

it send
C:\Program Files\nodejs\node.exe .\my-discord-bot\index.js
Uncaught TypeError TypeError: Cannot read properties of undefined (reading 'FLAGS')
at <anonymous> (c:\Users\user\Desktop\dis\2\my-discord-bot\index.js:6:17)
at Module._compile (internal/modules/cjs/loader:1358:14)
at Module._extensions..js (internal/modules/cjs/loader:1416:10)
at Module.load (internal/modules/cjs/loader:1208:32)
at Module._load (internal/modules/cjs/loader:1024:12)
at executeUserEntryPoint (internal/modules/run_main:174:12)
at <anonymous> (internal/main/run_main_module:28:49)
Process exited with code 1

C:\Program Files\nodejs\node.exe .\my-discord-bot\index.js
Uncaught TypeError TypeError: Cannot read properties of undefined (reading 'FLAGS')
at <anonymous> (c:\Users\user\Desktop\dis\2\my-discord-bot\index.js:6:17)
at Module._compile (internal/modules/cjs/loader:1358:14)
at Module._extensions..js (internal/modules/cjs/loader:1416:10)
at Module.load (internal/modules/cjs/loader:1208:32)
at Module._load (internal/modules/cjs/loader:1024:12)
at executeUserEntryPoint (internal/modules/run_main:174:12)
at <anonymous> (internal/main/run_main_module:28:49)
Process exited with code 1

my code it
const Discord = require('discord.js');
const { Client, Intents } = require('discord.js');

const client = new Client({
intents: [
Intents.FLAGS.GUILDS, // חובה לצרכי הבסיסיים של הבוט
Intents.FLAGS.GUILD_MESSAGES // רק אם הבוט צריך לקרוא ולכתוב הודעות
]
});

client.once('ready', () => {
console.log('Bot is online!');
});

client.login('t
');
const Discord = require('discord.js');
const { Client, Intents } = require('discord.js');

const client = new Client({
intents: [
Intents.FLAGS.GUILDS, // חובה לצרכי הבסיסיים של הבוט
Intents.FLAGS.GUILD_MESSAGES // רק אם הבוט צריך לקרוא ולכתוב הודעות
]
});

client.once('ready', () => {
console.log('Bot is online!');
});

client.login('t
');
13 Replies
d.js toolkit
d.js toolkit4w ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by OP
𝒮𝒽𝒶𝓁𝑒𝓋
how i do that? Can you come talk to me and help me? to fix that Because I tried everything and it didn't work Oh, so do you have a code for me that uses V14??
Unknown User
Unknown User4w ago
Message Not Public
Sign In & Join Server To View
𝒮𝒽𝒶𝓁𝑒𝓋
const { Client, Intents } = require('discord.js'); const client = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES] }); client.once('ready', () => { console.log('Bot is ready!'); }); client.on('messageCreate', message => { if (message.content === '!ping') { message.reply('Pong!'); } }); // Replace 'YOUR_TOKEN' with your own bot token client.login('YOUR_TOKEN'); this code work?
Unknown User
Unknown User4w ago
Message Not Public
Sign In & Join Server To View
𝒮𝒽𝒶𝓁𝑒𝓋
i new with code
d.js docs
d.js docs4w ago
:guide: Home: Introduction - Before you begin... read more
Unknown User
Unknown User4w ago
Message Not Public
Sign In & Join Server To View
𝒮𝒽𝒶𝓁𝑒𝓋
what is the V i need ?
Unknown User
Unknown User4w ago
Message Not Public
Sign In & Join Server To View
𝒮𝒽𝒶𝓁𝑒𝓋
ha But I use Google Translate, it's not a good translator for read
Unknown User
Unknown User4w ago
Message Not Public
Sign In & Join Server To View