| @@ 338-356 (lines=19) @@ | ||
| 335 | * @return \TelegramBot\Api\Types\Message |
|
| 336 | * @throws \TelegramBot\Api\Exception |
|
| 337 | */ |
|
| 338 | public function sendContact( |
|
| 339 | $chatId, |
|
| 340 | $phoneNumber, |
|
| 341 | $firstName, |
|
| 342 | $lastName = null, |
|
| 343 | $replyToMessageId = null, |
|
| 344 | $replyMarkup = null, |
|
| 345 | $disableNotification = false |
|
| 346 | ) { |
|
| 347 | return Message::fromResponse($this->call('sendContact', [ |
|
| 348 | 'chat_id' => $chatId, |
|
| 349 | 'phone_number' => $phoneNumber, |
|
| 350 | 'first_name' => $firstName, |
|
| 351 | 'last_name' => $lastName, |
|
| 352 | 'reply_to_message_id' => $replyToMessageId, |
|
| 353 | 'reply_markup' => is_null($replyMarkup) ? $replyMarkup : $replyMarkup->toJson(), |
|
| 354 | 'disable_notification' => (bool)$disableNotification, |
|
| 355 | ])); |
|
| 356 | } |
|
| 357 | ||
| 358 | /** |
|
| 359 | * Use this method when you need to tell the user that something is happening on the bot's side. |
|
| @@ 481-497 (lines=17) @@ | ||
| 478 | * @return \TelegramBot\Api\Types\Message |
|
| 479 | * @throws \TelegramBot\Api\Exception |
|
| 480 | */ |
|
| 481 | public function sendLocation( |
|
| 482 | $chatId, |
|
| 483 | $latitude, |
|
| 484 | $longitude, |
|
| 485 | $replyToMessageId = null, |
|
| 486 | $replyMarkup = null, |
|
| 487 | $disableNotification = false |
|
| 488 | ) { |
|
| 489 | return Message::fromResponse($this->call('sendLocation', [ |
|
| 490 | 'chat_id' => $chatId, |
|
| 491 | 'latitude' => $latitude, |
|
| 492 | 'longitude' => $longitude, |
|
| 493 | 'reply_to_message_id' => $replyToMessageId, |
|
| 494 | 'reply_markup' => is_null($replyMarkup) ? $replyMarkup : $replyMarkup->toJson(), |
|
| 495 | 'disable_notification' => (bool)$disableNotification, |
|
| 496 | ])); |
|
| 497 | } |
|
| 498 | ||
| 499 | /** |
|
| 500 | * Use this method to send information about a venue. On success, the sent Message is returned. |
|
| @@ 552-566 (lines=15) @@ | ||
| 549 | * @throws \TelegramBot\Api\InvalidArgumentException |
|
| 550 | * @throws \TelegramBot\Api\Exception |
|
| 551 | */ |
|
| 552 | public function sendSticker( |
|
| 553 | $chatId, |
|
| 554 | $sticker, |
|
| 555 | $replyToMessageId = null, |
|
| 556 | $replyMarkup = null, |
|
| 557 | $disableNotification = false |
|
| 558 | ) { |
|
| 559 | return Message::fromResponse($this->call('sendSticker', [ |
|
| 560 | 'chat_id' => $chatId, |
|
| 561 | 'sticker' => $sticker, |
|
| 562 | 'reply_to_message_id' => $replyToMessageId, |
|
| 563 | 'reply_markup' => is_null($replyMarkup) ? $replyMarkup : $replyMarkup->toJson(), |
|
| 564 | 'disable_notification' => (bool)$disableNotification, |
|
| 565 | ])); |
|
| 566 | } |
|
| 567 | ||
| 568 | /** |
|
| 569 | * Use this method to send video files, |
|
| @@ 624-640 (lines=17) @@ | ||
| 621 | * @throws \TelegramBot\Api\InvalidArgumentException |
|
| 622 | * @throws \TelegramBot\Api\Exception |
|
| 623 | */ |
|
| 624 | public function sendVoice( |
|
| 625 | $chatId, |
|
| 626 | $voice, |
|
| 627 | $duration = null, |
|
| 628 | $replyToMessageId = null, |
|
| 629 | $replyMarkup = null, |
|
| 630 | $disableNotification = false |
|
| 631 | ) { |
|
| 632 | return Message::fromResponse($this->call('sendVoice', [ |
|
| 633 | 'chat_id' => $chatId, |
|
| 634 | 'voice' => $voice, |
|
| 635 | 'duration' => $duration, |
|
| 636 | 'reply_to_message_id' => $replyToMessageId, |
|
| 637 | 'reply_markup' => is_null($replyMarkup) ? $replyMarkup : $replyMarkup->toJson(), |
|
| 638 | 'disable_notification' => (bool)$disableNotification, |
|
| 639 | ])); |
|
| 640 | } |
|
| 641 | ||
| 642 | /** |
|
| 643 | * Use this method to forward messages of any kind. On success, the sent Message is returned. |
|
| @@ 729-745 (lines=17) @@ | ||
| 726 | * @throws \TelegramBot\Api\InvalidArgumentException |
|
| 727 | * @throws \TelegramBot\Api\Exception |
|
| 728 | */ |
|
| 729 | public function sendPhoto( |
|
| 730 | $chatId, |
|
| 731 | $photo, |
|
| 732 | $caption = null, |
|
| 733 | $replyToMessageId = null, |
|
| 734 | $replyMarkup = null, |
|
| 735 | $disableNotification = false |
|
| 736 | ) { |
|
| 737 | return Message::fromResponse($this->call('sendPhoto', [ |
|
| 738 | 'chat_id' => $chatId, |
|
| 739 | 'photo' => $photo, |
|
| 740 | 'caption' => $caption, |
|
| 741 | 'reply_to_message_id' => $replyToMessageId, |
|
| 742 | 'reply_markup' => is_null($replyMarkup) ? $replyMarkup : $replyMarkup->toJson(), |
|
| 743 | 'disable_notification' => (bool)$disableNotification, |
|
| 744 | ])); |
|
| 745 | } |
|
| 746 | ||
| 747 | /** |
|
| 748 | * Use this method to send general files. On success, the sent Message is returned. |
|
| @@ 762-778 (lines=17) @@ | ||
| 759 | * @throws \TelegramBot\Api\InvalidArgumentException |
|
| 760 | * @throws \TelegramBot\Api\Exception |
|
| 761 | */ |
|
| 762 | public function sendDocument( |
|
| 763 | $chatId, |
|
| 764 | $document, |
|
| 765 | $caption = null, |
|
| 766 | $replyToMessageId = null, |
|
| 767 | $replyMarkup = null, |
|
| 768 | $disableNotification = false |
|
| 769 | ) { |
|
| 770 | return Message::fromResponse($this->call('sendDocument', [ |
|
| 771 | 'chat_id' => $chatId, |
|
| 772 | 'document' => $document, |
|
| 773 | 'caption' => $caption, |
|
| 774 | 'reply_to_message_id' => $replyToMessageId, |
|
| 775 | 'reply_markup' => is_null($replyMarkup) ? $replyMarkup : $replyMarkup->toJson(), |
|
| 776 | 'disable_notification' => (bool)$disableNotification, |
|
| 777 | ])); |
|
| 778 | } |
|
| 779 | ||
| 780 | /** |
|
| 781 | * Use this method to get basic info about a file and prepare it for downloading. |
|
| @@ 937-955 (lines=19) @@ | ||
| 934 | * @param Types\ReplyKeyboardMarkup|Types\ReplyKeyboardHide|Types\ForceReply|null $replyMarkup |
|
| 935 | * @return Message |
|
| 936 | */ |
|
| 937 | public function editMessageText( |
|
| 938 | $chatId, |
|
| 939 | $messageId, |
|
| 940 | $text, |
|
| 941 | $parseMode = null, |
|
| 942 | $disablePreview = false, |
|
| 943 | $replyMarkup = null, |
|
| 944 | $inlineMessageId = null |
|
| 945 | ) { |
|
| 946 | return Message::fromResponse($this->call('editMessageText', [ |
|
| 947 | 'chat_id' => $chatId, |
|
| 948 | 'message_id' => $messageId, |
|
| 949 | 'text' => $text, |
|
| 950 | 'inline_message_id' => $inlineMessageId, |
|
| 951 | 'parse_mode' => $parseMode, |
|
| 952 | 'disable_web_page_preview' => $disablePreview, |
|
| 953 | 'reply_markup' => is_null($replyMarkup) ? $replyMarkup : $replyMarkup->toJson(), |
|
| 954 | ])); |
|
| 955 | } |
|
| 956 | ||
| 957 | /** |
|
| 958 | * Use this method to edit text messages sent by the bot or via the bot |
|
| @@ 996-1008 (lines=13) @@ | ||
| 993 | * |
|
| 994 | * @return Message |
|
| 995 | */ |
|
| 996 | public function editMessageReplyMarkup( |
|
| 997 | $chatId, |
|
| 998 | $messageId, |
|
| 999 | $replyMarkup = null, |
|
| 1000 | $inlineMessageId = null |
|
| 1001 | ) { |
|
| 1002 | return Message::fromResponse($this->call('editMessageReplyMarkup', [ |
|
| 1003 | 'chat_id' => $chatId, |
|
| 1004 | 'message_id' => $messageId, |
|
| 1005 | 'inline_message_id' => $inlineMessageId, |
|
| 1006 | 'reply_markup' => is_null($replyMarkup) ? $replyMarkup : $replyMarkup->toJson(), |
|
| 1007 | ])); |
|
| 1008 | } |
|
| 1009 | ||
| 1010 | /** |
|
| 1011 | * Use this method to delete a message, including service messages, with the following limitations: |
|