Skip to content

Commit ea094df

Browse files
committed
Options to define which update types are allowed for telegram:set-webhook
1 parent 93549a0 commit ea094df

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Console/Commands/TelegramSetWebhookCommand.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ class TelegramSetWebhookCommand extends Command
1111
{
1212
protected $signature = 'telegram:set-webhook
1313
{hostname? : Hostname to set}
14-
{--d|drop-pending-updates : Pass to drop all pending updates}
15-
{--a|all-update-types : Passes all possible update types to allowed_updates}';
14+
{--d|drop-pending-updates : Drop all pending updates}
15+
{--a|all-update-types : Explicitly allow all updates (including "chat_member")}
16+
{--allowed-updates= : Define allowed updates (comma-seperated)}';
1617

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

@@ -42,6 +43,8 @@ public function handle(Telegram $bot)
4243

4344
if ($this->option('all-update-types')) {
4445
$options['allowed_updates'] = Update::getUpdateTypes();
46+
} elseif ($allowedUpdates = $this->option('allowed-updates')) {
47+
$options['allowed_updates'] = str($allowedUpdates)->explode(',');
4548
}
4649

4750
$response = $bot->setWebhook($url, $options);

0 commit comments

Comments
 (0)