owengombas / discord.ts

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

The same Infos and commandName properties in commandMessage bug fix; #30

Closed ZirionNeft closed 3 years ago

ZirionNeft commented 3 years ago
abstract class CommandA {
  @Command("commandA")
  @Infos({
    testProp: "test info 1"
  })
  async run(command: CommandMessage) {
    console.log(command.infos);
  }
}
...
abstract class CommandB {
  @Command("commandB")
  @Infos({
    testProp: "test info 2"
  })
  async run(command: CommandMessage) {
    console.log(command.infos);
  }
}

From example above in console will be printed the same object twice with "test info 1" or "test info 2" what depends on an order of processing in code part started from this line. commandName property that in command argument passed in run function also has a wrong value by the same reasons.