#messageCreate event not firing after adding the interactionCreate event.
1 messages · Page 1 of 1 (latest)
Extra relevant information:
No intent changes between now and the old version.
Client constructor:
const myIntents = new Intents(
Intents.FLAGS.GUILDS,
Intents.FLAGS.GUILD_MESSAGES,
Intents.FLAGS.DIRECT_MESSAGES,
Intents.FLAGS.GUILD_MESSAGE_REACTIONS,
Intents.FLAGS.DIRECT_MESSAGE_REACTIONS
);
const client = new Client({ intents: myIntents, partials: ["CHANNEL"] });
Event code attached.
The console.log('DEBUG') also never triggers, despite the fact in my understanding it should be popping every time a message is sent in a server it is in.
client.once('ready', () => {
// Triggers normally
});
client.on('interactionCreate', async interaction => {
// Triggers normally
});
client.on('messageCreate', async message => {
console.log('DEBUG'); // Never triggered for some reason????
// Other code (Also never triggered)
});
client.on("error", (e) => console.error(e));
client.on("warn", (e) => console.warn(e));
process.on('unhandledRejection', (e) => console.error(e));
console.log(client) // When logging the client, it shows they are attached as expected
client.login(config.token);
do u havemessage content intent in dev portal?
Yes, but that doesn't go into effect until April 30th, so it doesn't affect stuff right now.
you stillneedit rn
No I wouldn't. And again, it is enabled.
does removing the interactionCreate event make messageCreate work?
I don't believe so. Let me test again to be sure.
alright
@cerulean galleon Just made sure, it does not.
As I said in this though, going to my old version on source control makes it work like before.
Any ideas?
What intents does your client have?
See this message (and the messages after it)
Tag suggestion for @sharp edge from @tawdry palm:
Please add the following code to your code base outside of any other event listeners and provide the full log output relevant to your issue.
client
.on("debug", console.log)
.on("warn", console.log)
• Note: if you initialize your Client as bot or other identifiers you need to use these instead of client
• If the output is too long to post consider using a bin instead: gist | hasteb.in | sourceb.in | hastebin
If you'd read the event code snippet you'd know I already have those...
No errors or anything are output. Just the debug statement (and the code after it) is never triggered.
Oh srry idk if it's just me but the picture is blurry and it's hard to see
Would be better as a code block or sourcebin
Yeah that's my probably my bad. Will update it to a code block in a sec
There updated it ^^
@tawdry palm AFK for now, dump whatever you think I should try and I'll ping you when I'm back ^^
@sharp edge the only intent you get is GUILDS
The intents are supposed to be in an array
const myIntents = new Intents([
Intents.FLAGS.GUILDS,
Intents.FLAGS.GUILD_MESSAGES,
Intents.FLAGS.DIRECT_MESSAGES,
Intents.FLAGS.GUILD_MESSAGE_REACTIONS,
Intents.FLAGS.DIRECT_MESSAGE_REACTIONS
]);
I know for a fact that's not the case. My old version uses the exact same way of adding intents, and it all functions normally (including picking up DMs/Guild Messages)
I have the same issue
My /events/messageCreate.js file:
module.exports = (client, message) => {
console.log('test')
};
My index.js file:
/** Registering Events -- Start */
const events = fs
.readdirSync("./events")
.filter((file) => file.endsWith(".js"));
for (const file of events) {
const eventName = file.split(".")[0];
const event = require(`./events/${file}`);
client.on(eventName, event.bind(null, client));
}
/** Registering Events -- End */
message partial?
let client = new Client({
intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES],
partials: ['MESSAGE', 'CHANNEL', 'REACTION']
});
my client
Don't have it. Again though, it worked on the old version, so unless there were breaking changes that somehow didn't get into the patch notes...
I am also confused
(Old version being 13.x.x)
Do you want to make another message in #djs-help-v14? Don't want to make it look like I'm being spammy
Oh that's strange then. Check your email, did Discord send anything about your token being reset?
no, my bot is working
just messageCreate isnt
interactions are as fine as they can be
Huh strange
Welllll looks like it's more or less the same problem I'm having so it might be related
/** Registering Events -- Start */
const events = fs
.readdirSync("./events")
.filter((file) => file.endsWith(".js"));
for (const file of events) {
const eventName = file.split(".")[0];
const event = require(`./events/${file}`);
client.on(eventName, event.bind(null, client));
}
/** Registering Events -- End */
I might me doing something wrong here
but this same was working yesterday
so idk
Have you restarted your bot/made any changes anywhere since it broke?
yes
I did
I removed the code that registered message commands
but that cannot break anything
or shouldnt atleast
If you have git or anything like that, maybe try going back to old version and see if the issue continues?
I do but I dont use git tags
If it doesn't maybe we can both look at the changes we've made and try to find something in common
I can try to revert to an older git commit
yeah, what did you change?
maybe my event handler is broken?
oh wait
One sec my repository is public, I'll grab the commit that broke it
I don't use a event handler and it's still broken. Not sure
My bot didnt have any kind of permissions other than the slash command
like even thought it has message intent
but it didnt have permissions in my server to view specific channels
I could use slash commands but couldnt use the collectors
omg
mine is working now, yay
Good luck man, debugging can be hard at times
Ty
I spent hours yesterday on this, today woke up and instantly figured out the problem.
So my suggestion, take some rest!