Discord Invalid Form Body

(node:260) UnhandledPromiseRejectionWarning: DiscordAPIError: Invalid Form Body

12:32 AM

type: Value “text” is not int.

12:32 AM

at item.request.gen.end (/rbd/pnpm-volume/4bd5d360-9008-486c-9614-f2f640446fc7/node_modules/.registry.npmjs.org/discord.js/11.5.1/node_modules/discord.js/src/client/rest/RequestHandlers/Sequential.js:85:15)

12:32 AM

at then (/rbd/pnpm-volume/4bd5d360-9008-486c-9614-f2f640446fc7/node_modules/.registry.npmjs.org/snekfetch/3.6.4/node_modules/snekfetch/src/index.js:215:21)

12:32 AM

at

12:32 AM

at process._tickCallback (internal/process/next_tick.js:189:7)

12:32 AM

(node:260) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)

12:32 AM

(node:260) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Hi @Wizzixe! Welcome to the Glitch forums! It sounds like you have a form input expecting an integer, but receiving a non-integer value (judging from the name “text”, it might be a string?) This might be at the root of your problems. If your project is public, you could share the project name and I’d be happy to take a look!

@househaunt here is the project https://glitch.com/edit/#!/seraphim-recruit

Oh, tricky. I read through the code but couldn’t find anything that seemed to immediately correlate. Someone who knows more about Discord might be able to help more – I thought maybe those Discord embeds might correlate to the Invalid Form Body referenced in the error, but just by reading I couldn’t find any fields with “text” as an arg, or which seemed to be strongly typed for an integer. :confused:

@househaunt it was working fine 2 days ago and start show this error now :frowning:

When you create a channel with an old version of discord.js, use

guild.createChannel('channel-name', {type: 'text'})

if it’s a text channel.

–Meow

2 Likes

Hello, sorry for necroing an old thread. I am getting the same error when I use both

message.guild.createChannel('channelName', 'text')

and

message.guild.createChannel('channelName', {type: 'text'})

My code worked before, and now it shows the error “DiscordAPIError: Invalid Form Body, type: Value “{u’type’: u’text’}” is not int.” Do you have any solutions?

Hi! i’ll hope ya’all fixed it already… if not, then i hope i can help!

“int” should be a number, not a text.

Int , short for “integer,” is a fundamental variable type built into the compiler and used to define numeric variables holding whole numbers.

we run into the same issue… we used the discord bot maker on steam!
as newbies at programming… we tried to fix that… and we really succ at programming… anyways!!

“Error with Event “Create Voice Channel”, Action #1: DiscordAPIError: Invalid Form Body type: Value “voice” is not int.”

server.createChannel(name, ‘voice’).then(function(channel) {

  • this line… voice, i marked it as Bold… the only solution we found was to replace voice with a 2… problem fixed!

message.guild.createChannel(‘channelName’, {type: ‘1’}) <- try some numbers.

i’’

and sorry for my bad english… if you need more help… Discord: NXZ#0730

1 Like

umm can someone tell me how to fix this hlitch cuz its happening for 4 full days !

I have a problem when i try to create a ticket or play ttt (pls ttt @…) it say invalid form body and i cant fix i don’t know how can sombody help me?