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

Не работает метод ReplyKeyboardMarkup #71

Closed
popcorn2d opened this issue Jul 12, 2017 · 5 comments
Closed

Не работает метод ReplyKeyboardMarkup #71

popcorn2d opened this issue Jul 12, 2017 · 5 comments
Assignees
Labels

Comments

@popcorn2d
Copy link

$bot->command('start', function ($message) use ($bot) { $bot->sendMessage($message->getChat()->getId(), 'У меня есть команда /statusready /statusnotready'); $keyboard = new \TelegramBot\Api\Types\ReplyKeyboardMarkup(array(array("one", "two", "three")), true); // true for one-time keyboard $bot->sendMessage($chatId, $messageText, null, false, null, $keyboard); });
Пример, который не работает

@TheMY3
Copy link
Member

TheMY3 commented Jul 13, 2017

Что именно не работает? Судя по коду вы класс ReplyKeyboardMarkup не используте, просто создали

@popcorn2d
Copy link
Author

Это скопировано с примера

@TheMY3
Copy link
Member

TheMY3 commented Jul 13, 2017

@popcorn2d может проблема в том что переменной нет у вас $messageText?
Что-то же должен сказать сервер или API если ошибка, что в вашем понимании "не работает"?

@popcorn2d
Copy link
Author

@YaroslavMolchan Тогда можно рабочий пример привести?

@iGusev
Copy link
Contributor

iGusev commented Jul 18, 2017

@popcorn2d
Пример, который работает:

$bot->command('start', function ($message) use ($bot) {
            $bot->sendMessage($message->getChat()->getId(), 'У меня есть команда /statusready /statusnotready');
            $keyboard = new \TelegramBot\Api\Types\ReplyKeyboardMarkup(
                [
                    [
                        "one",
                        "two",
                        "three"
                    ]
                ],
                true
            );
            // true for one-time keyboard
            $bot->sendMessage($message->getChat()->getId(), 'У меня есть команда /statusready /statusnotready', null, false, null, $keyboard);
        });

@iGusev iGusev self-assigned this Jul 18, 2017
@iGusev iGusev closed this as completed Jul 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants