Closed carafelix closed 5 days ago
Creating and registering a command with a default handler will always overshadow any other scope. In the following snippet, even when conditions are met (e.g: being admin in a group chat), the response will always be "hello from default scope".
myCommands .command( "default", "Default command", (ctx) => ctx.reply("Hello from default scope"), ) .addToScope( { type: "all_chat_administrators" }, (ctx) => ctx.reply("Hello, admin!"), ) .addToScope( { type: "all_group_chats" }, (ctx) => ctx.reply("Hello, group chat!"), );
The order of .addToScope registration should affect indeed the handling priority, while the default handler should always be last.
.addToScope
marked as completed from merging #51
Creating and registering a command with a default handler will always overshadow any other scope. In the following snippet, even when conditions are met (e.g: being admin in a group chat), the response will always be "hello from default scope".
The order of
.addToScope
registration should affect indeed the handling priority, while the default handler should always be last.