ava-cassiopeia / discord-text-adventure-bot

A bot for Discord to play text adventure games in Discord
ISC License
45 stars 7 forks source link

DiscordAPIError: Invalid Form Body content: Must be 2000 or fewer in length. #53

Open xandramax opened 2 years ago

xandramax commented 2 years ago

Zork Zero crashes the bot at move 6 with the following console output:

discord-frotz\node_modules\discord.js\src\rest\RequestHandler.js:154
      throw new DiscordAPIError(request.path, data, request.method, res.status);
            ^

DiscordAPIError: Invalid Form Body
content: Must be 2000 or fewer in length.
    at RequestHandler.execute (C:\msys64\home\exander\Development\frotzbot\node-v16.13.0-win-x64\node_modules\discord-frotz\node_modules\discord.js\src\rest\RequestHandler.js:154:13)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async RequestHandler.push (C:\msys64\home\exander\Development\frotzbot\node-v16.13.0-win-x64\node_modules\discord-frotz\node_modules\discord.js\src\rest\RequestHandler.js:39:14) {
  method: 'post',
  path: '/channels/910621836138676234/messages',
  code: 50035,
  httpStatus: 400
}
ava-cassiopeia commented 2 years ago

Ah this seems to be a case in which the bot is running up against the discord character limit for a single message. The obvious solution is to just split up messages that are too large, but that does potentially make formatting tricky. I'll look into this a little more when I can.