MessageCreate event not firing

Have intents set up any reason why this might not be working?
21 Replies
d.js toolkit
d.js toolkit10mo 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
alternativeanglezOP10mo 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.010mo ago
You need to enable it in the portal, in your code and register properly to the event.
alternativeanglez
alternativeanglezOP10mo ago
They are enabled in portal
axiprime2.0
axiprime2.010mo ago
what about your client? which intent you passed?
alternativeanglez
alternativeanglezOP10mo ago
No description
alternativeanglez
alternativeanglezOP10mo ago
const client = new Client({ intents: [GatewayIntentBits.GuildMessages, GatewayIntentBits.MessageContent, GatewayIntentBits.GuildMembers, GatewayIntentBits.Guilds]})
axiprime2.0
axiprime2.010mo ago
what about your client.on for the message create?
alternativeanglez
alternativeanglezOP10mo ago
.
axiprime2.0
axiprime2.010mo ago
does any other event work other than messageCreate? like ready
alternativeanglez
alternativeanglezOP10mo ago
yes onready works and server join I'm using a new account for my bot though maybe that's why?
axiprime2.0
axiprime2.010mo ago
It has to be in a server at least
alternativeanglez
alternativeanglezOP10mo ago
it is in a server
axiprime2.0
axiprime2.010mo ago
sry for the dummy question 😅 i'm trying to cover everything
alternativeanglez
alternativeanglezOP10mo ago
np lol
chewie
chewie10mo 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
alternativeanglezOP10mo 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.010mo ago
Event is MessageCreate not messageCreate you can look in Event from the module 😄
alternativeanglez
alternativeanglezOP10mo ago
oh gg LOL
axiprime2.0
axiprime2.010mo ago
I took your code in my vscode and I spot it right away ^^
alternativeanglez
alternativeanglezOP10mo ago
i didnt get an error thats prob why i didnt spot it thx
Want results from more Discord servers?
Add your server