Hey i hope is everything okey with you reader i was trying to do a command to my discord bot that when i do /channel1 will create automatic a voice channel call channel1
if (commandName === 'channel1') {
// Your logic for creating a temporary voice channel
const temporaryChannelName = 'Temporary Channel'; // You can customize the channel name
console.log('Temporary Channel Name:', temporaryChannelName);
try {
const channel = await interaction.guild.channels.create(temporaryChannelName, {
type: 'GUILD_VOICE',
name: `${temporaryChannelName}`, // Use template literal for string interpolation
});
// Move the user to the newly created channel
await interaction.member.voice.setChannel(channel);
} catch (error) {
console.error('Error creating temporary channel:', error);
interaction.reply('Unable to create a temporary channel at the moment.');
}
}
});
is giving DiscordAPIError[50035] Invalid body
if you have any aswer to me and help me i will thank you 🙂
when i do /channel1 will create automatic a voice channel call channel1