We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
code fragment sent by Kevin Kumar#4660
export default async function ( interaction: CommandInteraction | ButtonInteraction | SelectMenuInteraction | Message, frage: InteractionReplyOptions, onConfirm?: (i: ButtonInteraction) => void, customJa?: string ) { const uniqueId = nanoid(); if (!interaction) return console.log("error" + "🚀 No interaction found in confirm"); const ja = new MessageButton() .setCustomId(uniqueId) .setLabel(customJa ?? "Ja") .setStyle("SUCCESS"); if (interaction instanceof Message) { interaction.reply({ ...frage, components: [new MessageActionRow().addComponents([ja])], }); } else { interaction.reply({ content: `<@${interaction.user.id}>\n ${frage.content}`, components: [new MessageActionRow().addComponents([ja])], ephemeral: true, ...frage, }); } const collector = interaction.channel.createMessageComponentCollector({ componentType: "BUTTON", time: COLLECTOR_TIME, }); collector.on("collect", async (i: ButtonInteraction) => { if (i.customId == uniqueId) { await onConfirm(i); } }); collector.on("dispose", (i) => { if (collector.collected.size === 0) { i.reply({ content: COLLECTORDISPOSEMESSAGE, ephemeral: true, }); } }); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
code fragment sent by Kevin Kumar#4660
The text was updated successfully, but these errors were encountered: