#hey I got this err when using client
1 messages ยท Page 1 of 1 (latest)
.
Hey, i believe you aren't supposed to be parsing 2 arguments
What's the rest of your code?
Atleast in this scenario
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
you need to login before setting ur activity
wdym login?
oh
put setactivity in ready event
client.once('ready', () => {
client.login(process.env.DISCORDJS_BOT_TOKEN)
console.log('Ready!');
});
OK
client.once('ready', () => {
client.login(process.env.DISCORDJS_BOT_TOKEN)
console.log('Ready!');
client.user.setActivity("aT tHe pIzZeRia", {
type: "PLAYING",
});
});
like that?
that will never happen
Don't put the client.login in the ready event because the event will never be fired
ohhhhhhhhhhhhhhhhhh
I thought you meant to the ready code
Sorry
wait what
client.login(process.env.DISCORDJS_BOT_TOKEN)
client.user.setActivity("aT tHe pIzZeRia", {
type: "PLAYING",
});
like that?
๐
client.once('ready', () => {
console.log('Ready!');
client.user.setActivity("aT tHe pIzZeRia", {
type: "PLAYING",
});
});
client.login(process.env.DISCORDJS_BOT_TOKEN)
same error
Because your token env variable isnt set
Are u using some type of tutorial?
oh dotnet config right?
Yeah
Are you new to coding/node.js/discord.js?
yeah
Then i would probably start with some tutorial
It's best to learn some basics of programming first and then start with discord.js
OK
But you can also just learn the basics while programming with discord.js
but from where
Let me have a look
I havent watched such tutorials in a long timew
What language are you speaking mainly?
hebrew but english will be better\
I think this tutorial isn't that bad: https://www.youtube.com/watch?v=JMmUW4d3Noc&list=PLaxxQQak6D_f4Z5DtQo0b1McgjLVHmE8Q&index=1
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...