Skip to content

Commit b81033a

Browse files
irazasyedgithub-actions[bot]
authored andcommitted
Fix styling
1 parent 0f112bc commit b81033a

File tree

3 files changed

+25
-26
lines changed

3 files changed

+25
-26
lines changed

routes/telegram.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@
88

99
Route::post('/{token}/{bot}', config('telegram.webhook.controller'))->name('telegram.bot.webhook');
1010

11-
// # Longpolling method (manual).
12-
// Route::get('/{token}/updates/{bot?}', function ($bot = 'default') {
13-
// # This method will fetch updates,
14-
// # fire relevant events and,
15-
// # confirm we've received the updates with Telegram.
16-
//
17-
// $updates = Telegram::bot($bot)->listen();
18-
//
19-
// # You can do something with the fetched array of update objects.
20-
//
21-
// # NOTE: You won't be able to fetch updates if a webhook is set.
22-
// # Remove webhook before using this method.
23-
// })->name('telegram.bot.updates');
11+
// # Longpolling method (manual).
12+
// Route::get('/{token}/updates/{bot?}', function ($bot = 'default') {
13+
// # This method will fetch updates,
14+
// # fire relevant events and,
15+
// # confirm we've received the updates with Telegram.
16+
//
17+
// $updates = Telegram::bot($bot)->listen();
18+
//
19+
// # You can do something with the fetched array of update objects.
20+
//
21+
// # NOTE: You won't be able to fetch updates if a webhook is set.
22+
// # Remove webhook before using this method.
23+
// })->name('telegram.bot.updates');
2424
});

src/Events/WebhookFailed.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace Telegram\Bot\Laravel\Events;
44

55
use Telegram\Bot\Objects\ResponseObject;
6-
use Telegram\Bot\Objects\Update;
76
use Throwable;
87

98
/**

src/Http/Controllers/WebhookController.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,20 @@ class WebhookController extends Controller
2626
public function __invoke(BotManager $manager, string $token, string $bot)
2727
{
2828
App::terminating(static function () use ($manager, $bot): void {
29-
try {
30-
$manager->bot($bot)->listen(true);
31-
} catch (Throwable $e) {
32-
$telegram = $manager->bot($bot);
29+
try {
30+
$manager->bot($bot)->listen(true);
31+
} catch (Throwable $e) {
32+
$telegram = $manager->bot($bot);
3333

34-
$telegram->getEventFactory()->dispatch(
35-
WebhookFailed::NAME,
36-
new WebhookFailed($bot, $telegram->getWebhookUpdate(), $e)
37-
);
34+
$telegram->getEventFactory()->dispatch(
35+
WebhookFailed::NAME,
36+
new WebhookFailed($bot, $telegram->getWebhookUpdate(), $e)
37+
);
3838

39-
if (! $telegram->getEventFactory()->hasListeners(WebhookFailed::NAME)) {
40-
throw WebhookException::failedToListenToUpdate($e->getMessage(), $e);
41-
}
42-
}
39+
if (! $telegram->getEventFactory()->hasListeners(WebhookFailed::NAME)) {
40+
throw WebhookException::failedToListenToUpdate($e->getMessage(), $e);
41+
}
42+
}
4343
});
4444

4545
return response()->noContent();

0 commit comments

Comments
 (0)