Skip to content

Commit 93549a0

Browse files
committed
Revert Migration
1 parent 22c927d commit 93549a0

File tree

2 files changed

+7
-16
lines changed

2 files changed

+7
-16
lines changed

database/migrations/2022_04_20_133600_update_to_0.77.0.php

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/Console/Commands/TelegramSetWebhookCommand.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@
44

55
use Illuminate\Console\Command;
66
use Illuminate\Support\Str;
7+
use Longman\TelegramBot\Entities\Update;
78
use Longman\TelegramBot\Telegram;
89

910
class TelegramSetWebhookCommand extends Command
1011
{
1112
protected $signature = 'telegram:set-webhook
1213
{hostname? : Hostname to set}
13-
{--d|drop-pending-updates : Pass to drop all pending updates}';
14+
{--d|drop-pending-updates : Pass to drop all pending updates}
15+
{--a|all-update-types : Passes all possible update types to allowed_updates}';
1416

1517
protected $description = 'Use this method to specify a url and receive incoming updates via an outgoing webhook';
1618

@@ -38,6 +40,10 @@ public function handle(Telegram $bot)
3840
$options['drop_pending_updates'] = true;
3941
}
4042

43+
if ($this->option('all-update-types')) {
44+
$options['allowed_updates'] = Update::getUpdateTypes();
45+
}
46+
4147
$response = $bot->setWebhook($url, $options);
4248

4349
if (! $response->isOk()) {

0 commit comments

Comments
 (0)