File tree Expand file tree Collapse file tree 2 files changed +7
-16
lines changed
Expand file tree Collapse file tree 2 files changed +7
-16
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 44
55use Illuminate \Console \Command ;
66use Illuminate \Support \Str ;
7+ use Longman \TelegramBot \Entities \Update ;
78use Longman \TelegramBot \Telegram ;
89
910class 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 ()) {
You can’t perform that action at this time.
0 commit comments