Skip to content

Commit

Permalink
📝 (TelegramWebhook.php): Comment out unused Telegram facade to improv…
Browse files Browse the repository at this point in the history
…e code cleanliness

📝 (SendTelegram.php): Comment out debug code to improve code readability
🚀 (TelegramNotificationController.wip): Add new controller for handling Telegram notifications
📝 (api.php): Comment out WIP code related to Telegram notifications to prevent it from being executed
  • Loading branch information
marco76tv committed Jul 12, 2024
1 parent 4f2e04b commit 9128c15
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
7 changes: 4 additions & 3 deletions Console/Commands/TelegramWebhook.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
}
}
3 changes: 2 additions & 1 deletion Filament/Clusters/Test/Pages/SendTelegram.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
[
Expand Down
2 changes: 2 additions & 0 deletions Routes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

declare(strict_types=1);

/* --- WORK IN PROGRESS
use Modules\Notify\Http\Controllers\TelegramNotificationController;
Route::middleware('guest')->group(function () {
Expand All @@ -11,3 +12,4 @@
Route::get('/telegram/webhook/',
[TelegramNotificationController::class, 'view'])->middleware('api');
});
*/

0 comments on commit 9128c15

Please sign in to comment.