首次提交 Laravel 專案
This commit is contained in:
@@ -0,0 +1 @@
|
||||
a:3:{s:6:"_token";s:40:"pXvT32dSzc4TrUt24vUd091Z3gGHJn61uwob0zTm";s:9:"_previous";a:1:{s:3:"url";s:77:"http://172.19.205.109:8090/7710672705:AAEX1RWhBoLA2L5EZuTLajQ---tRjahNr9w/Msg";}s:6:"_flash";a:2:{s:3:"old";a:0:{}s:3:"new";a:0:{}}}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\tg_Msg;
|
||||
use App\Services\TgApi;
|
||||
use App\Services\UserFun;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class TgController extends Controller
|
||||
{
|
||||
public function Msg($token,Request $request)
|
||||
{
|
||||
$data = $request->all();
|
||||
// $data='{"update_id":240447110,"message":{"message_id":1356,"from":{"id":5909523353,"is_bot":false,"first_name":"流浪的","last_name":"阿江","username":"winchen1688","language_code":"zh-hans"},"chat":{"id":-937402821,"title":"易利机器人测试群","type":"group","all_members_are_administrators":true},"date":1745980807,"text":"@xiongia +2000","entities":[{"offset":0,"length":8,"type":"mention"}]}}';
|
||||
$msg=UserFun::Json2Arr($data); //将JSON转换成一維扁平陣列
|
||||
$msg['token']=$token;
|
||||
$tgmsg=tg_Msg::storeFromWebhookJson($msg);
|
||||
$chat_id=TgApi::GetChatInfo($msg);
|
||||
return $chat_id;
|
||||
|
||||
return $tgmsg;
|
||||
// return response()->json(['status' => 'ok']);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user