Describe the bug
When creating an NPC, after confirmation, it fails.
In src/hungryGames.js:3617 of the 2022 unstable branch, embed.setDescription('') is called to clear to embed's description, which isn't allowed and creates a validation error:
Received one or more errors
1 ExpectedValidationError > s.literal(V)
| Expected values to be equals
|
| Expected:
| | null
|
| Received:
| | ''
2 ExpectedConstraintError > s.string.lengthGreaterThanOrEqual
| Invalid string length
|
| Expected: expected.length >= 1
|
| Received:
| | ''
at UnionValidator.handle (/home/$USER/SpikeyBot-Discord/node_modules/@sapphire/shapeshift/dist/index.js:1085:23)
at UnionValidator.parse (/home/$USER/SpikeyBot-Discord/node_modules/@sapphire/shapeshift/dist/index.js:142:88)
at EmbedBuilder.setDescription (/home/$USER/SpikeyBot-Discord/node_modules/@discordjs/builders/dist/messages/embed/Embed.cjs:57:37)
at /home/$USER/SpikeyBot-Discord/src/hungryGames.js:3617:25
at processTicksAndRejections (node:internal/process/task_queues:96:5)
The solution: Replace the line with:
embed.setDescription(null);
To Reproduce
Create an NPC with ?hg npc create Name Here
Expected behavior
After confirming by reacting with the checkmark emoji, the NPC is created.
Describe the bug When creating an NPC, after confirmation, it fails.
In src/hungryGames.js:3617 of the 2022 unstable branch, embed.setDescription('') is called to clear to embed's description, which isn't allowed and creates a validation error:
The solution: Replace the line with:
To Reproduce Create an NPC with
?hg npc create Name Here
Expected behavior After confirming by reacting with the checkmark emoji, the NPC is created.
Additional context Solution is provided above.