Modified Gorb Slash Command to Allow for Types

imgbot
KieranRobson 2022-06-27 11:21:13 +01:00
parent 304b23523c
commit 3292920fce
1 changed files with 44 additions and 4 deletions

View File

@ -1,9 +1,22 @@
const { Client, CommandInteraction } = require("discord.js"); const { Client, CommandInteraction } = require("discord.js");
const { SlashCommandBuilder } = require('@discordjs/builders');
module.exports = { module.exports = {
name: "gorb", ...new SlashCommandBuilder()
description: "returns gorb", .setName('gorb')
type: 'CHAT_INPUT', .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 * @param {Client} client
@ -11,6 +24,33 @@ module.exports = {
* @param {String[]} args * @param {String[]} args
*/ */
run: async (client, interaction, 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'] })
}
}, },
}; };