generated from Baipyrus/DiscordJS-Template
reference channel directly
This commit is contained in:
parent
76641b31c7
commit
83068ae085
@ -20,11 +20,11 @@ export const data = new SlashCommandBuilder()
|
|||||||
subcommand
|
subcommand
|
||||||
.setName('register')
|
.setName('register')
|
||||||
.setDescription('Registers an existing voice channel.')
|
.setDescription('Registers an existing voice channel.')
|
||||||
.addStringOption((option) =>
|
.addChannelOption((option) =>
|
||||||
option
|
option
|
||||||
.setName('id')
|
|
||||||
.setRequired(true)
|
.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) {
|
export async function execute(interaction) {
|
||||||
@ -59,11 +59,7 @@ export async function execute(interaction) {
|
|||||||
}
|
}
|
||||||
case 'register': {
|
case 'register': {
|
||||||
// Get channel id from user input
|
// Get channel id from user input
|
||||||
const id = options.getString('id');
|
const id = options.getChannel('channel');
|
||||||
|
|
||||||
step = 'fetch';
|
|
||||||
// Try fetching channel by id
|
|
||||||
await guild.channels.fetch(id);
|
|
||||||
|
|
||||||
// Save channel data
|
// Save channel data
|
||||||
step = 'save';
|
step = 'save';
|
||||||
|
Loading…
Reference in New Issue
Block a user