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

await user.send({
            embeds: [
                {
                    description: `Vous venez d'être banni du serveur **${guild.name}**.\n\n`
                        + `**Raison** : ${ctx.data.reason}\n`
                        + `**Durée** : ${ctx.data.durationInSec > 0 ? formatDuration(ctx.data.durationInSec, "seconds") : "Infini"}`,
                    color: COLOR_RED
                }
            ],
            components: [{
                type: ComponentType.ActionRow,
                components: [
                    {
                        type: ComponentType.Button,
                        style: ButtonStyle.Primary,
                        label: "Contester / Demander un débanissement",
                        custom_id: "contest_sanction"
                    }
                ]
            }]
        })

The user correctly receives the message

Handler event

// Code from guide
client.on(Events.InteractionCreate, readyClient => {
     console.log("hey")
});


- NodeJS :white_right_arrow: v20.14.0
- DiscordJS :white_right_arrow: 14.15.3
Was this page helpful?