DM Button not triggering InteractionCreate

Hello, I'm trying to get a button working in DMs, but it does not seem to be even triggering the InteractionCreate event, resulting in Interaction Failed. I know it doesn't because I logged every time the InteractionCreate event's function was run, and it did not log when the button was pressed. However, when I made a test command that sends me a very simple button, that button actually triggers the InteractionCreate event, unlike the one I want to work. I have no idea why it is doing that. Here is the one that isn't working:
const appealButton = new ActionRowBuilder<ButtonBuilder>().addComponents([
new ButtonBuilder()
.setCustomId(`${appealButtonId}-${appealId}`)
.setLabel("Appeal")
.setStyle(ButtonStyle.Primary)
]);
const appealButton = new ActionRowBuilder<ButtonBuilder>().addComponents([
new ButtonBuilder()
.setCustomId(`${appealButtonId}-${appealId}`)
.setLabel("Appeal")
.setStyle(ButtonStyle.Primary)
]);
where the customId is usually something along the lines of banAppealButton-677ce84d-56f3-48b8-9b53-aa51f94003bc. This is less than 100 characters. This is the test button:
await interaction.user.send({
components: [
new ActionRowBuilder<ButtonBuilder>().setComponents(
new ButtonBuilder()
.setCustomId(`test`)
.setLabel("Test")
.setStyle(ButtonStyle.Primary)
)
]
});
await interaction.user.send({
components: [
new ActionRowBuilder<ButtonBuilder>().setComponents(
new ButtonBuilder()
.setCustomId(`test`)
.setLabel("Test")
.setStyle(ButtonStyle.Primary)
)
]
});
sorry if these are badly formatted. I have no idea why this one works but the other one doesn't.
No description
No description
10 Replies
d.js toolkit
d.js toolkit10mo 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!
AlexCdDg
AlexCdDg10mo ago
Is the bot banning the member after sending the DM? Because as far as I know, if a bot does not share servers with a user, it cannot receive interactions from DMs
Tecci
TecciOP10mo ago
wait is that true because if so then that would be the issue
AlexCdDg
AlexCdDg10mo ago
Im pretty sure, yeah
Tecci
TecciOP10mo ago
but wouldn't the DM be kind of a server on its own? idk
AlexCdDg
AlexCdDg10mo ago
Mm, no, have you ever tried DMing a bot you don't share servers with? You will get that clyde message saying the message cannot be sent because you don't share servers And I believe it's kind of the same here
Tecci
TecciOP10mo ago
that's annoying but I'll have to make do if that's the case
AlexCdDg
AlexCdDg10mo ago
You could alternatively send a URL button, or something like that
Tecci
TecciOP10mo ago
yeah I was thinking that that's probably the only way I have no idea where the URL should go though
!        Yizzy
! Yizzy10mo ago
Make it a form get a domain or sum make it a shortcut server.name/appeal And that url shortcuts to appeals Or if ur js making a bot for multiple server make it where they can make their own link send out
Want results from more Discord servers?
Add your server