From 7d107a873806854cc40119cc568e51f93e996c98 Mon Sep 17 00:00:00 2001 From: Minzkraut Date: Wed, 13 Apr 2022 17:59:57 +0200 Subject: [PATCH] Add debug commands --- commands/debugInteraction.js | 18 ++++++++++++++++++ commands/testFeatures.js | 29 +++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 commands/debugInteraction.js create mode 100644 commands/testFeatures.js diff --git a/commands/debugInteraction.js b/commands/debugInteraction.js new file mode 100644 index 0000000..d12cdc3 --- /dev/null +++ b/commands/debugInteraction.js @@ -0,0 +1,18 @@ +const { SlashCommandBuilder } = require("@discordjs/builders"); +const Discord = require("discord.js"); + +module.exports = { + data: new SlashCommandBuilder() + .setName("debuginteraction") + .setDescription("Console log interaction") + .addStringOption((option) => + option + .setName("message") + .setDescription("Thy message") + .setRequired(true) + ), + async execute(interaction) { + console.log(interaction); + await interaction.reply("Check logs"); + } +} \ No newline at end of file diff --git a/commands/testFeatures.js b/commands/testFeatures.js new file mode 100644 index 0000000..9774f05 --- /dev/null +++ b/commands/testFeatures.js @@ -0,0 +1,29 @@ +const { SlashCommandBuilder } = require("@discordjs/builders"); +const Discord = require("discord.js"); + +module.exports = { + data: new SlashCommandBuilder() + .setName("testfeatures") + .setDescription("Generate test embed") + .addStringOption((option) => + option + .setName("message") + .setDescription("Thy message") + .setRequired(true) + ), + async execute(interaction) { + const testEmbed = new Discord.MessageEmbed() + .setColor("#FFFFFF") + .setTitle("Test Embed") + .setDescription(`Your test message: ${interaction.options.getString('message')}`) + .setImage(interaction.user.avatarURL({dynamic : true})) + + const testRow = new Discord.MessageActionRow().addComponents( + new Discord.MessageButton() + .setCustomId('testButton') + .setLabel('Hello, this is buton') + .setStyle('DANGER') + ); + await interaction.reply({embeds: [testEmbed], components: [testRow] }); + } +} \ No newline at end of file