execute: async ( interaction: ChatInputCommandInteraction<"cached">, title: Title ) => { await interaction.deferReply(); await interaction.followUp(`You requested the ${title} title`); const controller = new AbortController(); const titleRequestResult = await titleQueueManager.requestTitle( title, controller.signal ); if (!titleRequestResult.success) { return interaction.channel?.send("Not success"); } const button: ButtonComponentData = { customId: "add-title-done-button", type: ComponentType.Button, style: ButtonStyle.Primary, label: "Cancel", }; const message = await interaction.channel.send({ content: `${interaction.user}, you received the ${title} title for 30 seconds. Please press "Cancel" when you're finished.`, components: [ { type: ComponentType.ActionRow, components: [button], }, ], }); try { const cancelled = await message.awaitMessageComponent({ filter: () => true, time: 30_000, componentType: ComponentType.Button, }); if (cancelled) { controller.abort(); } } catch { controller.abort(); } finally { await message.edit({ content: message.content, components: [ { type: ComponentType.ActionRow, components: [{ ...button, emoji: "✅", disabled: true }], }, ], }); } };