Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method setMyCommands scopes not working #45

Closed
hamidqp opened this issue Sep 2, 2021 · 3 comments
Closed

Method setMyCommands scopes not working #45

hamidqp opened this issue Sep 2, 2021 · 3 comments

Comments

@hamidqp
Copy link
Contributor

hamidqp commented Sep 2, 2021

I just tried this code below to show the /help command only in specified private chat with BotCommandScopeChat, but it applies on botCommandScopeDefault, where I'm wrong or how should I do this?

$ctx->setMyCommands(
    [
        ['command' => 'help', 'description' => 'show the help message']
    ],
    [
        'scope' => [
            'type' => 'chat', 'chat_id' => $ctx->getEffectiveUser()->getId()
        ],
        'language_code' => 'en'
    ]);
@cheeghi
Copy link
Collaborator

cheeghi commented Sep 20, 2021

Hi, are you sure that you don't have any command set on the BotCommandScopeDefault? Did you try to delete the scopeDefault commands, i.e. $ctx->deleteMyCommands() ?

@cheeghi
Copy link
Collaborator

cheeghi commented Oct 15, 2021

Hi, any update on this issue? Did you solve it?

@hamidqp
Copy link
Contributor Author

hamidqp commented Oct 18, 2021

Hi, sorry for my late response, I've tested again the same source today and it does works! maybe as it was too early for testing this feature I've been got that result.

@hamidqp hamidqp closed this as completed Oct 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants