From 9128c15b76e8264b734e3659d41e1ce5d0fef180 Mon Sep 17 00:00:00 2001 From: marco Date: Fri, 12 Jul 2024 15:30:49 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20(TelegramWebhook.php):=20Comment?= =?UTF-8?q?=20out=20unused=20Telegram=20facade=20to=20improve=20code=20cle?= =?UTF-8?q?anliness=20=F0=9F=93=9D=20(SendTelegram.php):=20Comment=20out?= =?UTF-8?q?=20debug=20code=20to=20improve=20code=20readability=20?= =?UTF-8?q?=F0=9F=9A=80=20(TelegramNotificationController.wip):=20Add=20ne?= =?UTF-8?q?w=20controller=20for=20handling=20Telegram=20notifications=20?= =?UTF-8?q?=F0=9F=93=9D=20(api.php):=20Comment=20out=20WIP=20code=20relate?= =?UTF-8?q?d=20to=20Telegram=20notifications=20to=20prevent=20it=20from=20?= =?UTF-8?q?being=20executed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Console/Commands/TelegramWebhook.php | 7 ++++--- Filament/Clusters/Test/Pages/SendTelegram.php | 3 ++- ...onController.php => TelegramNotificationController.wip} | 0 Routes/api.php | 2 ++ 4 files changed, 8 insertions(+), 4 deletions(-) rename Http/Controllers/{TelegramNotificationController.php => TelegramNotificationController.wip} (100%) diff --git a/Console/Commands/TelegramWebhook.php b/Console/Commands/TelegramWebhook.php index 160f8a76..45dc5dbd 100644 --- a/Console/Commands/TelegramWebhook.php +++ b/Console/Commands/TelegramWebhook.php @@ -5,15 +5,16 @@ namespace Modules\Notify\Console\Commands; use Illuminate\Console\Command; -use Telegram\Bot\Laravel\Facades\Telegram; + +// use Telegram\Bot\Laravel\Facades\Telegram; class TelegramWebhook extends Command { protected $signature = 'telegram:set-webhook'; protected $description = 'Set Telegram webhook URL'; - public function handle() + public function handle(): void { - Telegram::setWebhook(['url' => 'https://2c0f-79-20-174-54.ngrok-free.app/api/telegram/webhook']); + // Telegram::setWebhook(['url' => 'https://2c0f-79-20-174-54.ngrok-free.app/api/telegram/webhook']); } } diff --git a/Filament/Clusters/Test/Pages/SendTelegram.php b/Filament/Clusters/Test/Pages/SendTelegram.php index 371582b9..56ba7f82 100755 --- a/Filament/Clusters/Test/Pages/SendTelegram.php +++ b/Filament/Clusters/Test/Pages/SendTelegram.php @@ -49,12 +49,13 @@ public function mount(): void public function emailForm(Form $form): Form { + /* dddx($response = Telegram::getMe()); $response = $telegram->sendMessage([ 'chat_id' => 'CHAT_ID', 'text' => 'Hello World', ]); - + */ return $form ->schema( [ diff --git a/Http/Controllers/TelegramNotificationController.php b/Http/Controllers/TelegramNotificationController.wip similarity index 100% rename from Http/Controllers/TelegramNotificationController.php rename to Http/Controllers/TelegramNotificationController.wip diff --git a/Routes/api.php b/Routes/api.php index c25032ad..3450637c 100755 --- a/Routes/api.php +++ b/Routes/api.php @@ -2,6 +2,7 @@ declare(strict_types=1); +/* --- WORK IN PROGRESS use Modules\Notify\Http\Controllers\TelegramNotificationController; Route::middleware('guest')->group(function () { @@ -11,3 +12,4 @@ Route::get('/telegram/webhook/', [TelegramNotificationController::class, 'view'])->middleware('api'); }); +*/