bot icon indicating copy to clipboard operation
bot copied to clipboard

[BUG] User->Create context menu command fails because the button's custom ID is too long

Open eartharoid opened this issue 1 year ago • 0 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Current Behavior

User->Create worked in testing, but the creation prompt button can't be sent if the action and/or categoryId push the custom ID over the 100-character limit.

 16/10/23 23:53:51  [ERROR] (MENUS) "create" menu execution error: ExpectedConstraintError > s.string.lengthLessThanOrEqual
  Invalid string length

  Expected: expected.length <= 100

  Received:
  | '{"action":"questions","categoryId":1686,"referencesMessage":"1126972889170718753/1163549810507386973"}'

    at Object.run (/home/container/node_modules/.pnpm/@[email protected]/node_modules/@sapphire/shapeshift/dist/index.js:1546:79)
    at /home/container/node_modules/.pnpm/@[email protected]/node_modules/@sapphire/shapeshift/dist/index.js:212:66
    at Array.reduce (<anonymous>)
    at StringValidator.parse (/home/container/node_modules/.pnpm/@[email protected]/node_modules/@sapphire/shapeshift/dist/index.js:212:29)
    at ModalBuilder.setCustomId (/home/container/node_modules/.pnpm/@[email protected]/node_modules/@discordjs/builders/dist/index.js:1342:45)
    at TicketManager.create (/home/container/src/lib/tickets/manager.js:276:7)
    at async CreateMenu.run (/home/container/src/menus/create.js:18:3)

Expected Behavior

No response

Steps To Reproduce

No response

Environment

- OS:
- Node:
- NPM:
- Bot: 4.0.10

Anything else?

The channel ID in referencesMessage probably isn't necessary as the button should always be in the same channel as the message.

eartharoid avatar Oct 17 '23 00:10 eartharoid