Esempio n. 1
0
 /**
  * @inheritdoc
  */
 public static function initializeByObject(stdClass $Object)
 {
     $Update = new self();
     $Update->setUpdateId($Object->update_id);
     if (isset($Object->message)) {
         $Update->setMessage(Message::initializeByObject($Object->message));
     }
     return $Update;
 }
Esempio n. 2
0
 /**
  * @inheritdoc
  */
 public function sendLocation($chatId, $latitude, $longitude, $replyToMessageId = null, JsonSerializable $ReplyMarkUp = null)
 {
     $parameters = ['chat_id' => (int) $chatId, 'latitude' => (double) $latitude, 'longitude' => (double) $longitude];
     if (!is_null($replyToMessageId)) {
         $parameters['reply_to_message_id'] = (int) $replyToMessageId;
     }
     if (!is_null($ReplyMarkUp)) {
         $parameters['reply_markup'] = json_encode($ReplyMarkUp);
     }
     return $this->getResult('sendLocation', $parameters, function (stdClass $Message) {
         return Message::initializeByObject($Message);
     });
 }