0
5
kkhalid35
discord
Discord Js CookbookWhen a Discord client is initialized, it registers an onready event handler which logs in the user as specified in the intents field. The onready event handler then sets the user's activity to the value provided in the activity field.
Shortcut: discord.start
const Discord = require("discord.js")
const client = new Discord.Client({ intents: ["GUILDS", "GUILD_MESSAGES"] })
client.on("ready", () => {
console.log(`Logged in as ${client.user.tag}!`)
client.user.setActivity("##Set your activity here")
})
client.login("Your Bot Token")