const feedbackButton = new ButtonBuilder()
.setCustomId("Feedback")
.setLabel("Give Feedback")
.setStyle(ButtonStyle.Primary);
message = await confirmation.update({
embeds: [embed],
components: [
new ActionRowBuilder().addComponents(feedbackButton),
],
});
try {
// Wait for feedback
confirmation = await message.awaitMessageComponent({
filter: collectorFilter,
time: 600_000,
});
const modal = new ModalBuilder()
.setCustomId("feedback")
.setTitle("Give some Feedback!");
// add some input components
try {
await confirmation.showModal(modal);
confirmation = await confirmation.awaitModalSubmit({
time: 300_000,
});
const feedback =
confirmation.fields.getTextInputValue("fbInput");
embed.description =
embed.description + `\nFeedback: ${feedback}`;
return confirmation.update({
embeds: [embed],
components: [],
});
} catch (e) {
// timeout, remove button
return confirmation.editReply({
components: [],
});
}
} catch (e) {
// timeout, remove button
return message.edit({
components: [],
});
}
const feedbackButton = new ButtonBuilder()
.setCustomId("Feedback")
.setLabel("Give Feedback")
.setStyle(ButtonStyle.Primary);
message = await confirmation.update({
embeds: [embed],
components: [
new ActionRowBuilder().addComponents(feedbackButton),
],
});
try {
// Wait for feedback
confirmation = await message.awaitMessageComponent({
filter: collectorFilter,
time: 600_000,
});
const modal = new ModalBuilder()
.setCustomId("feedback")
.setTitle("Give some Feedback!");
// add some input components
try {
await confirmation.showModal(modal);
confirmation = await confirmation.awaitModalSubmit({
time: 300_000,
});
const feedback =
confirmation.fields.getTextInputValue("fbInput");
embed.description =
embed.description + `\nFeedback: ${feedback}`;
return confirmation.update({
embeds: [embed],
components: [],
});
} catch (e) {
// timeout, remove button
return confirmation.editReply({
components: [],
});
}
} catch (e) {
// timeout, remove button
return message.edit({
components: [],
});
}