Skip to content

Accept chat ID as integer and string for request limiter counter #1182

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
### Fixed
- `getUpdates` method wrongly sends only 1 Update when a limit of 0 is passed.
- `Telegram::runCommands()` now passes the correct message text to the commands.
- Request limiter accepts chat ID as integer and string.
### Security

## [0.70.1] - 2020-12-25
Expand Down
6 changes: 3 additions & 3 deletions src/DB.php
Original file line number Diff line number Diff line change
Expand Up @@ -1259,13 +1259,13 @@ public static function selectChats($select_chats_params)
/**
* Get Telegram API request count for current chat / message
*
* @param int|null $chat_id
* @param string|null $inline_message_id
* @param int|string|null $chat_id
* @param string|null $inline_message_id
*
* @return array|bool Array containing TOTAL and CURRENT fields or false on invalid arguments
* @throws TelegramException
*/
public static function getTelegramRequestCount(int $chat_id = null, string $inline_message_id = null)
public static function getTelegramRequestCount($chat_id = null, string $inline_message_id = null)
{
if (!self::isDbConnected()) {
return false;
Expand Down