I'm trying to add a role when members join the server, but it says I don't have that permission. How do I add all intents/permissions for the bot?
I'll just leave the beginning of the code.
// Require the necessary discord.js classes
const { Client, Intents, Message } = require('discord.js');
const { Player } = require("discord-player");
const { token, prefix } = require("./config.json");
// Create a new client instance
const client = new Client(
{
restTimeOffset: 0,
shards: "auto",
intents: [
Intents.FLAGS.DIRECT_MESSAGES,
Intents.FLAGS.DIRECT_MESSAGE_REACTIONS,
Intents.FLAGS.DIRECT_MESSAGE_TYPING,
Intents.FLAGS.GUILDS,
Intents.FLAGS.GUILD_BANS,
Intents.FLAGS.GUILD_EMOJIS_AND_STICKERS,
Intents.FLAGS.GUILD_INTEGRATIONS,
Intents.FLAGS.GUILD_INVITES,
Intents.FLAGS.GUILD_MEMBERS,
Intents.FLAGS.GUILD_MESSAGES,
Intents.FLAGS.GUILD_MESSAGE_REACTIONS,
Intents.FLAGS.GUILD_MESSAGE_TYPING,
Intents.FLAGS.GUILD_PRESENCES,
Intents.FLAGS.GUILD_SCHEDULED_EVENTS,
Intents.FLAGS.GUILD_VOICE_STATES,
Intents.FLAGS.GUILD_WEBHOOKS,
]
});