You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update processing can be allowed or denied by defining a custom update filter.
344
+
:exclamation: Note that by default, Telegram will send any new update types that may be added in the future. This may cause commands that don't take this into account to break!
345
345
346
-
Let's say we only want to allow messages from a user with ID `428`, we can do the following before handling the request:
346
+
It is suggested that you specifically define which update types your bot can receive and handle correctly.
The reason for denying an update can be defined with the `$reason` parameter. This text gets written to the debug log.
361
-
362
-
Alternatively, you can define which update types are handled by your bot, by defining them when setting the [webhook](#webhook-installation) or passing an array of allowed types when using [getUpdates](#getupdates-installation).
348
+
You can define which update types are sent to your bot by defining them when setting the [webhook](#webhook-installation) or passing an array of allowed types when using [getUpdates](#getupdates-installation).
363
349
364
350
```php
365
351
use Longman\TelegramBot\Entities\Update;
366
352
367
-
// Define the list of allowed Update types here.
353
+
// For all update types currently implemented in this library:
354
+
// $allowed_updates = Update::getUpdateTypes();
355
+
356
+
// Define the list of allowed Update types manually:
0 commit comments