From 83068ae0859947b995c27a53be7365a3b0803da4 Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Thu, 8 Feb 2024 18:24:47 +0100 Subject: [PATCH] reference channel directly --- commands/admin/custom_vc/slash.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/commands/admin/custom_vc/slash.js b/commands/admin/custom_vc/slash.js index 6b037ab..24df19c 100644 --- a/commands/admin/custom_vc/slash.js +++ b/commands/admin/custom_vc/slash.js @@ -20,11 +20,11 @@ export const data = new SlashCommandBuilder() subcommand .setName('register') .setDescription('Registers an existing voice channel.') - .addStringOption((option) => + .addChannelOption((option) => option - .setName('id') .setRequired(true) - .setDescription('The ID to reference the voice channel to be used.') + .setName('channel') + .setDescription('The voice channel to be used.') ) ); export async function execute(interaction) { @@ -59,11 +59,7 @@ export async function execute(interaction) { } case 'register': { // Get channel id from user input - const id = options.getString('id'); - - step = 'fetch'; - // Try fetching channel by id - await guild.channels.fetch(id); + const id = options.getChannel('channel'); // Save channel data step = 'save';