You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.The text was updated successfully, but these errors were encountered: