diff --git a/command/Utilities/poll.js b/command/Utilities/poll.js index b8a0bee..59f8b68 100644 --- a/command/Utilities/poll.js +++ b/command/Utilities/poll.js @@ -1,119 +1,79 @@ -const { Client, CommandInteraction, MessageEmbed } = require('discord.js'); - +const { MessageEmbed } = require("discord.js"); module.exports = { - name: 'poll', - category: "SUB_COMMAND", - description: 'Creates a poll with many options', - options: [ - { - name: 'create', - description: 'Creates An Interactive Poll', - type: 'SUB_COMMAND', - options: [ - { - name: 'question', - description: 'The question of the poll', - type: 'STRING', - required: true, - }, - { - name: 'choice1', - description: 'Choice 1', - type: 'STRING', - required: true, - }, - { - name: 'choice2', - description: 'Choice 2', - type: 'STRING', - required: true, - }, - { - name: 'choice3', - description: 'Choice 3', - type: 'STRING', - required: false, - }, - { - name: 'choice4', - description: 'Choice 4', - type: 'STRING', - required: false, - }, - { - name: 'choice5', - description: 'Choice 5', - type: 'STRING', - required: false, - }, - { - name: 'choice6', - description: 'Choice 6', - type: 'STRING', - required: false, - }, - ], - }, - ], - /** - * @param {Client} client - * @param {CommandInteraction} interaction - * @param {String[]} args - */ - run: async(client, interaction, args) => { - if (interaction.options.getSubcommand() == 'create') { - const title = interaction.options.getString('question') - const c1 = interaction.options.getString('choice1'); - const c2 = interaction.options.getString('choice2'); - const c3 = interaction.options.getString('choice3'); - const c4 = interaction.options.getString('choice4'); - const c5 = interaction.options.getString('choice5'); - const c6 = interaction.options.getString('choice6'); - const pollCreateEmbed = new MessageEmbed() - .setTitle(`${title}`) - .setColor("RED") - .addFields( - { name: "⠀", value: `🇦 ${c1}`}, - { name: "⠀", value: `🇧 ${c2}`} - ) - .setFooter(`Poll By ${interaction.user.tag}`) - .setTimestamp(); - - - if (interaction.options.getString('choice3')) { - pollCreateEmbed.addFields({ name: "⠀", value: `🇨 ${c3}`}); - } - if (interaction.options.getString('choice4')) { - pollCreateEmbed.addFields({ name: "⠀", value: `🇩 ${c4}`}); - } - if (interaction.options.getString('choice5')) { - pollCreateEmbed.addFields({ name: "⠀", value: `🇪 ${c5}`}); - } - if (interaction.options.getString('choice6')) { - pollCreateEmbed.addFields({ name: "⠀", value: `🇫 ${c6}`}); - } - - embedMessage = await interaction.followUp({ - embeds: [pollCreateEmbed], - //fetchReply: true, - }); - embedMessage.react('🇦'); - embedMessage.react('🇧'); - - if (interaction.options.getString('choice3')) { - embedMessage.react('🇨'); - } - if (interaction.options.getString('choice4')) { - embedMessage.react('🇩'); - } - if (interaction.options.getString('choice5')) { - embedMessage.react('🇪'); - } - if (interaction.options.getString('choice6')) { - embedMessage.react('🇫'); - } - } else { - return; - } + name: "poll", + category: "Utilities", + description: "Creates a poll with many options", + options: [ + { + type: 3, + name: "question", + description: "The question of the poll", + required: true, }, + { + type: 3, + name: "choice1", + description: "Choice 1", + required: true, + }, + { + type: 3, + name: "choice2", + description: "Choice 2", + required: true, + }, + { + type: 3, + name: "choice3", + description: "Choice 3", + required: false, + }, + { + type: 3, + name: "choice4", + description: "Choice 4", + required: false, + }, + { + type: 3, + name: "choice5", + description: "Choice 5", + required: false, + }, + { + type: 3, + name: "choice6", + description: "Choice 6", + required: false, + }, + ], + run: async (client, interaction, args) => { + const pollCreateEmbed = new MessageEmbed() + .setTitle(`📣 **${args[0]}**`) + .setColor("RED") + .setFooter({ + text: `Made by ${client.author}`, + iconURL: client.user.displayAvatarURL(), + }) + .setTimestamp(); + for (let i = 0; i < args.length - 1; i++) { + pollCreateEmbed.addField( + "‎", + `:regional_indicator_${String.fromCharCode(97 + i)}: ${args[i + 1]} + ` + ); + } + let embedMessage = await interaction.followUp({ + embeds: [pollCreateEmbed], + }); + 55356; + for (let i = 0; i < args.length - 1; i++) { + if (i === 0) embedMessage.react("\ud83c\udde6"); + if (i === 1) embedMessage.react("\ud83c\udde7"); + if (i === 2) embedMessage.react("\ud83c\udde8"); + if (i === 3) embedMessage.react("\ud83c\udde9"); + if (i === 4) embedMessage.react("\ud83c\uddea"); + if (i === 5) embedMessage.react("\ud83c\uddeb"); + } + }, }; diff --git a/util/Data/attachments.json b/util/Data/attachments.json index 562761d..dc88b32 100644 --- a/util/Data/attachments.json +++ b/util/Data/attachments.json @@ -1054,7 +1054,7 @@ "RTC Light Muzzle Brake" ], "barrel": [ - "RTC Silencer Barrel", + "YKM Integral Suppressor Light", "MIP Light Extended Barrel", "OWC Marksman" ], @@ -1087,7 +1087,8 @@ "Merc Foregrip", "Operator Foregrip", "Ranger Foregrip", - "Tactical Foregrip A" + "Tactical Foregrip A", + "Bipod" ], "ammo": [ "Extended Mag A",