getUpdate(); $Message = $Update->getMessage(); // 消息会话 ID $ChatID = $Message->getChat()->getId(); if ($ChatID > 0) { // 私人会话 // 发送 '输入中' 会话状态 $this->replyWithChatAction(['action' => Actions::TYPING]); $text = [ 'Pong!', '这个群组的 ID 是 ' . $ChatID . '.', ]; // 回送信息 $this->replyWithMessage( [ 'text' => implode(PHP_EOL, $text), 'parse_mode' => 'Markdown', ] ); } else { // 群组 if ($_ENV['enable_delete_user_cmd'] === true) { TelegramTools::DeleteMessage([ 'chatid' => $ChatID, 'messageid' => $Message->getMessageId(), ]); } if ($_ENV['telegram_group_quiet'] === true) { // 群组中不回应 return; } // 发送 '输入中' 会话状态 $this->replyWithChatAction(['action' => Actions::TYPING]); $text = [ 'Pong!', '您的 ID 是 ' . $Message->getFrom()->getId() . '.', '这个群组的 ID 是 ' . $ChatID . '.', ]; // 回送信息 $response = $this->replyWithMessage( [ 'text' => implode(PHP_EOL, $text), ] ); // 消息删除任务 TelegramTools::DeleteMessage([ 'chatid' => $ChatID, 'messageid' => $response->getMessageId(), ]); } } }