From c0d39f38bd5bd24c36f4bcc3b02c6f88c01dc6dc Mon Sep 17 00:00:00 2001 From: xiaomlove Date: Tue, 2 Apr 2024 02:33:35 +0800 Subject: [PATCH] swip toolController --- app/Http/Controllers/ToolController.php | 32 ------------------------- 1 file changed, 32 deletions(-) diff --git a/app/Http/Controllers/ToolController.php b/app/Http/Controllers/ToolController.php index db7e2cc2..18ad54c9 100644 --- a/app/Http/Controllers/ToolController.php +++ b/app/Http/Controllers/ToolController.php @@ -24,42 +24,10 @@ class ToolController extends Controller return $this->success($result); } - public function tgBot(): string - { - $token = "xxxxxx"; - $telegram = new Api($token); - $commandHelp = new HelpCommand(); - $commandBind = new TgCommandBind(); - $telegram->addCommand($commandHelp); - $telegram->addCommand($commandBind); - $update = $telegram->commandsHandler(true); - return 'OK'; - } public function test(Request $request) { - $token = "xxxxxx"; - $telegram = new Api($token); -// $response = $telegram->getMe(); -// $response = $telegram->sendMessage([ -// "chat_id" => "-4170177008", -// "text" => "Comes from xiaomlove!", -// ]); - $commandHelp = new HelpCommand(); - $commandBind = new TgCommandBind(); - - $commands = [ - ['command' => $commandHelp->getName(), 'description' => $commandHelp->getDescription()], - ['command' => $commandBind->getName(), 'description' => $commandBind->getDescription()], - ]; - $response = $telegram->setMyCommands([ - "commands" => json_encode($commands) - ]); -// $response = $telegram->setWebhook(['url' => 'https://dev.nexusphp.org/nexusphp-tgbot/webhook']); - -// $response = $telegram->getWebhookUpdate(); - dd($response); } }