#messageCreate not firing in public channels

1 messages · Page 1 of 1 (latest)

worn coral
#

Hello, would you know why my bot can receive messageCreate events in my staff private channels, but not the public ones?
I only want it to work in a specific public channel but the event doesn't seem to fire, despite the bot having access to that channel and the rights to read messages.

The server is quite large and public (60k members), so that might be the issue but I haven't found anything in the documentation regarding that for the event 😦

frozen cairn
#

if you have the intent, bot is in the guild and has permissions to view channel / read messages in the channel, it receives the event

worn coral
#

i'll try adding all perms to my bot to the channel briefly

#

no, in the permissions the role of the bot is at the top and with every permission for a text channel, and it still doesn't receive the message events

frozen cairn
#

how do you know that the event doesn't emit

worn coral
#

because i log it when i receive something in the messageCreate listener?

i can't tell the event hasn't been sent, only that i don't receive anything. i can only speculate it's because there's too many members 🤷‍♂️

#
const client = new Client({
    intents: [
        GatewayIntentBits.GuildMessages,
        GatewayIntentBits.GuildMessageReactions,
        GatewayIntentBits.MessageContent,
        GatewayIntentBits.GuildPresences
    ],
});

I request these intents, i don't need anything extra right?

frozen cairn
#

Guilds

#

try with that

#

i reckon it should fix your problem

#

also

#

if there would be "too many members", nobody ever would get any messages in such channel

worn coral
#

oh Guild is what i needed, indeed

quite confusing why it worked in staff channels without it though :/
thanks!

worn coral
frozen cairn
#

the content intent is already a verification

#

and the reason as to why adding Guilds worked is that without it discord never sends you guild data when you log in

#

so your bot has no guilds, roles, channels and permissions cached

#

d.js inherently relies on those things being cached, for example (unless that changed recently) channel has to be in cache to have messageCreate emitted for it

#

there might have been something you do in your code that makes the staff channel get cached, which in turn allowed d.js to emit for it