addRow() ->addCallback('Клавиатуры', 'demo_keyboard', Intent::Positive) ->addCallback('Загрузки', 'demo_uploads'); $keyboard->addRow()->addLink('Документация MAX', 'https://dev.max.ru'); $text = <<<'MD' *max-bot-test* — тестовый бот для [`max-bot-api-php`] Доступные команды: *Bot* /bot — getBot() /bot_patch — patchBot() *Chats* /chats [count] — getChats() /chat — getChat() + getChatMembership() /members — getChatMembers() + getChatAdmins() /action — sendAction() /pin — pinMessage() /edit_chat — editChat() /add_member <chatId> <userId> — addMember() /remove_member <chatId> <userId> — removeMember() /leave <chatId> — leaveChat() *Messages* /send_text <text> — send() plain /send_markdown <text> — Format::Markdown /send_html <text> — Format::Html /reply <messageId> <text> — setReply() /forward <messageId> — setForward() /edit <messageId> <text> — editMessage() /delete <messageId> — deleteMessage() /messages <chatId> [count] — getMessages() /message <messageId> — getMessage() /markup <userId> — addMarkUp() (mention) /notify <text> — setNotify(false) (silent) /disable_preview <url> — setDisableLinkPreview(true) /keyboard — inline keyboard со всеми 8 типами кнопок *Uploads* /upload_photo_file [path] — uploadPhotoFromFile() /upload_photo_url <url> — uploadPhotoFromUrl() /upload_photo_bytes — uploadPhotoFromBytes() /upload_photo_base64 — uploadPhotoFromBase64() /upload_audio [path] — uploadMediaFromFile(Audio) /upload_video [path] — uploadMediaFromFile(Video) /upload_file [path] — uploadMediaFromFile(File) /upload_url <audio|video|file> <url> — uploadMediaFromUrl() *Attachments* /attach_location <lat> <lng> — addLocation() /attach_contact <name> <userId> — addContact() /attach_sticker <code> — addSticker() *Phone (notify)* /phone_check <phone> — check() /phone_list <phone1,phone2> — listExist() *Subscriptions (CLI)* `make subscribe`, `make unsubscribe`, `bin/console subs:list` *Debug* /debug <on|off|raw|err> — переключение Debugs + Options::withDebug MD; $this->api->messages->send( MessageBuilder::new() ->setChat($update->getChatId()) ->setText($text) ->setFormat(Format::Markdown) ->addKeyboard($keyboard), ); } public function handleUnknown(MessageCreatedUpdate $update, ParsedCommand $command): void { $this->replyMarkdown( $update, sprintf('Не знаю команду `%s`. Набери `/help`.', $command->name), ); } }