From f12b27f9d26717545d448ecc7cf4a8a237a3fc55 Mon Sep 17 00:00:00 2001 From: mattythedev01 Date: Thu, 10 Oct 2024 13:30:12 -0400 Subject: [PATCH] Make a vote command --- src/commands/misc/vote.js | 49 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 src/commands/misc/vote.js diff --git a/src/commands/misc/vote.js b/src/commands/misc/vote.js new file mode 100644 index 0000000..6edbf89 --- /dev/null +++ b/src/commands/misc/vote.js @@ -0,0 +1,49 @@ +const { + SlashCommandBuilder, + EmbedBuilder, + ButtonBuilder, + ActionRowBuilder, + ButtonStyle, +} = require("discord.js"); + +module.exports = { + data: new SlashCommandBuilder() + .setName("vote") + .setDescription("Vote for the bot and get an invite link") + .toJSON(), + userPermissions: [], + botPermissions: [], + + run: async (client, interaction) => { + const voteEmbed = new EmbedBuilder() + .setColor("#FFA500") + .setTitle("🗳️ Vote for Our Bot") + .setDescription( + "Your vote helps us grow! Click the buttons below to vote for our bot or invite it to your server." + ) + .setFooter({ + text: "Thank you for your support!", + iconURL: client.user.displayAvatarURL(), + }) + .setTimestamp(); + + const buttons = new ActionRowBuilder().addComponents( + new ButtonBuilder() + .setLabel("Top.gg") + .setStyle(ButtonStyle.Link) + .setURL("https://top.gg/bot/1292737804530356224"), + new ButtonBuilder() + .setLabel("Invite") + .setStyle(ButtonStyle.Link) + .setURL( + "https://discord.com/oauth2/authorize?client_id=1292737804530356224&scope=bot" + ) + ); + + await interaction.reply({ + embeds: [voteEmbed], + components: [buttons], + ephemeral: false, + }); + }, +};