owengombas / discord.ts

🤖 Create your discord bot by using TypeScript and decorators!
https://owencalvin.github.io/discord.ts/
324 stars 40 forks source link

Fix: slash command options parsing #53

Closed samarmeena closed 3 years ago

samarmeena commented 3 years ago

Issue

  1. create a slash command with two optional options, example: /test option_a option_b
  2. now on discord use this command as /test option_b: 123 (here we are using option_b only and leaving option_a blank)
  3. when discord.ts try to execute the original command, parameter passed are [123, undefined] (which is the issue, because it was suppose to [undefined, 123])

Fix

I have looked at the code, I think, this suggested approach is more appropriate.

Thanks

samarmeena commented 3 years ago

this pull messed up xd