© 2026 Hedgehog Software, LLC
dailyneko-modal
dailyneko-cancel
const components = [ new ActionRowBuilder<ButtonBuilder>() .addComponents( new ButtonBuilder() .setCustomId("dailyneko-modal") .setLabel("Open Modal") .setStyle(ButtonStyle.Primary), new ButtonBuilder() .setCustomId("dailyneko-done") .setLabel("Done") .setStyle(allDone ? ButtonStyle.Success : ButtonStyle.Secondary) .setDisabled(!allDone), new ButtonBuilder() .setCustomId("dailyneko-cancel") .setLabel("Cancel") .setStyle(ButtonStyle.Danger) ) ]
@ApplyOptions<InteractionHandler.Options>({ interactionHandlerType: InteractionHandlerTypes.Button }) export class DailyNekoButtonsHandler extends InteractionHandler { public parse(interaction: ButtonInteraction): Option<void> { return interaction.customId.startsWith("dailyneko") ? this.some() : this.none(); } public async run(interaction: ButtonInteraction) { const task = interaction.customId.split("-").at(1)!; const data = interaction.message.embeds[0].data; let artist_name = data.fields![0].value!; artist_name = artist_name === "N/A" ? "" : artist_name; let artist_url = data.fields![1].value!; artist_url = artist_url === "N/A" ? "" : artist_url; let source_url = data.fields![2].value!; source_url = source_url === "N/A" ? "" : source_url; let neko_url = data.fields![3].value!; neko_url = neko_url === "N/A" ? "" : neko_url; switch (task) { case "modal": interaction.showModal(dailyNekoModal(artist_name, artist_url, source_url, neko_url)); break case "done": await interaction.deferReply(); const channel = interaction.guild?.channels.cache.get(this.container.config.config.channels.daily_neko) as TextBasedChannel; await sendDailyneko(webhook, channel, artist_name, artist_url, source_url, neko_url); interaction.message.edit({ components: [], content: "Sent daily neko." }); break; case "cancel": interaction.update({ components: [], content: "Cancelled." }) break; } } }
Join the Discord to ask follow-up questions and connect with the community
Sapphire is a next-gen object-oriented Discord.js bot framework.
2,286 Members