sendChatAction() 공개 메소드

$params = [ 'chat_id' => '', 'action' => '', ];
public sendChatAction ( array $params ) : boolean
$params array
리턴 boolean
예제 #1
0
 /**
  * @throws DialogException
  * @throws \Telegram\Bot\Exceptions\TelegramSDKException
  */
 public function proceed()
 {
     $this->current = $this->next;
     if (!$this->isEnd()) {
         $this->telegram->sendChatAction(['chat_id' => $this->update->getMessage()->getChat()->getId(), 'action' => Actions::TYPING]);
         $step = $this->steps[$this->current];
         if (is_array($step)) {
             if (!isset($step['name'])) {
                 throw new DialogException('Dialog step name must be defined.');
             }
             $name = $step['name'];
         } elseif (is_string($step)) {
             $name = $step;
         } else {
             throw new DialogException('Dialog step is not defined.');
         }
         // Flush yes/no state
         $this->yes = null;
         $this->no = null;
         if (is_array($step)) {
             if (isset($step['is_dich']) && $step['is_dich'] && $this->processYesNo($step)) {
                 return;
             } elseif (!empty($step['jump'])) {
                 $this->jump($step['jump']);
             }
         }
         $this->{$name}($step);
         // Step forward only if did not changes inside the step handler
         if ($this->next == $this->current) {
             $this->next++;
         }
     }
 }