getUpdate(); $Message = $Update->getMessage(); // 消息会话 ID $ChatID = $Message->getChat()->getId(); if ($ChatID > 0) { // 私人会话 // 发送 '输入中' 会话状态 $this->replyWithChatAction(['action' => Actions::TYPING]); // 触发用户 $SendUser = [ 'id' => $Message->getFrom()->getId(), 'name' => $Message->getFrom()->getFirstName() . ' ' . $Message->getFrom()->getLastName(), 'username' => $Message->getFrom()->getUsername(), ]; $text = [ 'Pong!', '这个群组的 ID 是 ' . $ChatID . '.', ]; // 回送信息 $this->replyWithMessage( [ 'text' => implode(PHP_EOL ,$text), 'parse_mode' => 'Markdown', ] ); } else { // 群组 if (Config::get('new_telegram_group_quiet') === true) { // 群组中不回应 return; } // 发送 '输入中' 会话状态 $this->replyWithChatAction(['action' => Actions::TYPING]); $text = [ 'Pong!', '这个群组的 ID 是 ' . $ChatID . '.', ]; // 回送信息 $this->replyWithMessage( [ 'text' => implode(PHP_EOL ,$text), ] ); } } }