Bot Crashes After Adding Role To Member

I made sure my discordjs was up to date but still getting this issue
No description
12 Replies
d.js toolkit
d.js toolkit5mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by staff
cable
cable5mo ago
No description
treble/luna
treble/luna5mo ago
do you have the Guilds intent also use interaction.member, no need to get from cache
cable
cable5mo ago
yea ive got the guild intent, tried changing to interaction.member but getting the same issue
treble/luna
treble/luna5mo ago
show your client constructor
cable
cable5mo ago
const {Client, GatewayIntentBits, EmbedBuilder, PermissionsBitField, Permissions, SlashCommandBuilder, Role, Colors} = require('discord.js');
const client = new Client({intents: (
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.MessageContent)});
const {Client, GatewayIntentBits, EmbedBuilder, PermissionsBitField, Permissions, SlashCommandBuilder, Role, Colors} = require('discord.js');
const client = new Client({intents: (
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.MessageContent)});
treble/luna
treble/luna5mo ago
intents is an array
cable
cable5mo ago
oh gotcha, is there an example of how to write the constructor ur able to send? (im new to both js and djs)
treble/luna
treble/luna5mo ago
do you not know what an array is?
cable
cable5mo ago
yeah just not sure what the syntax is in js
treble/luna
treble/luna5mo ago
if so, i recommend learning js first as djs requires a strong djs understanding, #rules 3 #resources
cable
cable5mo ago
alr well just changing the parenthesis to square brackets fixed it so thnx 🫡 yea realistically i prob shd, its just i have a pretty strong understanding of other languages and most of the js tutorials ive seen are aimed at ppl who've never coded before