diff --git a/app/Utils/TelegramProcess.php b/app/Utils/TelegramProcess.php index 8eb8aa62..0b13eac8 100644 --- a/app/Utils/TelegramProcess.php +++ b/app/Utils/TelegramProcess.php @@ -28,7 +28,15 @@ class TelegramProcess switch (true){ case $command=="?mu=0&quantumult=2": $ssr_sub_token = LinkController::GenerateSSRSubCode($user->id, 0); - $bot->sendMessage($message->getChat()->getId(), "1.点击打开以下配置文件\n2. 选择导出,拷贝到\"Quantumult\"\n3.选择更新配置\n," , $parseMode = null, $disablePreview = false, $replyToMessageId = $reply_to); + $baseUrl =Config::get('baseUrl'); + $keyboard = new \TelegramBot\Api\Types\Inline\InlineKeyboardMarkup( + [ + [ + ['text' => '点击跳转', 'url' => $baseUrl."/jump.html?url=quantumult://settings?configuration=clipboard"] + ] + ] + ); + $bot->sendMessage($user->get_user_attributes("telegram_id"), "两种方法:\n 方法一:\n 1.点击打开以下配置文件\n 2. 选择分享->拷贝到\"Quantumult\"\n 3.选择更新配置\n 方法二:\n 1.长按配置文件\n 2. 选择更多->分享->拷贝\n 3.点击跳转APP,到Quan中保存" , $parseMode = null, $disablePreview = false, $replyToMessageId = null,$replyMarkup=$keyboard); $filepath ='/tmp/tg_'.$ssr_sub_token.'.txt'; $fh = fopen($filepath, 'w+'); $string = LinkController::GetQuantumult($user,0,2); @@ -291,7 +299,6 @@ class TelegramProcess $bot = new \TelegramBot\Api\Client(Config::get('telegram_token')); // or initialize with botan.io tracker api key // $bot = new \TelegramBot\Api\Client('YOUR_BOT_API_TOKEN', 'YOUR_BOTAN_TRACKER_API_KEY'); - $bot->setCurlOption("CURLOPT_TIMEOUT",100); $command_list = array("ping", "chat", "traffic", "help", "prpr", "checkin", "rss"); foreach ($command_list as $command) { $bot->command($command, function ($message) use ($bot, $command) { diff --git a/public/jump.html b/public/jump.html new file mode 100644 index 00000000..76bb640f --- /dev/null +++ b/public/jump.html @@ -0,0 +1,23 @@ + + + + + web页面跳转App + + + + +