𝒮𝒽𝒶𝓁𝑒𝓋
𝒮𝒽𝒶𝓁𝑒𝓋
Explore posts from servers
DIAdiscord.js - Imagine an app
Created by 𝒮𝒽𝒶𝓁𝑒𝓋 on 6/21/2024 in #djs-questions
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
');
25 replies
CDCloudflare Developers
Created by 𝒮𝒽𝒶𝓁𝑒𝓋 on 6/21/2024 in #general-help
i need help with my code
it send
C:\Program Files\nodejs\node.exe .\my-discord-bot\index.js
Process exited with code 1
Uncaught SyntaxError C:\Users\user\Desktop\dis\2\my-discord-bot\index.js:11
const client = new Client({
^

SyntaxError: Identifier 'client' has already been declared
at wrapSafe (internal/modules/cjs/loader:1281:20)
at Module._compile (internal/modules/cjs/loader:1321:27)
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)
No debugger available, can not send 'variables'
C:\Program Files\nodejs\node.exe .\my-discord-bot\index.js
Process exited with code 1
Uncaught SyntaxError C:\Users\user\Desktop\dis\2\my-discord-bot\index.js:11
const client = new Client({
^

SyntaxError: Identifier 'client' has already been declared
at wrapSafe (internal/modules/cjs/loader:1281:20)
at Module._compile (internal/modules/cjs/loader:1321:27)
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)
No debugger available, can not send 'variables'
my code it
const Discord = require('discord.js');
const client = new Discord.Client();

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

client.login('token');
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('token');
C:\Users\user\Desktop\dis\2\my-discord-bot\node_modules\discord.js\src\client\Client.js:512
throw new DiscordjsTypeError(ErrorCodes.ClientMissingIntents);
^
const Discord = require('discord.js');
const client = new Discord.Client();

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

client.login('token');
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('token');
C:\Users\user\Desktop\dis\2\my-discord-bot\node_modules\discord.js\src\client\Client.js:512
throw new DiscordjsTypeError(ErrorCodes.ClientMissingIntents);
^
4 replies