|
@@ -40,11 +40,24 @@ class TelegramWebHook extends Controller
|
|
$update = $telegram->getWebhookUpdate(); // 获取更新数据
|
|
$update = $telegram->getWebhookUpdate(); // 获取更新数据
|
|
$update->callbackQuery;
|
|
$update->callbackQuery;
|
|
Log::error('Telegram 回调数据(JSON): ' . json_encode($update, JSON_UNESCAPED_UNICODE));
|
|
Log::error('Telegram 回调数据(JSON): ' . json_encode($update, JSON_UNESCAPED_UNICODE));
|
|
|
|
+ if ($update->has('callback_query')) {
|
|
|
|
+
|
|
|
|
+ }else {
|
|
|
|
+ $update = $request->all();
|
|
|
|
+ if (isset($update['message'])) {
|
|
|
|
+ $message = $update['message'];
|
|
|
|
+ $chatId = $message['chat']['id'];
|
|
|
|
+ $messageId = $message['message_id'];
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
return response()->json(['status' => 'ok']);
|
|
return response()->json(['status' => 'ok']);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- public function handleMessage()
|
|
|
|
|
|
+ public function handleMessage(Request $request)
|
|
{
|
|
{
|
|
|
|
|
|
$telegram = new Api(config('services.telegram.token'));
|
|
$telegram = new Api(config('services.telegram.token'));
|