Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polls - fix multiple issues #240

Closed
Eccleria opened this issue Aug 7, 2023 · 2 comments · Fixed by #254
Closed

Polls - fix multiple issues #240

Eccleria opened this issue Aug 7, 2023 · 2 comments · Fixed by #254
Assignees
Labels
bug Fatal issue invalid Not fatal issue
Milestone

Comments

@Eccleria
Copy link
Owner

Eccleria commented Aug 7, 2023

file:///home/ewibot/ewibot/src/commands/polls/pollsCollectors.js:34
  for (const interaction of clientData.votes)
                                       ^

TypeError: Cannot read properties of undefined (reading 'votes')
    at Timeout.pollBufferLoop [as _onTimeout] (file:///home/ewibot/ewibot/src/commands/polls/pollsCollectors.js:34:40)
    at listOnTimeout (node:internal/timers:561:11)
    at processTimers (node:internal/timers:502:7)
components[0].components[2].emoji.name: Invalid emoji
    at RequestHandler.execute (/home/ewibot/ewibot/node_modules/discord.js/src/rest/RequestHandler.js:350:13)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async RequestHandler.push (/home/ewibot/ewibot/node_modules/discord.js/src/rest/RequestHandler.js:51:14)
    at async MessageManager.edit (/home/ewibot/ewibot/node_modules/discord.js/src/managers/MessageManager.js:132:15) {
  method: 'patch',
  path: '/channels/822132004581408828/messages/1136719598297829486',
  code: 50035,
  httpStatus: 400,
  requestData: {
    json: {
      content: undefined,
      tts: false,
      nonce: undefined,
      embeds: [
        {
          title: 'Ecclé est-il un génial développeur ?',
          type: 'rich',
          description: "un sondage qu'il est important",
          url: null,
          timestamp: 2023-08-03T17:57:51.313Z,
          color: 1146986,
          fields: [ [Object], [Object], [Object] ],
          thumbnail: null,
          image: null,
          author: null,
          footer: { text: 'Vote unique | ⚙️ options', icon_url: undefined }
        }
      ],
      components: [
        {
          components: [ [Object], [Object], [Object], [Object] ],
          type: 1
        }
      ],
      username: undefined,
      avatar_url: undefined,
      allowed_mentions: undefined,
      flags: 0,
      message_reference: undefined,
      attachments: undefined,
      sticker_ids: undefined,
      thread_name: undefined
    },
    files: []
  }
}
file:///home/ewibot/ewibot/src/commands/polls/pollsUtils.js:110
  const values = dbPoll.votes.map((obj) => obj.votes.length);
                        ^

TypeError: Cannot read properties of undefined (reading 'votes')
    at refreshPollFields (file:///home/ewibot/ewibot/src/commands/polls/pollsUtils.js:110:25)
    at stopPoll (file:///home/ewibot/ewibot/src/commands/polls/pollsUtils.js:175:21)
    at stopPollButtonAction (file:///home/ewibot/ewibot/src/commands/polls/pollsButton.js:80:9)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
@Eccleria Eccleria added bug Fatal issue invalid Not fatal issue labels Aug 7, 2023
@Eccleria Eccleria self-assigned this Aug 7, 2023
@Eccleria Eccleria added this to the 6.0.0 milestone Sep 20, 2023
@Eccleria Eccleria linked a pull request Sep 20, 2023 that will close this issue
@Eccleria
Copy link
Owner Author

Eccleria commented Oct 1, 2023

polls command
/home/ewibot/ewibot/node_modules/discord.js/src/rest/RequestHandler.js:350
      throw new DiscordAPIError(data, res.status, request);
            ^

DiscordAPIError: Invalid Form Body
components[0].components[0].options[2].label: Must be between 1 and 100 in length.
    at RequestHandler.execute (/home/ewibot/ewibot/node_modules/discord.js/src/rest/RequestHandler.js:350:13)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async RequestHandler.push (/home/ewibot/ewibot/node_modules/discord.js/src/rest/RequestHandler.js:51:14)
    at async InteractionWebhook.editMessage (/home/ewibot/ewibot/node_modules/discord.js/src/structures/Webhook.js:327:15)
    at async ButtonInteraction.editReply (/home/ewibot/ewibot/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:150:21)
    at async interactionEditReply (file:///home/ewibot/ewibot/src/commands/polls/pollsUtils.js:63:5) {
  method: 'patch',
  path: '/webhooks/926909518963695737/aW50ZXJhY3Rpb246MTE1Nzk3ODc0MTA5MjQwMTE3MzpMOUhDTnNjcVVWUzFZMW1kMGpZaHI3SEdscklGV2tUaGpEZlY5MDN4cHlpNVNad2tQSGw5TGdZZWpabUMzRk9BTzRyR0RHd3ZZV2hsOFZBZmpjcjBSZnRLVzZlcGI3eEJrWnRkMFNsMjZDY3RwU0dSZmFPb09mMHZMRzB4SzN3Vw/messages/@original',
  code: 50035,
  httpStatus: 400,
  requestData: {
    json: {
      content: undefined,
      tts: false,
      nonce: undefined,
      embeds: undefined,
      components: [ { components: [ [Object] ], type: 1 } ],
      username: undefined,
      avatar_url: undefined,
      allowed_mentions: undefined,
      flags: 64,
      message_reference: undefined,
      attachments: undefined,
      sticker_ids: undefined,
      thread_name: undefined
    },
    files: []
  }
}

@Eccleria
Copy link
Owner Author

Eccleria commented Oct 1, 2023

polls command
/home/ewibot/ewibot/node_modules/discord.js/src/rest/RequestHandler.js:350
      throw new DiscordAPIError(data, res.status, request);
            ^

DiscordAPIError: Invalid Form Body
components[0].components[0].options[2].label: Must be between 1 and 100 in length.
    at RequestHandler.execute (/home/ewibot/ewibot/node_modules/discord.js/src/rest/RequestHandler.js:350:13)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async RequestHandler.push (/home/ewibot/ewibot/node_modules/discord.js/src/rest/RequestHandler.js:51:14)
    at async InteractionWebhook.editMessage (/home/ewibot/ewibot/node_modules/discord.js/src/structures/Webhook.js:327:15)
    at async ButtonInteraction.editReply (/home/ewibot/ewibot/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:150:21)
    at async interactionEditReply (file:///home/ewibot/ewibot/src/commands/polls/pollsUtils.js:63:5) {
  method: 'patch',
  path: '/webhooks/926909518963695737/aW50ZXJhY3Rpb246MTE1Nzk3ODc0MTA5MjQwMTE3MzpMOUhDTnNjcVVWUzFZMW1kMGpZaHI3SEdscklGV2tUaGpEZlY5MDN4cHlpNVNad2tQSGw5TGdZZWpabUMzRk9BTzRyR0RHd3ZZV2hsOFZBZmpjcjBSZnRLVzZlcGI3eEJrWnRkMFNsMjZDY3RwU0dSZmFPb09mMHZMRzB4SzN3Vw/messages/@original',
  code: 50035,
  httpStatus: 400,
  requestData: {
    json: {
      content: undefined,
      tts: false,
      nonce: undefined,
      embeds: undefined,
      components: [ { components: [ [Object] ], type: 1 } ],
      username: undefined,
      avatar_url: undefined,
      allowed_mentions: undefined,
      flags: 64,
      message_reference: undefined,
      attachments: undefined,
      sticker_ids: undefined,
      thread_name: undefined
    },
    files: []
  }
}

will be fixed in another PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fatal issue invalid Not fatal issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant