Advertisement
MyZik

Untitled

Nov 14th, 2019
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.71 KB | None | 0 0
  1. public function editMessageMedia(
  2.     $chatId,
  3.     $messageId,
  4.     $media,
  5.     $inlineMessageId = null,
  6.     $replyMarkup = null
  7. ) {
  8.     return Message::fromResponse($this->call('editMessageMedia'), [
  9.         'chat_id' => $chatId,
  10.         'message_id' => $messageId,
  11.         'inline_message_id' => $inlineMessageId,
  12.         'media' => $media,
  13.         'reply_markup' => is_null($replyMarkup) ? $replyMarkup : $replyMarkup->toJson(),
  14.     ]);
  15. }
  16.  
  17. /** Call a function **/
  18.  
  19. $data['photo'] = 'https://www.investors.com/wp-content/uploads/2019/03/Podcast-spotlight.jpg';
  20. $photo = new InputMediaPhoto($data['photo']);
  21. $api->editMessageMedia(
  22.     $data['chatId'],
  23.     $data['messageId'],
  24.     $photo,
  25.     $data['inlineMessageId'] ?? null,
  26.     $data['replyMarkup'] ?? null
  27. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement