Eccleria / ewibot

Discord bot for La Quête d'Ewilan server.
3 stars 0 forks source link

check for choice length #331

Open Eccleria opened 1 month ago

Eccleria commented 1 month ago
/home/ewibot/ewibot/node_modules/@sapphire/shapeshift/dist/index.js:1268
    return errors.length === 0 ? Result.ok(finalObject) : Result.err(new CombinedPropertyError(errors));
                                                                     ^

CombinedPropertyError: Received one or more errors
    at ObjectValidator.handleIgnoreStrategy (/home/ewibot/ewibot/node_modules/@sapphire/shapeshift/dist/index.js:1268:70)
    at ObjectValidator.handleStrategy (/home/ewibot/ewibot/node_modules/@sapphire/shapeshift/dist/index.js:1121:47)
    at ObjectValidator.handle (/home/ewibot/ewibot/node_modules/@sapphire/shapeshift/dist/index.js:1221:17)
    at ObjectValidator.parse (/home/ewibot/ewibot/node_modules/@sapphire/shapeshift/dist/index.js:212:88)
    at /home/ewibot/ewibot/node_modules/@discordjs/builders/dist/index.js:937:164
    at Array.map (<anonymous>)
    at StringSelectMenuBuilder.addOptions (/home/ewibot/ewibot/node_modules/@discordjs/builders/dist/index.js:936:28)
    at StringSelectMenuBuilder.addOptions (/home/ewibot/ewibot/node_modules/discord.js/src/structures/StringSelectMenuBuilder.js:49:18)
    at removePollButtonAction (file:///home/ewibot/ewibot/src/commands/polls/pollsButton.js:144:8)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  errors: [
    [
      'label',
      ExpectedConstraintError: Invalid string length
          at Object.run (/home/ewibot/ewibot/node_modules/@sapphire/shapeshift/dist/index.js:1546:79)
          at StringValidator.run (/home/ewibot/ewibot/node_modules/@sapphire/shapeshift/dist/index.js:202:27)
          at runPredicate (/home/ewibot/ewibot/node_modules/@sapphire/shapeshift/dist/index.js:1231:32)
          at ObjectValidator.handleIgnoreStrategy (/home/ewibot/ewibot/node_modules/@sapphire/shapeshift/dist/index.js:1241:9)
          at ObjectValidator.handleStrategy (/home/ewibot/ewibot/node_modules/@sapphire/shapeshift/dist/index.js:1121:47)
          at ObjectValidator.handle (/home/ewibot/ewibot/node_modules/@sapphire/shapeshift/dist/index.js:1221:17)
          at ObjectValidator.parse (/home/ewibot/ewibot/node_modules/@sapphire/shapeshift/dist/index.js:212:88)
          at /home/ewibot/ewibot/node_modules/@discordjs/builders/dist/index.js:937:164
          at Array.map (<anonymous>)
          at StringSelectMenuBuilder.addOptions (/home/ewibot/ewibot/node_modules/@discordjs/builders/dist/index.js:936:28) {
        constraint: 's.string.lengthLessThanOrEqual',
        given: "🔭  Une lunette qui permet de voir le passé des gens qu'on regarde ... de voler ses données personnelles en d'autres termes",
        expected: 'expected.length <= 100'
      }
    ]
  ]
}
Eccleria commented 1 month ago

This check will fix an issue that might happen at others steps with the 100 char length constraint.