Closed carafelix closed 2 months ago
closes #38
const sayHi = new Command("hi","say hi", (ctx) => ctx.reply("hi")) const sayBye = new Command("bye","say bye", (ctx) => ctx.reply("bye"), { ignoreCase: true }) const myCmds = new CommandGroup().add(sayHi).add(sayBye)
fix: merge options instead of complete override when using the .command creation method.
.command
options
CommandGroup.command(...)
feat: prevent whitespace only custom prefixes.
prefix === ""
closes #38
fix: merge options instead of complete override when using the
.command
creation method.options
param to theCommandGroup.command(...)
method, the default options from the command group now merges with the specific options of that command, which ofc takes priority. Before the object was being overridden completely, ignoring the default group options. https://github.com/grammyjs/commands/blob/0f92ae16f08a1e8e991156eebd2c2fd2823f8c11/src/command-group.ts#L141-L143feat: prevent whitespace only custom prefixes.
prefix === ""
https://github.com/grammyjs/commands/blob/0f92ae16f08a1e8e991156eebd2c2fd2823f8c11/src/command-group.ts#L78-L79 https://github.com/grammyjs/commands/blob/0f92ae16f08a1e8e991156eebd2c2fd2823f8c11/src/command.ts#L120