Example #1
0
 /**
  * @param array $attributes
  */
 public function loadRelated(array $attributes)
 {
     parent::loadRelated($attributes);
     if (isset($attributes['message'])) {
         $this->message = Message::create($attributes['message']);
     }
     if (isset($attributes['edited_message'])) {
         $this->edited_message = Message::create($attributes['edited_message']);
     }
     if (isset($attributes['inline_query'])) {
         $this->inline_query = InlineQuery::create($attributes['inline_query']);
     }
     if (isset($attributes['chosen_inline_result'])) {
         $this->chosen_inline_result = ChosenInlineResult::create($attributes['chosen_inline_result']);
     }
     if (isset($attributes['callback_query'])) {
         $this->callback_query = CallbackQuery::create($attributes['callback_query']);
     }
 }
Example #2
0
 /**
  * @param array $params
  *
  * @return Message
  */
 public function editMessageReplyMarkup(array $params = [])
 {
     if (isset($params['reply_markup']) && $params['reply_markup'] instanceof Keyboard) {
         $params['reply_markup'] = json_encode($params['reply_markup']);
     }
     return Message::createFromResponse($this->request('editMessageReplyMarkup', $params));
 }