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


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.



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

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


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?