My bot seems to not received the event "interactionCreate" from button sent in DM
Hello,
My bot has sent a message to a user with a button but when the user click on the button the bot doesn't receive the
interactionCreate
event and an error is shown under the button on the user's app
Code that send the message
The user correctly receives the message
Handler event
- NodeJS :white_right_arrow: v20.14.0
- DiscordJS :white_right_arrow: 14.15.39 Replies
- 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 OPAnd intents are as follow :
I'm not sure if this affects interactions, but try enabling
Channel
partial (also you are only listening it to it once
, idk if that was intentional)I have the following partials enabled :
partials: [Partials.Message, Partials.Reaction, Partials.GuildMember, Partials.ThreadMember, Partials.Channel]
(also you are only listening it to it once, idk if that was intentional)Yes it was just for testing 😂 I changed it to "on" to avoid people saying "hey it's because you already received an event" (which is not the case)
Intents shouldn't matter with interactions, because it requires none. Idk what could be the issue other than perhaps the listener not being created ig? Where do you create the listener?
Oh wait.... If the user and my bot doesn't share a server in common, my bot can receive interactionCreate events and answer ? Or is it same as messages and it's blocked ?
If they don't share a common server, you wouldn't be able to send a message in the first place
The message is sent and THEN the user is banned/kick from the guild. The button was put to allow the user to contest the sanction later but I think I can't do that 😭
Forgot to answer but the event is created after I've made
new Client(...)
(and before login) and the listener is created because I receive interaction from commandsIdk, that could be the case, haven't encountered this specific situation myself to say for sure. But thinking rationally, if that were the case, buttons sent by user apps wouldn't work either, though there could be a different scenarios for it. Again, this is me just guessing though, i can't say for sure