Skip to content

Commit

Permalink
Version 1.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
noplanman committed Jun 14, 2021
1 parent e95c8d6 commit 0186409
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 7 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ jobs:
fast_finish: true

notifications:
on_success: never
on_failure: always
email:
on_success: never
on_failure: always
webhooks:
on_success: always
urls:
Expand Down
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,25 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
### Notes
- [:ledger: View file changes][Unreleased]
### Added
- Allow webhook to contain custom query parameters.
### Changed
### Deprecated
### Removed
### Fixed
### Security

## [1.7.0] - 2021-06-14
### Notes
- [:ledger: View file changes][1.7.0]
### Changed
- Bumped core to version 0.73.*.
### Fixed
- `chat_id` output for `getUpdates` method. (#65)

## [1.6.0] - 2020-12-26
### Notes
- [:ledger: View file changes][1.6.0]
### Added
- Allow webhook to contain custom query parameters. (#59)
### Changed
- Upgraded dependencies and bumped core to version 0.70.*.
- Upgrade code to PHP 7.3.
Expand Down Expand Up @@ -204,6 +213,7 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
[0.44.0-bc-parameter-structure]: https://github.com/php-telegram-bot/telegram-bot-manager/wiki/Breaking-backwards-compatibility#parameter-structure-changed "Parameter structure changed"

[Unreleased]: https://github.com/php-telegram-bot/telegram-bot-manager/compare/master...develop
[1.7.0]: https://github.com/php-telegram-bot/telegram-bot-manager/compare/1.6.0...1.7.0
[1.6.0]: https://github.com/php-telegram-bot/telegram-bot-manager/compare/1.5.0...1.6.0
[1.5.0]: https://github.com/php-telegram-bot/telegram-bot-manager/compare/1.4.0...1.5.0
[1.4.0]: https://github.com/php-telegram-bot/telegram-bot-manager/compare/1.3.0...1.4.0
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
],
"require": {
"php": "^7.3|^8.0",
"longman/telegram-bot": "^0.70",
"longman/telegram-bot": "^0.73",
"longman/ip-tools": "^1.2",
"psr/log": "^1.1"
},
Expand Down
11 changes: 8 additions & 3 deletions src/BotManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@

class BotManager
{
public const VERSION = '1.7.0';

/**
* @link https://core.telegram.org/bots/webhooks#the-short-version
* @var array Telegram webhook servers IP ranges
Expand Down Expand Up @@ -503,12 +505,15 @@ protected function defaultGetUpdatesCallback($get_updates_response): string
} elseif ($update_content instanceof CallbackQuery) {
/** @var CallbackQuery $update_content */
$message = $update_content->getMessage();
$chat_id = ($message && $message->getChat()) ? $message->getChat()->getId() : null;
$text .= ";{$update_content->getData()}";
if ($message && $message->getChat()) {
$chat_id = $message->getChat()->getId();
}

$text .= ";{$update_content->getData()}";
}

$output .= sprintf(
'%d: <%s>' . PHP_EOL,
'%s: <%s>' . PHP_EOL,
$chat_id,
preg_replace('/\s+/', ' ', trim($text))
);
Expand Down

0 comments on commit 0186409

Please sign in to comment.