aiko-chan-ai / discord.js-selfbot-v13

An unofficial discord.js fork for creating selfbots
https://discordjs-self-v13.netlify.app
GNU General Public License v3.0
751 stars 160 forks source link

Discord API network request error #693

Closed rohangan closed 1 year ago

rohangan commented 1 year ago

Which package has the bugs?

The core library

Issue description

hI, everything was working fine for many months and i didnt make any changes to the code but now it is showing a DISCORDAPIERROR. However it stills works when using the regular discord.js library for a regular discord bot so i assume discord must have done some updates to their api which is why the library is now outputting this error. ERROR BELOW:

 throw new DiscordAPIError(data, res.status, request);
            ^
DiscordAPIError: Invalid Form Body
name: Could not interpret "{'name': 'Text Channels', 'type': 4}" as string.
    at RequestHandler.execute (v13\src\rest\RequestHandler.js:400:13)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async RequestHandler.push (v13\src\rest\RequestHandler.js:61:14)
    at async GuildChannelManager.create (C:\Users\threeacc\Downloads\discord-account-generator\node_modules\discord.js-selfbot-v13\src\managers\GuildChannelManager.js:176:18) {
  method: 'post',
  path: '/
  code: 50035,
  httpStatus: 400,
  captcha: null,
  requestData: {
    json: {
      name: { name: 'Text Channels', type: 4 },
      topic: undefined,
      type: 0,
      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_sort_order: undefined,
      default_forum_layout: undefined
    },
    files: []
  },
  retries: 0
}

Code sample

No response

Package version

i am using latest package 2.14.3

Node.js version

v16.13.0

Operating system

Windows

Priority this issue should have

High (immediate attention needed)

Checklist

Additional Information

No response

aiko-chan-ai commented 1 year ago

you are using code of v14

// v13 (sb, bot)
guild.channels.create('name', { type: 0 })
// v14 (bot)
guild.channels.create({ name: 'name', type: 0 })
aiko-chan-ai commented 1 year ago

image i don't know what you are doing but looking at the error code i know you are passing an object to the first param (name) https://discordjs-self-v13.netlify.app/#/docs/docs/main/class/GuildChannelManager?scrollTo=create

aiko-chan-ai commented 1 year ago
name: Could not interpret "{'name': 'Text Channels', 'type': 4}" as string. < here
    ...
    at async GuildChannelManager.create (C:\Users\threeacc\Downloads\discord-account-generator\node_modules\discord.js-selfbot-v13\src\managers\GuildChannelManager.js:176:18) { < here
  ...
  requestData: {
    json: {
      name: { name: 'Text Channels', type: 4 }, < here
      ...
    },
    files: []
  },
  retries: 0
}
rohangan commented 1 year ago

Thanks, I was able to fix the issue thanks to your solution of downgrading. The downgrading didn’t work first time for me because I did some dumb mistake