Skip to content

Tag: typescript

Typescript: Define for JSON nested object

I have a nested json object and define a interface for it But when I use it. It appear a warning. What did I do wrong or missing? Answer You didn’t do anything wrong per se. TypeScript just cannot infer whether your menuPermissionForKey is a Menu object or a string array. Ideally, you’d define you…

Discord.js Modal ValidationError

I’m attempting to make a bot but when I try to show the user a modal, I get the following error: ValidationError: Expected the value to be a string or number I’m not sure why this happens, but here is the code which seems to be causing it: Answer Discord.js error messages leave a lot to be desired…