From 688e91dec1821f48198ae14ea62004fe23801ecb Mon Sep 17 00:00:00 2001 From: Taken Date: Sun, 19 Mar 2023 14:29:59 +0100 Subject: [PATCH] Adding sendstaffapplication command --- commands/config.js | 94 ++++++++++++++++------------------------------ 1 file changed, 32 insertions(+), 62 deletions(-) diff --git a/commands/config.js b/commands/config.js index f93f0c1..7b35c4e 100644 --- a/commands/config.js +++ b/commands/config.js @@ -1,6 +1,5 @@ const { SlashCommandBuilder, PermissionFlagsBits, ButtonBuilder, ActionRowBuilder, ButtonStyle, EmbedBuilder, WebhookClient } = require('discord.js'); const { color } = require('../config/options.json'); -const guildInfo = "https://discord.com/api/webhooks/1085959273202327592/oz2k_poWnLbuAB8JZ0K_Sl8WaD2Hv3kUvTMSHZKVZNPED-kL1YU2hHJpOcRHa4RaHP8V" module.exports = { name: 'config', @@ -50,14 +49,44 @@ module.exports = { const subcommand = interaction.options.getSubcommand(); const embedColor = Number(color.replace("#", "0x")); - if (subcommand === 'sendapplication') { + if (subcommand === 'sendguildapplication') { + + const channel = interaction.options.getChannel('channel'); + + await channel.send({ + embeds: [{ + title: 'Guild Application', + description: "You can apply for the staff team by clicking the button below.", + color: embedColor, + footer: { + text: interaction.guild.name + " | Developed by @Taken#0002", + iconURL: interaction.guild.iconURL({ dynamic: true }) + }, + thumbnail: { + url: interaction.guild.iconURL({ dynamic: true }) + } + }], + components: [ + new ActionRowBuilder().addComponents( + new ButtonBuilder() + .setCustomId('guildapply') + .setLabel('Apply') + .setStyle(ButtonStyle.Primary) + .setEmoji({ name: '✅' }) + ) + ] + }) + await interaction.reply({ content: 'Message sent', ephemeral: true }) + } + + if (subcommand === 'sendstaffapplication') { const channel = interaction.options.getChannel('channel'); await channel.send({ embeds: [{ title: 'Staff Application', - description: "You can apply for the staff team by clicking the button below.", + description: "You can apply for the guild by clicking the button below.", color: embedColor, footer: { text: interaction.guild.name + " | Developed by @Taken#0002", @@ -79,65 +108,6 @@ module.exports = { }) await interaction.reply({ content: 'Message sent', ephemeral: true }) - - } - - if (subcommand === 'sendstaffapplication') { - - const channel = interaction.options.getChannel('channel'); - - await channel.send({ - embeds: [{ - title: 'Guild Application', - description: "You can apply for the guild by clicking the button below.", - color: embedColor, - footer: { - text: interaction.guild.name + " | Developed by @Taken#0002", - iconURL: interaction.guild.iconURL({ dynamic: true }) - }, - thumbnail: { - url: interaction.guild.iconURL({ dynamic: true }) - } - }], - components: [ - new ActionRowBuilder().addComponents( - new ButtonBuilder() - .setCustomId('guildapply') - .setLabel('Apply') - .setStyle(ButtonStyle.Primary) - .setEmoji({ name: '✅' }) - ) - ] - }) - - await interaction.reply({ content: 'Message sent', ephemeral: true }) - } - - if (subcommand === "sendguildinfo") { - - await interaction.deferReply({ ephemeral: true }); - - const webhookCient = new WebhookClient({ url: guildInfo }); - - await webhookCient.send({ - content: 'Guild Info', - username: guild.name, - avatarURL: guild.iconURL({ dynamic: true }), - embeds: [{ - title: 'Guild Info', - description: 'This is the guild info message.', - color: embedColor, - footer: { - text: interaction.guild.name + " | Developed by @Taken#0002", - iconURL: interaction.guild.iconURL({ dynamic: true }) - }, - thumbnail: { - url: interaction.guild.iconURL({ dynamic: true }) - } - }] - }); - - await interaction.editReply({ content: 'Message sent', ephemeral: true }); } } }; \ No newline at end of file