#hey I got this err when using client

1 messages ยท Page 1 of 1 (latest)

mossy quiver
#

.

#

Hey, i believe you aren't supposed to be parsing 2 arguments

#

What's the rest of your code?

mossy quiver
timid musk
#

const { Client, Intents } = require('discord.js');

const client = new Client({
intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES, Intents.FLAGS.GUILD_MESSAGE_REACTIONS],
});

client.once('ready', () => {
console.log('Ready!');
});
client.user.setActivity("aT tHe pIzZeRia", {
type: "PLAYING",
});
client.login('');

#

my token is there btw

lost cliff
#

you need to login before setting ur activity

timid musk
#

wdym login?

mossy quiver
#

client.login

#

Put in the ready event

timid musk
#

oh

lost cliff
#

put setactivity in ready event

timid musk
timid musk
#

client.once('ready', () => {
client.login(process.env.DISCORDJS_BOT_TOKEN)
console.log('Ready!');
client.user.setActivity("aT tHe pIzZeRia", {
type: "PLAYING",
});
});

#

like that?

lost cliff
#

that will never happen

mossy quiver
timid musk
#

I thought you meant to the ready code

#

Sorry

timid musk
#

client.login(process.env.DISCORDJS_BOT_TOKEN)
client.user.setActivity("aT tHe pIzZeRia", {
type: "PLAYING",
});

#

like that?

#

๐Ÿ˜…

mossy quiver
#

client.once('ready', () => {
console.log('Ready!');
client.user.setActivity("aT tHe pIzZeRia", {
type: "PLAYING",
});
});

client.login(process.env.DISCORDJS_BOT_TOKEN)

timid musk
#

oh

#

thanks

#

[Symbol(code)]: 'TOKEN_INVALID' lol

mossy quiver
#

Are u using some type of tutorial?

timid musk
#

oh dotnet config right?

mossy quiver
timid musk
#

now it works

mossy quiver
#

Are you new to coding/node.js/discord.js?

timid musk
#

yeah

mossy quiver
#

Then i would probably start with some tutorial

#

It's best to learn some basics of programming first and then start with discord.js

timid musk
#

OK

mossy quiver
#

But you can also just learn the basics while programming with discord.js

timid musk
#

but from where

mossy quiver
#

Let me have a look

#

I havent watched such tutorials in a long timew

#

What language are you speaking mainly?

timid musk
#

hebrew but english will be better\

mossy quiver
#

The perfect place to learn how to make Discord bots using Discord JS v13. In this series we will be diving deep into how Discord JS works, and how to turn your bot ideas into a reality.

In this video we go over how to create your Discord bot, how to setup your own Node.JS project for your bot, and how to get a basic bot up and running.

๐Ÿ’Ž Downl...

โ–ถ Play video