DEV Community

Discussion on: How to implement, test and mock Discord.js v13 slash commands with Typescript

Collapse
 
heymarkkop profile image
Mark Kop

Hey, there.
You shouldn't need to mock CommandInteractionOptionResolver, because we're passing the resolved options directly to the CommandInteraction class.
That's why, according to this guide, you have to pass it as an object like this

{
  "id": "config",
  "name": "config",
  "type": 1,
  "options": [
    {
      "type": 1,
      "name": "set",
      "options": [{
        "value": "en",
        "type": 3,
        "name": "lang"
      }],
    }
  ]
}
Enter fullscreen mode Exit fullscreen mode

or parse a command line like I've showed previously in the guide.