From 776280769ca0479d624f545e1e3f8d7b4ca8cecd Mon Sep 17 00:00:00 2001 From: Nico Jensen Date: Mon, 24 Jan 2022 15:23:32 +0100 Subject: [PATCH] remove subcommands - make it easy --- src/commands/createVC.js | 41 +++++++++++----------------------------- 1 file changed, 11 insertions(+), 30 deletions(-) diff --git a/src/commands/createVC.js b/src/commands/createVC.js index ffb57b2..19d905a 100644 --- a/src/commands/createVC.js +++ b/src/commands/createVC.js @@ -4,36 +4,17 @@ const {MessageEmbed, Guild} = require('discord.js') module.exports = { data: new SlashCommandBuilder() .setName('vc') - .setDescription('create new voice channel') - .addSubcommand(subCcommand => subCcommand.setName('Create').setDescription('Create new Voice Channel')) - .addSubcommand(subCcommand => subCcommand.setName('Rename').setDescription('Rename Voice Channel')) - .addSubcommand(subCcommand => subCcommand.setName('Delete').setDescription('Delete Voice Channel')), + .setDescription('create new voice channel.'), async execute(interaction) { - switch(interaction.options.getSubcommand()) { - case 'Create': { - const newChannelName = `${interaction.member.displayName}'s Channel` - interaction.guild.channels.create(`${newChannelName}`, { - type: 'GUILD_VOICE', - parent: '589107550520082591', - permissionOverwrites: [{ - id: interaction.member.user, - allow: ['MANAGE_CHANNELS'] - }] - }) - - await Tags.create({ - name: interaction.guild.channels.getId(`${newChannelName}`), - description: 'channelID', - username: interaction.user.username, - }) - break - } - case 'Rename': { - break - } - case 'Delete': { - break - } - } + const newChannelName = `${interaction.member.displayName}'s Channel` + interaction.guild.channels.create(`${newChannelName}`, { + type: 'GUILD_VOICE', + parent: '589107550520082591', + permissionOverwrites: [{ + id: interaction.member.user, + allow: ['MANAGE_CHANNELS'] + }] + }) + interaction.reply("Your channel is created.\nYou have all the rights to modify the channel.\nThe channel is automatically deleted after the last user has left it.") } } \ No newline at end of file