MessageCreate event not firing

Have intents set up any reason why this might not be working?
21 Replies
d.js toolkit
d.js toolkit•8mo 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
alternativeanglez
alternativeanglez•8mo ago
client.on(Events.messageCreate, message => { console.log("Hi"); }); const client = new Client({ intents: [GatewayIntentBits.GuildMessages, GatewayIntentBits.MessageContent, GatewayIntentBits.GuildMembers, GatewayIntentBits.Guilds]})
axiprime2.0
axiprime2.0•8mo ago
You need to enable it in the portal, in your code and register properly to the event.
alternativeanglez
alternativeanglez•8mo ago
They are enabled in portal
axiprime2.0
axiprime2.0•8mo ago
what about your client? which intent you passed?
alternativeanglez
alternativeanglez•8mo ago
No description
alternativeanglez
alternativeanglez•8mo ago
const client = new Client({ intents: [GatewayIntentBits.GuildMessages, GatewayIntentBits.MessageContent, GatewayIntentBits.GuildMembers, GatewayIntentBits.Guilds]})
axiprime2.0
axiprime2.0•8mo ago
what about your client.on for the message create?
alternativeanglez
alternativeanglez•8mo ago
.
axiprime2.0
axiprime2.0•8mo ago
does any other event work other than messageCreate? like ready
alternativeanglez
alternativeanglez•8mo ago
yes onready works and server join I'm using a new account for my bot though maybe that's why?
axiprime2.0
axiprime2.0•8mo ago
It has to be in a server at least
alternativeanglez
alternativeanglez•8mo ago
it is in a server
axiprime2.0
axiprime2.0•8mo ago
sry for the dummy question 😅 i'm trying to cover everything
alternativeanglez
alternativeanglez•8mo ago
np lol
chewie
chewie•8mo ago
are you sure the bot can view the channel you are sending messages in and can view the message history otherwise there isn't really much to go on here
alternativeanglez
alternativeanglez•8mo ago
yes has admin perms
const { Client, GatewayIntentBits, Events, MessageType } = require('discord.js');
const fs = require('node:fs').promises
const client = new Client({ intents: [GatewayIntentBits.GuildMessages, GatewayIntentBits.MessageContent, GatewayIntentBits.GuildMembers, GatewayIntentBits.Guilds]})




client.on(Events.messageCreate, message => {
console.log("Hi");
});
client.on(Events.ClientReady, async clientReady => {
console.log("ready");

})




client.login("")
const { Client, GatewayIntentBits, Events, MessageType } = require('discord.js');
const fs = require('node:fs').promises
const client = new Client({ intents: [GatewayIntentBits.GuildMessages, GatewayIntentBits.MessageContent, GatewayIntentBits.GuildMembers, GatewayIntentBits.Guilds]})




client.on(Events.messageCreate, message => {
console.log("Hi");
});
client.on(Events.ClientReady, async clientReady => {
console.log("ready");

})




client.login("")
only thing I can think of is discord ristricts new accounts from being able to view message content
axiprime2.0
axiprime2.0•8mo ago
Event is MessageCreate not messageCreate you can look in Event from the module 😄
alternativeanglez
alternativeanglez•8mo ago
oh gg LOL
axiprime2.0
axiprime2.0•8mo ago
I took your code in my vscode and I spot it right away ^^
alternativeanglez
alternativeanglez•8mo ago
i didnt get an error thats prob why i didnt spot it thx
Want results from more Discord servers?
Add your server