DiscordAPIError[50035] Invalid Form Body - but WHERE

hello, I am coding a setup command for my discord bot, in which it should create a text channel and setpermissions for itself. now i am getting this error:
js[02:07:59]: ERROR running slashCreate: 709832515577184287 | DiscordAPIError[50035]: Invalid Form Body
name[BASE_TYPE_REQUIRED]: This field is required
js[02:07:59]: ERROR running slashCreate: 709832515577184287 | DiscordAPIError[50035]: Invalid Form Body
name[BASE_TYPE_REQUIRED]: This field is required
djs version: 14.6.0 setup.js code: https://hastebin.com/ovojoyemes.typescript error trace:
Trace: DiscordAPIError[50035]: Invalid Form Body
name[BASE_TYPE_REQUIRED]: This field is required
at SequentialHandler.runRequest (D:\Bots\Discord Bots\Lunio\Lunio 2\node_modules\discord.js\node_modules\@discordjs\rest\dist\index.js:659:15)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async SequentialHandler.queueRequest (D:\Bots\Discord Bots\Lunio\Lunio 2\node_modules\discord.js\node_modules\@discordjs\rest\dist\index.js:458:14)
at async REST.request (D:\Bots\Discord Bots\Lunio\Lunio 2\node_modules\discord.js\node_modules\@discordjs\rest\dist\index.js:902:22)
at async GuildChannelManager.create (D:\Bots\Discord Bots\Lunio\Lunio 2\node_modules\discord.js\src\managers\GuildChannelManager.js:151:18)
at async Setup.callback (D:\Bots\Discord Bots\Lunio\Lunio 2\src\commands\Admin\setup.js:89:28)
at async slashCreate.run (D:\Bots\Discord Bots\Lunio\Lunio 2\src\events\custom\slashCreate.js:355:4) {
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
}
},
rawError: {
code: 50035,
errors: { name: [Object] },
message: 'Invalid Form Body'
},
code: 50035,
status: 400,
method: 'POST',
url: 'https://discord.com/api/v10/guilds/709832515577184287/channels'
}
at slashCreate.run (D:\Bots\Discord Bots\Lunio\Lunio 2\src\events\custom\slashCreate.js:357:12)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
Trace: DiscordAPIError[50035]: Invalid Form Body
name[BASE_TYPE_REQUIRED]: This field is required
at SequentialHandler.runRequest (D:\Bots\Discord Bots\Lunio\Lunio 2\node_modules\discord.js\node_modules\@discordjs\rest\dist\index.js:659:15)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async SequentialHandler.queueRequest (D:\Bots\Discord Bots\Lunio\Lunio 2\node_modules\discord.js\node_modules\@discordjs\rest\dist\index.js:458:14)
at async REST.request (D:\Bots\Discord Bots\Lunio\Lunio 2\node_modules\discord.js\node_modules\@discordjs\rest\dist\index.js:902:22)
at async GuildChannelManager.create (D:\Bots\Discord Bots\Lunio\Lunio 2\node_modules\discord.js\src\managers\GuildChannelManager.js:151:18)
at async Setup.callback (D:\Bots\Discord Bots\Lunio\Lunio 2\src\commands\Admin\setup.js:89:28)
at async slashCreate.run (D:\Bots\Discord Bots\Lunio\Lunio 2\src\events\custom\slashCreate.js:355:4) {
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
}
},
rawError: {
code: 50035,
errors: { name: [Object] },
message: 'Invalid Form Body'
},
code: 50035,
status: 400,
method: 'POST',
url: 'https://discord.com/api/v10/guilds/709832515577184287/channels'
}
at slashCreate.run (D:\Bots\Discord Bots\Lunio\Lunio 2\src\events\custom\slashCreate.js:357:12)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
Hastebin: Send and Save Text or Code Snippets for Free | Toptal®
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
6 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
notvexi
notvexi2y ago
slashCreate is an event emitted by my bot if the interaction is a slashCommand :) line 89 I create the channel
duck
duck2y ago
<GuildChannelManager>.create() takes a single object param now the name should be in the options object in the name option as a side note, the type should be a number for which you can use the ChannelType enum
notvexi
notvexi2y ago
ok thank you! ok so i fixed the channel creation stuff. now why wont it send a message in it after the creation? It worked before lol line 143
Trace: TypeError: createdChannel.send is not a function
Trace: TypeError: createdChannel.send is not a function
I updated the send attachment to be in an options object
duck
duck2y ago
when you call createChannel, it looks like you pass createChannel instead of what I imagine was supposed to be createdChannel which is to say you pass the function itself as a param rather than a channel
notvexi
notvexi2y ago
I hate typos thank you so much