#Collection Error

8 messages · Page 1 of 1 (latest)

jagged crystalBOT
#

• What's your exact discord.js npm list discord.js and node node -v version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.

lapis fulcrum
#

Fix this code const { Client, GatewayIntentBits, Discord } = require('discord.js'); to const { Client, GatewayIntentBits, Collection } = require('discord.js'); and fix client.commands = new Discord.Collection(); to client.commands = new Collection();

#

it will work then

#

you have to add const fs = require('node:fs') at the start of the code

#

This will be helpful

#

djs has GatewayIntentBits.MessageContent intent for that

lapis fulcrum
#

client.on('message', message =>{ this code has to be changed to client.on('messageCreate', message =>{