From 24c120a89022a80c34408dcffe39bc00a350e6c3 Mon Sep 17 00:00:00 2001 From: mightypanders Date: Fri, 9 Jun 2023 16:16:23 +0200 Subject: [PATCH] add /guides interaction with buttons --- server/commands/guides.ts | 41 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 server/commands/guides.ts diff --git a/server/commands/guides.ts b/server/commands/guides.ts new file mode 100644 index 0000000..fcb5a25 --- /dev/null +++ b/server/commands/guides.ts @@ -0,0 +1,41 @@ + +import { Command } from '../structures/command' +import { RunOptions } from '../types/commandTypes' +import { APIEmbed, ActionRowBuilder, ButtonBuilder, ButtonStyle } from 'discord.js' +import { v4 as uuid } from 'uuid' +import { logger } from '../logger' + +export default new Command({ + name: 'guides', + description: 'Bekomme eine Auswahl von Guides per DM', + options: [], + run: async (interaction: RunOptions) => { + const requestId = uuid() + const guildId = interaction.interaction.guild?.id + logger.info(`Starting guides interaction for user ${interaction.interaction.user.id}`, { requestId, guildId }) + + const mediaPlayerGuideButton = new ButtonBuilder() + .setCustomId('jfmpGuide') + .setLabel('Media Player Einrichtung') + .setStyle(ButtonStyle.Primary) + + const accountSetup = new ButtonBuilder() + .setCustomId('accountGuid') + .setLabel('Account Anlage') + .setStyle(ButtonStyle.Primary) + + + const row = new ActionRowBuilder() + .addComponents(mediaPlayerGuideButton, accountSetup) + + //const userDMchannel = await interaction.interaction.user.createDM() + interaction.interaction.followUp({ + content: `Hier ist eine Auswahl von Guides.`, + components: [row] + }) + //userDMchannel.send({ + // content: `Hier ist eine Auswahl von Guides.`, + // components: [row] + //}) + } +})