Skip to content

Commit 998de91

Browse files
authored
Merge pull request #1226 from TiiFuchs/drop_pending_updates
Fixed non-working drop_pending_updates in setWebhook and deleteWebhook
2 parents ed2df60 + 385e7f3 commit 998de91

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/Request.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ public static function send(string $action, array $data = []): ServerResponse
665665
*/
666666
protected static function addDummyParamIfNecessary(string $action, array &$data): void
667667
{
668-
if (in_array($action, self::$actions_need_dummy_param, true)) {
668+
if (empty($data) && in_array($action, self::$actions_need_dummy_param, true)) {
669669
// Can be anything, using a single letter to minimise request size.
670670
$data = ['d'];
671671
}

src/Telegram.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,8 +1027,10 @@ public function setWebhook(string $url, array $data = []): ServerResponse
10271027

10281028
$data = array_intersect_key($data, array_flip([
10291029
'certificate',
1030+
'ip_address',
10301031
'max_connections',
10311032
'allowed_updates',
1033+
'drop_pending_updates'
10321034
]));
10331035
$data['url'] = $url;
10341036

0 commit comments

Comments
 (0)