Exemple #1
0
 /**
  * sendLocation
  * Use this method to send location. On success, the sent Message is returned.
  *
  * @param Chat    $chat
  * @param Location $location
  *
  * @return Message
  */
 public function sendLocation(Chat $chat, Location $location)
 {
     $params = ['chat_id' => $chat->getId(), 'latitude' => $location->getLatitude(), 'longitude' => $location->getLongitude()];
     $message = $this->Telegram->getNet()->doRequest('/sendLocation', $params);
     return new Message($message);
 }
 /**
  * sendLocation
  * Use this method to send location. On success, the sent Message is returned.
  *
  * @param Chat|string $chat Unique identifier for the target chat or username of the target channel (in the format @channelusername)
  * @param Location $location Coordinates of location
  * @param bool $disableNotification Sends the message silently. iOS users will not receive a notification, Android users will receive a notification with no sound.
  * @param int $replyToMessageId If the message is a reply, ID of the original message
  * @param AbstractKeyboard|null $replyMarkup Reply keyboard markup
  *
  * @return Message
  */
 public function sendLocation($chat, Location $location, $disableNotification = false, $replyToMessageId = null, AbstractKeyboard $replyMarkup = null)
 {
     $params = ['chat_id' => $chat instanceof Chat ? $chat->getId() : $chat, 'latitude' => $location->getLatitude(), 'longitude' => $location->getLongitude(), 'disable_notification' => $disableNotification, 'reply_to_message_id' => $replyToMessageId, 'reply_markup' => $replyMarkup];
     $message = $this->getNet()->doRequest('/sendLocation', $params);
     return new Message($message);
 }