#My bot's buttons isn't working in dms
34 messages · Page 1 of 1 (latest)
Can you share the full code?
No.
Ig that much is enough
Btw its working for 1 user but not for the mentioned user + the user itself
it means the button was disabled
and more code would be nice, since that doesnt provide anything but your send and your collector
not your buttons
The button can be clicked but it don't respond to it
I mean it simply says that This interaction failed
w8
a min
const xyz = new ButtonBuilder()
.setCustomId('xyz')
.setLabel('xyz')
.setStyle(ButtonStyle.Danger)
const row = new ActionRowBuilder()
.addComponents(xyz);
let response = await interaction.user.send({
embeds: [embed],
components: [row]
})
let response2 = await targetUserObj.send({
embeds: [embed],
components: []
})
const collectorFilter = i => i.user.id === interaction.user.id;
const confirmation = await response.awaitMessageComponent({filter: collectorFilter, time: 60000 });
const confirmation2 = await response2.awaitMessageComponent({ filter: collectorFilter, time: 60000 });
if (confirmation.customId === 'xyz') {
await confirmation.update({ embeds: [embed], components: [] });
await confirmation2.update({embeds: [embed], components: [row]})
}
if(confirmation2.customId === 'xyz'){
await confirmation.update({ embeds: [embed], components: [row] });
await confirmation2.update({embeds: [embed], components: []})
}
What I'm trying to do here is
When the person who executed the command clicks the button in his dms then the button will get updated and get removed from his embed but will be visible in the mentioned user's embed
and when that users clicks the button in his dms then it will be visible to the person who executed the command
it's kinda like toggling
@warped gull Do you know why it is not working
??
you have overlapping variables for your row
ok so what i understand is that you have two collectors, one for each message
It doesn't replies to the interaction. It just sends the dm msgs to the person who gets mentioned and the person who executed the command!
One for each user and yea each msg too
What I'm trying to do here is
When the person who executed the command clicks the button in his dms then the button will get updated and get removed from his embed but will be visible in the mentioned user's embed
thats because you put your if statements after those collectors
no, your if statements are after your two collectors