MessageCreate event not firing

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