Skip to content

Commit

Permalink
add editMessage and answerCallback function
Browse files Browse the repository at this point in the history
  • Loading branch information
parsgit committed Nov 7, 2019
1 parent 94fdb17 commit c9d5e46
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions BotFire.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ public static function initClientInfo()

BotFire::$get['text']=BotFire::checkIsset('text',$query->message);
BotFire::$get['data']=$query->data;
BotFire::$get['callback_id']=$query->id;
BotFire::$get['message_id']=$query->message->message_id;

if (isset($query->message->chat)) {
$chat=$query->message->chat;
Expand Down Expand Up @@ -388,6 +390,66 @@ public function videoNote($video_note)
}


public function editReplyMarkup($message_id=null)
{
if ($message_id==null) {
$this->message_id(BotFire::get('message_id'));
}
else {
$this->message_id($message_id);
}
$this->method='editMessageReplyMarkup';

return $this;
}

public function editMessage($text)
{
$this->params['text']=$text;
$this->message_id(BotFire::get('message_id'));
$this->method='editMessageText';

return $this;
}

public function message_id($message_id)
{
$this->params['message_id']=$message_id;
return $this;
}

public function inline_message_id($inline_message_id)
{
$this->params['inline_message_id']=$inline_message_id;
return $this;
}

public function callback_query_id($callback_query_id)
{
$this->params['callback_query_id']=$callback_query_id;
return $this;
}

public function url($url)
{
$this->params['url']=$url;
return $this;
}
public function text($text)
{
$this->params['text']=$text;
return $this;
}

public function answerCallback($show_alert=false)
{
$this->callback_query_id(BotFire::get('callback_id'));
$this->params['show_alert']=$show_alert;
$this->method='answerCallbackQuery';
return $this;
}


/**
* Use this method to send phone contacts.
* @param $phone_number string Required
Expand Down

0 comments on commit c9d5e46

Please sign in to comment.