#50035 When calling create voice channel function
28 messages · Page 1 of 1 (latest)
• What's your exact discord.js npm list discord.js and node node -v version?
- [email protected]
- node -v = 18.12.1
• Post the full error stack trace, not just the top part :
DiscordAPIError[50035]: Invalid Form Body
name[BASE_TYPE_REQUIRED]: This field is required
at handleErrors (/home/runner/Matchmake/node_modules/@discordjs/rest/dist/index.js:640:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async SequentialHandler.runRequest (/home/runner/Matchmake/node_modules/@discordjs/rest/dist/index.js:1021:23)
at async SequentialHandler.queueRequest (/home/runner/Matchmake/node_modules/@discordjs/rest/dist/index.js:862:14)
at async REST.request (/home/runner/Matchmake/node_modules/@discordjs/rest/dist/index.js:1387:22)
at async GuildChannelManager.create (/home/runner/Matchmake/node_modules/discord.js/src/managers/GuildChannelManager.js:170:18)
Emitted 'error' event on Client instance at:
at emitUnhandledRejectionOrErr (node:events:394:10) {
requestBody: {
files: undefined,
json: {
name: undefined,
topic: undefined,
type: undefined,
nsfw: undefined,
bitrate: undefined,
user_limit: undefined,
parent_id: undefined,
position: undefined,
permission_overwrites: undefined,
rate_limit_per_user: undefined,
rtc_region: undefined,
video_quality_mode: undefined,
available_tags: undefined,
default_reaction_emoji: undefined,
default_auto_archive_duration: undefined,
default_sort_order: undefined,
default_forum_layout: undefined
}
},
rawError: {
code: 50035,
errors: {
name: {
_errors: [
{
code: 'BASE_TYPE_REQUIRED',
message: 'This field is required'
}
]
}
},
message: 'Invalid Form Body'
},
code: 50035,
status: 400,
method: 'POST',
url: 'https://discord.com/api/v10/guilds/xxxxxxxxxxxxx/channels'
}
• Explain what exactly your issue is.
- When calling the bot to create the voice channels the discord api error
Code :
ok I hope this is the proper category
can anyone shed some light on this
not sure why you closed and created an exact duplicate of this post when you were answered in the first one
#1104666246676492308
you said "it seems im in the wrong channel"
so i made a new one'
so then in this situation which am I changing, because I have quite a few calls for voice channel creation
const teamName = Team ${i + 1};
const channel = await category.guild.channels.create(teamName, {
This ?
or this :
// Create voice channels for each team and store them in an array
const category = await interaction.guild.channels.create('matchmaking', {
type: 'GUILD_CATEGORY',
permissionOverwrites: [
{
id: interaction.guild.roles.everyone.id,
deny: ['VIEW_CHANNEL'],
},
],
});
in the same channel?
yes, all of them are an issue
the method isn't gonna accept different parameters every time you call it
Ok is there a better method on the docs I can use ?
I feel like I’ve been at this for a few days
it's not the method that's the issue
you're using the correct method
your params are wrong
in v14, <GuildChannelManager>.create() takes a single object param with a name option, not a string and an object
GuildChannelManager#create()
Creates a new channel in the guild.
you should also take note of how the example passes a type and its permissionOverwrites
Oh I see that now. This is what I needed.
I’ll rework the code and update this channel with my success or further questions. Appreciate the help!
you should also take note of how the example passes a type and its permissionOverwrites
Yes everything now works as intended thanks for the help.