From 3292920fcec32cc0e253dd91add1d878f852ccd2 Mon Sep 17 00:00:00 2001 From: KieranRobson Date: Mon, 27 Jun 2022 11:21:13 +0100 Subject: [PATCH] Modified Gorb Slash Command to Allow for Types --- SlashCommands/fun/gorb.js | 48 +++++++++++++++++++++++++++++++++++---- 1 file changed, 44 insertions(+), 4 deletions(-) diff --git a/SlashCommands/fun/gorb.js b/SlashCommands/fun/gorb.js index 42a5f55..7792d78 100644 --- a/SlashCommands/fun/gorb.js +++ b/SlashCommands/fun/gorb.js @@ -1,9 +1,22 @@ const { Client, CommandInteraction } = require("discord.js"); +const { SlashCommandBuilder } = require('@discordjs/builders'); module.exports = { - name: "gorb", - description: "returns gorb", - type: 'CHAT_INPUT', + ...new SlashCommandBuilder() + .setName('gorb') + .setDescription('Gorb') + .addStringOption(option => + option + .setName('type') + .setDescription('The gorb type') + .addChoices( + { name: 'Christmas', value: 'christmas' }, + { name: 'Party', value: 'party' }, + { name: 'Computer Science', value: 'cs' }, + { name: 'Large', value: 'large' }, + { name: 'Storm', value: 'storm' }, + )), + /** * * @param {Client} client @@ -11,6 +24,33 @@ module.exports = { * @param {String[]} args */ run: async (client, interaction, args) => { - interaction.followUp({ files: ['./images/gorb.jpg'] }); + const string = interaction.options.getString('type'); + + if(string == null){ + interaction.followUp({ files: ['./images/gorb.jpg'] }) + } + if(string === 'cs'){ + interaction.followUp({ files: ['./images/gorbcs.jpg'] }) + } + + if(string === 'party'){ + interaction.followUp({ files: ['./images/gorbcelebration.png'] }) + } + + + if(string === 'christmas'){ + interaction.followUp({ files: ['./images/gorbchristmas.png'] }) + } + + if(string === 'storm'){ + interaction.followUp({ files: ['./images/gorbstorm.png'] }) + } + + if(string == 'large'){ + interaction.followUp({ files: ['./images/gorblarge.png'] }) + } + + + }, }; \ No newline at end of file