Skip to content

Latest commit

History

History
51 lines (34 loc) 路 1.09 KB

CHANGELOG.md

File metadata and controls

51 lines (34 loc) 路 1.09 KB

Next release

Public changes

  • Prefix behavior removed, replaced by params function:
async function getParams(): CommandParams {
  // async tasks...
  return {
    name: "test",
    caseSensitive: true,
    prefix: "!"
  }
}

// ...

@Command(getParams)

// ...
  • CommandParams accpets regex for name and prefix

  • @Command accepts regex for the whole command
    prefix: "!", name: undefined, caseSensitive: false

/^!\w*/i;

prefix: "-mbd", name: "test", caseSensitive: true

/^-mbd/;
  • Possibility to have no command name, just a prefix:
    -mdb Hello

  • @CommandNotFound only for the commands inside the same class to get a cleaner code. Now warnings will be printed if a class has some command but no @CommandNotFound, but you can specify inside Client options if you want to show these warnings.

  • Client.getCommands returns @CommandNotFounds too.

  • Can specify infos to @CommandNotFound.

Internal changes

  • @On has a type: "on" | "command" | "commandNotFound"
  • @Command params are compiled into a regex for tests