#intents

1 messages · Page 1 of 1 (latest)

forest aurora
#

@flint island

flint island
#

yes?

forest aurora
#

show the code now

flint island
#

login part is not in the picture, but is in the code

forest aurora
#

what is the error show me

flint island
#

@forest aurora

forest aurora
#
const​ ​client​ ​=​ ​new​ ​Client​(​{​ ​intents​: ​[​Intents​.​FLAGS​.​GUILDS​,​Intents​.​FLAGS​.​GUILD_MEMBERS​,​ ​Intents​.​FLAGS​.​GUILD_MESSAGES​]​ ​}​)​;
#

change it to this

#

@flint island

flint island
#

like this?

forest aurora
#

exactly

#

show if theres any error

flint island
#

i use command: node .

forest aurora
#

what is the node version your using

flint island
#

im programming games, idk how program a bot

forest aurora
#

type node -v in terminal and show the result

flint island
forest aurora
#

oo

tender sentinel
#

is my code correct

flint island
tender sentinel
#

im rageing im my bedroom rn

forest aurora
#

wait till i refer it

high sky
forest aurora
#

you have to add that last part to the top of your code

flint island
forest aurora
#

@flint island

flint island
flint island
high sky
#

yes mention the intents before logging in to client

tender sentinel
#

is there any type of help

flint island
high sky
#

no move the bot.login part below the intents

forest aurora
#

yesss

forest aurora
tender sentinel
tender sentinel
#

:_

forest aurora
#

show the code

tender sentinel
#

AAAAAAAAAAAAAAAAAH

high sky
#

you saved it?

#

ctrl s

forest aurora
#

you dont have to manually save it in vsc

tender sentinel
high sky
#

isnt that when you turn on autosave

#

idk

flint island
#

like this?

forest aurora
high sky
flint island
forest aurora
#

you have it in 2nd line

tender sentinel
forest aurora
#

bot.login part should be the last line of your code

tender sentinel
#

ok

high sky
#
const​ ​client​ ​=​ ​new​ ​Client​(​{​ 
​intents​: ​[​Intents​.​FLAGS​.​GUILDS​,​Intents​.​FLAGS​.​GUILD_MEMBERS​,​ ​Intents​.​FLAGS​.​GUILD_MESSAGES​]​ 
​}​)​;
client.login('token')

flint island
#

like this @forest aurora

forest aurora
#

exactly

tender sentinel
flint island
#

what command do i use for run

#

like node .

high sky
#

remove const bot part you dont need it

forest aurora
tender sentinel
high sky
#

yep

tender sentinel
#

is my code correct

flint island
forest aurora
high sky
#

client is your discord.client with the intents mentioned bot isnt. replace bot.login with client.login

flint island
tender sentinel
forest aurora
#

@flint island show your code man

forest aurora
tender sentinel
#

@flint island can u copy past the code without token

forest aurora
#

can both of @flint island and @tender sentinel send me a friend request

#

i will help out

flint island
#

@forest aurora

forest aurora
#

this way is hard

forest aurora
flint island
#

this is code

forest aurora
#

the full code?

flint island
#

yes

high sky
forest aurora
#

to help you out

flint island
#

done

forest aurora
#

wait

flint island
tender sentinel
#

new error

forest aurora
#
 
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);
high sky
#

invalid token

#

your token isnt valid

forest aurora
#

Its not talking about the 'token'

#

it just mean a syntaxerror

tender sentinel
#

do i just distroy my house

#

i cant stand dis

#

AAAAAAAAAAAH

flint island
forest aurora
#

then ill teach one by one

flint island
tender sentinel
#

wait

#

gtg do smth

#

brb

forest aurora
#

edited it.try again

flint island
forest aurora
#

replace 'token' with your token

flint island
#

ok

forest aurora
#

So still the error?

#

@flint island @tender sentinel whats going on?

tender sentinel
#

yep

#

always

flint island
#

new error

forest aurora
#

not clear what is the error

flint island
#

​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

forest aurora
#

no way there can be an error

flint island
forest aurora
#

show your code, a screenshot

flint island
flint island
forest aurora
#

shame there is a 'syntax error'

flint island
#

h

forest aurora
#

for me

flint island
forest aurora
#

show the whole screen

#

without token

#

if you can

flint island
#

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

forest aurora
forest aurora
#

there cannot be an error

high sky
#

how

flint island
#

NOW THERE IS A NEW ERROR

forest aurora
#

what the

high sky
#

bruh

forest aurora
#

show the whole error

#

did you renamed the folder?

#

Tankred

flint island
flint island
forest aurora
#

this is just getting worse

high sky
#

ikr

#

wth

forest aurora
#

these are very simple errors but this type of errors, only you can fix them

#

that doesn't belong to the code