imranbarbhuiya / pagination.djs

A simple yet powerful discord.js embed pagination package.
https://pagination-djs.js.org/
MIT License
18 stars 3 forks source link

Discord.js v14 problem. #43

Closed GillHoang closed 2 years ago

GillHoang commented 2 years ago

Here error:

/Users/admin/Documents/AnBot/node_modules/@discordjs/rest/dist/index.js:744
        throw new DiscordAPIError(data, "code" in data ? data.code : data.error, status, method, url, requestData);
              ^

DiscordAPIError[50035]: Invalid Form Body
data.embeds[0][LIST_ITEM_VALUE_REQUIRED]: List item values of ModelType are required
    at SequentialHandler.runRequest (/Users/admin/Documents/AnBot/node_modules/@discordjs/rest/dist/index.js:744:15)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async SequentialHandler.queueRequest (/Users/admin/Documents/AnBot/node_modules/@discordjs/rest/dist/index.js:556:14)
    at async REST.request (/Users/admin/Documents/AnBot/node_modules/@discordjs/rest/dist/index.js:990:22)
    at async ChatInputCommandInteraction.reply (/Users/admin/Documents/AnBot/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:110:5)
    at async Pagination.reply (/Users/admin/Documents/AnBot/node_modules/pagination.djs/dist/index.js:497:21) {
  rawError: {
    code: 50035,
    errors: {
      data: { embeds: { '0': { _errors: [Array] } } }
    },
    message: 'Invalid Form Body'
  },
  code: 50035,
  status: 400,
  method: 'POST',
  url: 'https://discord.com/api/v10/interactions/998100034346307694/aW50ZXJhY3Rpb246OTk4MTAwMDM0MzQ2MzA3Njk0OmJIVDgzVU1ubFpMeXhRRTJ5ZkRzZkRuVzAwTkRWbnY2V3FzUXl3TXhQT2g2SDVDcTZHZkRMeWE2TnV1VHpBTzNUaFVka29CT05vdlFNNjNTZHhjNXV5ZzFwVFFOdVdWYXZMQjd2RU9QSEROSkJxdWtNTjU3OHFLYzRkd1RxVjdj/callback',
  requestBody: {
    files: [],
    json: {
      type: 4,
      data: {
        content: '',
        tts: false,
        nonce: undefined,
        embeds: [ {} ],
        components: [ { type: 1, components: [Array] } ],
        username: undefined,
        avatar_url: undefined,
        allowed_mentions: undefined,
        flags: undefined,
        message_reference: undefined,
        attachments: [],
        sticker_ids: undefined
      }
    }
  }
}

When i use:

        const pagination = new Pagination(interaction);
        pagination.setDescriptions(servers) // servers is a array
        pagination.render();
imranbarbhuiya commented 2 years ago

the stable release isn't v14 compatible. Use https://github.com/imranbarbhuiya/pagination.djs/pull/23 pr by using

npm install pagination.djs@pr-23
# or for yarn
yarn add pagination.djs@pr-23
GillHoang commented 2 years ago

the stable release isn't v14 compatible. Use #23 pr by using

npm install pagination.djs@pr-23
# or for yarn
yarn add pagination.djs@pr-23

yep i use this, but get same problem Screen Shot 2022-07-17 at 1 30 13 PM

imranbarbhuiya commented 2 years ago

Can you update to the latest version and see if it fixes your issue. The version is pagination.djs@3.6.1-pr-23.f0e3057.0

GillHoang commented 2 years ago

Can you update to the latest version and see if it fixes your issue. The version is pagination.djs@3.6.1-pr-23.f0e3057.0 Screen Shot 2022-07-17 at 3 07 22 PM Screen Shot 2022-07-17 at 3 08 18 PM

GillHoang commented 2 years ago

all is here

imranbarbhuiya commented 2 years ago

I'll try to reproduce the issue today and will update

GillHoang commented 2 years ago

I'll try to reproduce the issue today and will update

tks :>

imranbarbhuiya commented 2 years ago

This should be fixed in the latest version. Try updating