#intents
1 messages · Page 1 of 1 (latest)
yes?
show the code now
login part is not in the picture, but is in the code
what is the error show me
const client = new Client({ intents: [Intents.FLAGS.GUILDS,Intents.FLAGS.GUILD_MEMBERS, Intents.FLAGS.GUILD_MESSAGES] });
change it to this
@flint island
like this?
what is the node version your using
what do u mean
im programming games, idk how program a bot
type node -v in terminal and show the result
oo
is my code correct
what do u mean
im rageing im my bedroom rn
wait till i refer it
is this your client.js file
you have to add that last part to the top of your code
yes
@flint island
yes?
..
ok
yes mention the intents before logging in to client
is there any type of help
like this?
no move the bot.login part below the intents
yesss
you too
ooh
show the code
AAAAAAAAAAAAAAAAAH
you dont have to manually save it in vsc
huh
isnt that when you turn on autosave
idk
like this?
copy paste that 14,15 lines to the top of your code
yeah just move that below the const client part
ok
that second line should be the last line of your code
you have it in 2nd line
like this
bot.login part should be the last line of your code
ok
const client = new Client({
intents: [Intents.FLAGS.GUILDS,Intents.FLAGS.GUILD_MEMBERS, Intents.FLAGS.GUILD_MESSAGES]
});
client.login('token')
like this @forest aurora
exactly
node .
yep
is my code correct
still this error
@tender sentinel change your code to this
client is your discord.client with the intents mentioned bot isnt. replace bot.login with client.login
still error
do i remove all of this and do that
@flint island show your code man
i guess
@flint island can u copy past the code without token
can both of @flint island and @tender sentinel send me a friend request
i will help out
@forest aurora
this way is hard
why
the full code?
yes
why?
const {Client, Intents} = require('discord.js');
const client = new Client({
intents: [
Intents.FLAGS.GUILDS,
Intents.FLAGS.GUILD_MEMBERS
]
});
client.login('your token')
to help you out
wait
new error
const { Client,Intents } = require('discord.js');
// Create a new client instance
const client = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES] });
// WShen the client is ready, run this code (only once)
client.once('ready', () => {
console.log('Ready!');
});
// Login to Discord with your client's token
client.login(token);
still this is happening
all of you jaut remove all the code and copy paste this
then ill teach one by one
did it
edited it.try again
ok did it
replace 'token' with your token
ok
not clear what is the error
const { Client, Intents } = require('discord.js');
SyntaxError: Invalid or unexpected token
←[90m at Object.compileFunction (node:vm:352:18)←[39m
←[90m at wrapSafe (node:internal/modules/cjs/loader:1026:15)←[39m
←[90m at Module._compile (node:internal/modules/cjs/loader:1061:27)←[39m
←[90m at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10)←[39m
←[90m at Module.load (node:internal/modules/cjs/loader:975:32)←[39m
←[90m at Function.Module._load (node:internal/modules/cjs/loader:822:12)←[39m
←[90m at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)←[39m
←[90m at node:internal/main/run_main_module:17:47←[39m
Node.js v17.3.0
the error
no way there can be an error
it is
show your code, a screenshot
that is the code (the client.login is there but not in the picture)
shame there is a 'syntax error'
for me
is it a syntax error in mine?
entire code:
const { Client, Intents } = require('discord.js');
// Create a new client instance
const client = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES] });
// WShen the client is ready, run this code (only once)
client.once('ready', () => {
console.log('Ready!');
});
// Login to Discord with your client's token
client.login(SECRET TOKEN);
not clear man
here is clear
there cannot be an error
how
NOW THERE IS A NEW ERROR
what the
bruh
its not my name, i used something random
no
this is just getting worse