|
@@ -22,6 +22,7 @@ use Illuminate\Support\Facades\Cache;
|
|
|
use Illuminate\Support\Facades\DB;
|
|
|
use Telegram\Bot\Api;
|
|
|
use Telegram\Bot\Exceptions\TelegramSDKException;
|
|
|
+use Illuminate\Support\Facades\Log;
|
|
|
|
|
|
class TelegramWebHook extends Controller
|
|
|
{
|
|
@@ -37,6 +38,17 @@ class TelegramWebHook extends Controller
|
|
|
}
|
|
|
$update = $telegram->getWebhookUpdate(); // 获取更新数据
|
|
|
$update->callbackQuery;
|
|
|
+ Log::info('Telegram 回调数据(JSON): ' . json_encode($update, JSON_UNESCAPED_UNICODE));
|
|
|
+ return response()->json(['status' => 'ok']);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public function handleMessage()
|
|
|
+ {
|
|
|
+
|
|
|
+ $telegram = new Api(config('services.telegram.token'));
|
|
|
+ $update = $telegram->getWebhookUpdate(); // 获取更新数据
|
|
|
+ $update->callbackQuery;
|
|
|
if ($update->has('callback_query')) {
|
|
|
|
|
|
$json['type'] = 'callback_query';
|