Skip to content

Commit

Permalink
Merge pull request #438 from BoShurik/allowed-update-types
Browse files Browse the repository at this point in the history
Fix phpDoc for $allowedUpdates parameters
  • Loading branch information
BoShurik authored Jun 27, 2023
2 parents a829ef4 + 100fd4e commit ead0e4d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ All Notable changes to `PHP Telegram Bot Api` will be documented in this file
- Rename `thumb` to `thumbnail` parameter in `Animation`, `Document`, `Sticker`, `StickerSet`, `Video`, `VideoNote` types
- Rename `thumb_*` to `thumbnail_*` parameter in `Inline/QueryResult` types
- Add missing phpDoc for `$replyMarkup` parameters
-
- Fix phpDoc for `\TelegramBot\Api\BotApi::setWebhook` `$allowedUpdates` parameter. Automatically serialize if array passed

### Deprecated
- Deprecate using `thumb*` methods in `\TelegramBot\Api\BotApi`
- Deprecate method `\TelegramBot\Api\BotApi::setStickerSetThumb`. Use `\TelegramBot\Api\BotApi::setStickerSetThumbnail` instead
Expand Down
16 changes: 8 additions & 8 deletions src/BotApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -527,13 +527,13 @@ public function getUserProfilePhotos($userId, $offset = 0, $limit = 100)
* @param int|null $maxConnections The maximum allowed number of simultaneous HTTPS connections to the webhook
* for update delivery, 1-100. Defaults to 40. Use lower values to limit
* the load on your bot's server, and higher values to increase your bot's throughput.
* @param array|null $allowedUpdates A JSON-serialized list of the update types you want your bot to receive.
* For example, specify [“message”, “edited_channel_post”, “callback_query”]
* to only receive updates of these types. See Update for a complete list of available update types.
* Specify an empty list to receive all update types except chat_member (default).
* If not specified, the previous setting will be used.
* Please note that this parameter doesn't affect updates created before the call to the setWebhook,
* so unwanted updates may be received for a short period of time.
* @param array|string|null $allowedUpdates A JSON-serialized list of the update types you want your bot to receive.
* For example, specify [“message”, “edited_channel_post”, “callback_query”]
* to only receive updates of these types. See Update for a complete list of available update types.
* Specify an empty list to receive all update types except chat_member (default).
* If not specified, the previous setting will be used.
* Please note that this parameter doesn't affect updates created before the call to the setWebhook,
* so unwanted updates may be received for a short period of time.
* @param bool|null $dropPendingUpdates Pass True to drop all pending updates
* @param string|null $secretToken A secret token to be sent in a header “X-Telegram-Bot-Api-Secret-Token” in every webhook request,
* 1-256 characters. Only characters A-Z, a-z, 0-9, _ and - are allowed.
Expand All @@ -557,7 +557,7 @@ public function setWebhook(
'certificate' => $certificate,
'ip_address' => $ipAddress,
'max_connections' => $maxConnections,
'allowed_updates' => $allowedUpdates,
'allowed_updates' => \is_array($allowedUpdates) ? json_encode($allowedUpdates) : $allowedUpdates,
'drop_pending_updates' => $dropPendingUpdates,
'secret_token' => $secretToken
]);
Expand Down

0 comments on commit ead0e4d

Please sign in to comment.