const response = await modalSubmission.reply({ embeds: [pollEmbed], components: [row] });
const collector = response.createMessageComponentCollector({ componentType: ComponentType.Button, time: 15_000 });
collector.on('collect', i => {
if (i.user.id === interaction.user.id) {
i.reply(`${i.user.id} clicked on the ${i.customId} button.`);
} else {
i.reply({ content: `These buttons aren't for you!`, ephemeral: true });
}
});
const response = await modalSubmission.reply({ embeds: [pollEmbed], components: [row] });
const collector = response.createMessageComponentCollector({ componentType: ComponentType.Button, time: 15_000 });
collector.on('collect', i => {
if (i.user.id === interaction.user.id) {
i.reply(`${i.user.id} clicked on the ${i.customId} button.`);
} else {
i.reply({ content: `These buttons aren't for you!`, ephemeral: true });
}
});