Skip to content

Commit 0197933

Browse files
authored
Merge pull request #1169 from noplanman/fix-getUpdates
Fix getUpdates method to retrieve all updates when no limit is set.
2 parents 4012ff0 + b403a31 commit 0197933

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
1313
### Deprecated
1414
### Removed
1515
### Fixed
16+
- `getUpdates` method wrongly sends only 1 Update when a limit of 0 is passed.
1617
### Security
1718

1819
## [0.70.1] - 2020-12-25

src/Telegram.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -391,13 +391,13 @@ public function getLastCommandResponse(): ServerResponse
391391
/**
392392
* Handle getUpdates method
393393
*
394-
* @param int $limit
395-
* @param int $timeout
394+
* @param int|null $limit
395+
* @param int|null $timeout
396396
*
397397
* @return ServerResponse
398398
* @throws TelegramException
399399
*/
400-
public function handleGetUpdates(int $limit = 0, int $timeout = 0): ServerResponse
400+
public function handleGetUpdates(?int $limit = null, ?int $timeout = null): ServerResponse
401401
{
402402
if (empty($this->bot_username)) {
403403
throw new TelegramException('Bot Username is not defined!');

0 commit comments

Comments
 (0)