Unverified Commit f85bb01e authored by Armando Lüscher's avatar Armando Lüscher Committed by GitHub

Merge pull request #981 from noplanman/update_readme_changelog

Update README and CHANGELOG
parents d5b93073 ddf57294
...@@ -6,6 +6,8 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c ...@@ -6,6 +6,8 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
## [Unreleased] ## [Unreleased]
### Added ### Added
### Changed ### Changed
- Touched up readme including header and badges.
- Updated changelog to be more useful for external integrations like [Tidelift] and GitHub releases.
### Deprecated ### Deprecated
### Removed ### Removed
- Abstract methods from `InputMedia` interface, as method annotations didn't work for propagation. - Abstract methods from `InputMedia` interface, as method annotations didn't work for propagation.
...@@ -13,7 +15,9 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c ...@@ -13,7 +15,9 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
### Security ### Security
## [0.58.0] - 2019-06-26 ## [0.58.0] - 2019-06-26
:exclamation: After updating to this version, you will need to execute the [SQL migration script][0.58.0-sql-migration] on your database. ### Notes
- [:ledger: View full changelog][0.58.0][:page_with_curl: DB migration script][0.58.0-sql-migration]
- Logging now uses [PSR-3] `LoggerInterface`. Learn more about how to use it here: #964
### Added ### Added
- New funding and support details. (#971) - New funding and support details. (#971)
- Custom issue templates. (#972) - Custom issue templates. (#972)
...@@ -34,13 +38,16 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c ...@@ -34,13 +38,16 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
- Broken `StickerSet::getStickers()` method. (#969) - Broken `StickerSet::getStickers()` method. (#969)
- Smaller code and docblock fixes. (#973) - Smaller code and docblock fixes. (#973)
### Security ### Security
- Security disclosure managed by Tidelift. (#971) - Security disclosure managed by [Tidelift]. (#971)
- Don't allow a user to call system commands directly. (#970) - Don't allow a user to call system commands directly. (#970)
## [0.57.0] - 2019-06-01 ## [0.57.0] - 2019-06-01
:exclamation: After updating to this version, you will need to execute the [SQL migration script][0.57.0-sql-migration] on your database. ### Notes
- [:ledger: View full changelog][0.57.0][:page_with_curl: DB migration script][0.57.0-sql-migration]
- :grey_exclamation: This is a big update and involves a bunch of MySQL database updates, so please *review the changelog carefully*.
### Added ### Added
- New logo! (#954) - New logo! :tada: (#954)
- Bot API 4.2 (Polls). (#948) - Bot API 4.2 (Polls). (#948)
- `getIsMember()` method to `ChatMember` entity. (#948) - `getIsMember()` method to `ChatMember` entity. (#948)
- `getForwardSenderName()` method to `Message` entity. (#948) - `getForwardSenderName()` method to `Message` entity. (#948)
...@@ -51,8 +58,11 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c ...@@ -51,8 +58,11 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
- Missing DB table name specifier in `/cleanup` command. (#947) - Missing DB table name specifier in `/cleanup` command. (#947)
## [0.56.0] - 2019-04-15 ## [0.56.0] - 2019-04-15
### Notes
- [:ledger: View full changelog][0.56.0][:page_with_curl: DB migration script][0.56.0-sql-migration]
- :grey_exclamation: This is a big update, so please *review the changelog carefully*!
### Added ### Added
- Helper for sending `InputMedia` objects using `Request::sendMediaGroup()` and `Request::editMediaMessage()` methods. (#934) - Helper for sending `InputMedia` objects using `Request::sendMediaGroup()` and `Request::editMediaMessage()` methods.
- Allow passing absolute file path for InputFile fields, instead of `Request::encodeFile($path)`. (#934) - Allow passing absolute file path for InputFile fields, instead of `Request::encodeFile($path)`. (#934)
### Changed ### Changed
- All Message field types dynamically search for an existing Command class that can handle them. (#940) - All Message field types dynamically search for an existing Command class that can handle them. (#940)
...@@ -66,13 +76,16 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c ...@@ -66,13 +76,16 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
- PHPCS: static before visibility declaration. (#945) - PHPCS: static before visibility declaration. (#945)
## [0.55.1] - 2019-01-06 ## [0.55.1] - 2019-01-06
### Notes
- [:ledger: View full changelog][0.55.1]
### Added ### Added
- Add missing `Request::editMessageMedia()` and `CallbackQuery::getChatInstance()` methods. (#916) - Add missing `Request::editMessageMedia()` and `CallbackQuery::getChatInstance()` methods. (#916)
### Fixed ### Fixed
- Return correct message type. (#913) - Return correct message type. (#913)
## [0.55.0] - 2018-12-20 ## [0.55.0] - 2018-12-20
:exclamation: After updating to this version, you will need to execute the [SQL migration script][0.55.0-sql-migration] on your database. ### Notes
- [:ledger: View full changelog][0.55.0][:page_with_curl: DB migration script][0.55.0-sql-migration]
### Added ### Added
- Bot API 4.0 and 4.1 (Telegram Passport) (#870, #871) - Bot API 4.0 and 4.1 (Telegram Passport) (#870, #871)
- Test PHP 7.3 with Travis. (#903) - Test PHP 7.3 with Travis. (#903)
...@@ -82,11 +95,14 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c ...@@ -82,11 +95,14 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
- Added missing `video_note` to `Message` types. - Added missing `video_note` to `Message` types.
## [0.54.1] - 2018-10-23 ## [0.54.1] - 2018-10-23
### Notes
- [:ledger: View full changelog][0.54.1]
### Fixed ### Fixed
- `sendToActiveChats` now works correctly for any valid Request action. (#898) - `sendToActiveChats` now works correctly for any valid Request action. (#898)
## [0.54.0] - 2018-07-21 ## [0.54.0] - 2018-07-21
:exclamation: After updating to this version, you will need to execute the [SQL migration script][0.54.0-sql-migration] on your database. ### Notes
- [:ledger: View full changelog][0.54.0][:page_with_curl: DB migration script][0.54.0-sql-migration]
### Added ### Added
- `ChatAction` class to simplify chat action selection. (#859) - `ChatAction` class to simplify chat action selection. (#859)
- Telegram Games platform! (#732) - Telegram Games platform! (#732)
...@@ -99,7 +115,8 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c ...@@ -99,7 +115,8 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
- Response from `getStickerSet`. (#838) - Response from `getStickerSet`. (#838)
## [0.53.0] - 2018-04-01 ## [0.53.0] - 2018-04-01
:exclamation: After updating to this version, you will need to execute the [SQL migration script][0.53.0-sql-migration] on your database. ### Notes
- [:ledger: View full changelog][0.53.0][:page_with_curl: DB migration script][0.53.0-sql-migration]
### Added ### Added
- Implemented new changes for Bot API 3.6 (streamable InputMediaVideo, connected website). (#799) - Implemented new changes for Bot API 3.6 (streamable InputMediaVideo, connected website). (#799)
- `Telegram::getLastUpdateId()` method, returns ID of the last update that was processed. (#767) - `Telegram::getLastUpdateId()` method, returns ID of the last update that was processed. (#767)
...@@ -114,17 +131,22 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c ...@@ -114,17 +131,22 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
- Send messages correctly via `/sendtochannel`. (#803) - Send messages correctly via `/sendtochannel`. (#803)
## [0.52.0] - 2018-01-07 ## [0.52.0] - 2018-01-07
### Notes
- [:ledger: View full changelog][0.52.0]
### Fixed ### Fixed
- Entity relations and wrong types for payments. (#731) - Entity relations and wrong types for payments. (#731)
- Allow empty string for `switch_inline_query` and `switch_inline_query_current_chat` (InlineKeyboardButton). (#736) - Allow empty string for `switch_inline_query` and `switch_inline_query_current_chat` (InlineKeyboardButton). (#736)
- Fix empty date entry for User and Chat entities, using the current timestamp instead. (#738) - Fix empty date entry for User and Chat entities, using the current timestamp instead. (#738)
## [0.51.0] - 2017-12-05 ## [0.51.0] - 2017-12-05
:exclamation: After updating to this version, you will need to execute the [SQL migration script][0.51.0-sql-migration] on your database. ### Notes
- [:ledger: View full changelog][0.51.0][:page_with_curl: DB migration script][0.51.0-sql-migration]
### Added ### Added
- Implemented new changes for Bot API 3.5 (InputMedia, MediaGroup). (#718) - Implemented new changes for Bot API 3.5 (InputMedia, MediaGroup). (#718)
## [0.50.0] - 2017-10-17 ## [0.50.0] - 2017-10-17
### Notes
- [:ledger: View full changelog][0.50.0]
### Added ### Added
- Finish implementing payments, adding all missing type checks and docblock methods. (#647) - Finish implementing payments, adding all missing type checks and docblock methods. (#647)
- Implemented new changes for Bot API 3.4 (Live Locations). (#675) - Implemented new changes for Bot API 3.4 (Live Locations). (#675)
...@@ -136,6 +158,8 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c ...@@ -136,6 +158,8 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
- Check inline keyboard button parameter value correctly. (#672) - Check inline keyboard button parameter value correctly. (#672)
## [0.49.0] - 2017-09-17 ## [0.49.0] - 2017-09-17
### Notes
- [:ledger: View full changelog][0.49.0]
### Added ### Added
- Donation section and links in readme. - Donation section and links in readme.
- Missing payment methods in `Request` class. - Missing payment methods in `Request` class.
...@@ -147,7 +171,8 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c ...@@ -147,7 +171,8 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
- Channel selection when using `DB::selectChats()`. - Channel selection when using `DB::selectChats()`.
## [0.48.0] - 2017-08-26 ## [0.48.0] - 2017-08-26
:exclamation: After updating to this version, you will need to execute the [SQL migration script][0.48.0-sql-migration] on your database. ### Notes
- [:ledger: View full changelog][0.48.0][:page_with_curl: DB migration script][0.48.0-sql-migration]
### Added ### Added
- New entities, methods, update types and inline keyboard button for Payments (Bot API 3.0). - New entities, methods, update types and inline keyboard button for Payments (Bot API 3.0).
- Add new methods, fields and objects for working with stickers (Bot API 3.2). - Add new methods, fields and objects for working with stickers (Bot API 3.2).
...@@ -159,12 +184,16 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c ...@@ -159,12 +184,16 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
- Correctly save `reply_to_message` to DB. - Correctly save `reply_to_message` to DB.
## [0.47.1] - 2017-08-06 ## [0.47.1] - 2017-08-06
### Notes
- [:ledger: View full changelog][0.47.1]
### Added ### Added
- Linked version numbers in changelog for easy verification of code changes. - Linked version numbers in changelog for easy verification of code changes.
### Fixed ### Fixed
- Private-only commands work with edited messages now too. - Private-only commands work with edited messages now too.
## [0.47.0] - 2017-08-06 [YANKED] ## [0.47.0] - 2017-08-06 [YANKED]
### Notes
- [:ledger: View full changelog][0.47.0]
### Changed ### Changed
- Updated readme to latest state of 0.47.0. - Updated readme to latest state of 0.47.0.
### Fixed ### Fixed
...@@ -174,6 +203,8 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c ...@@ -174,6 +203,8 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
- [:exclamation:][0.47.0-bc-private-only-admin-commands] New command parameter `$private_only` to enforce usage in private chats only (set by default for Admin commands). - [:exclamation:][0.47.0-bc-private-only-admin-commands] New command parameter `$private_only` to enforce usage in private chats only (set by default for Admin commands).
## [0.46.0] - 2017-07-15 ## [0.46.0] - 2017-07-15
### Notes
- [:ledger: View full changelog][0.46.0]
### Added ### Added
- Callbacks can be added to be executed when callback queries are called. - Callbacks can be added to be executed when callback queries are called.
- New Bot API 3.1 changes (#550). - New Bot API 3.1 changes (#550).
...@@ -182,7 +213,8 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c ...@@ -182,7 +213,8 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
- [:exclamation:][0.46.0-bc-request-class-refactor] Big refactor of the `Request` class, removing most custom method implementations. - [:exclamation:][0.46.0-bc-request-class-refactor] Big refactor of the `Request` class, removing most custom method implementations.
## [0.45.0] - 2017-06-25 ## [0.45.0] - 2017-06-25
:exclamation: After updating to this version, you will need to execute the [SQL migration script][0.45.0-sql-migration] on your database. ### Notes
- [:ledger: View full changelog][0.45.0][:page_with_curl: DB migration script][0.45.0-sql-migration]
### Added ### Added
- Documents can be sent by providing its contents via Psr7 stream (as opposed to passing a file path). - Documents can be sent by providing its contents via Psr7 stream (as opposed to passing a file path).
- Allow setting a custom Guzzle HTTP Client for requests (#511). - Allow setting a custom Guzzle HTTP Client for requests (#511).
...@@ -203,10 +235,14 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c ...@@ -203,10 +235,14 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
- Request limiter has been fixed to correctly support channels. - Request limiter has been fixed to correctly support channels.
## [0.44.1] - 2017-04-25 ## [0.44.1] - 2017-04-25
### Notes
- [:ledger: View full changelog][0.44.1]
### Fixed ### Fixed
- Erroneous exception when using webhook without a database connection. - Erroneous exception when using webhook without a database connection.
## [0.44.0] - 2017-04-25 ## [0.44.0] - 2017-04-25
### Notes
- [:ledger: View full changelog][0.44.0]
### Added ### Added
- Proper standalone `scrutinizer.yml` config. - Proper standalone `scrutinizer.yml` config.
- Human-readable `last_error_date_string` for debug command. - Human-readable `last_error_date_string` for debug command.
...@@ -218,6 +254,8 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c ...@@ -218,6 +254,8 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
- [:exclamation:][0.44.0-bc-update-content-type] Format of Update content type using `$update->getUpdateContent()`. - [:exclamation:][0.44.0-bc-update-content-type] Format of Update content type using `$update->getUpdateContent()`.
## [0.43.0] - 2017-04-17 ## [0.43.0] - 2017-04-17
### Notes
- [:ledger: View full changelog][0.43.0]
### Added ### Added
- Travis CI webhook for Support Bot. - Travis CI webhook for Support Bot.
- Interval for request limiter. - Interval for request limiter.
...@@ -231,6 +269,8 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c ...@@ -231,6 +269,8 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
- Prevent handling the same Telegram updates multiple times, throw exception instead. - Prevent handling the same Telegram updates multiple times, throw exception instead.
## [0.42.0] - 2017-04-09 ## [0.42.0] - 2017-04-09
### Notes
- [:ledger: View full changelog][0.42.0]
### Added ### Added
- Added `getBotId()` to directly access bot ID. - Added `getBotId()` to directly access bot ID.
### Changed ### Changed
...@@ -241,22 +281,30 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c ...@@ -241,22 +281,30 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
- Tests are more reliable now, using a properly formatted API key. - Tests are more reliable now, using a properly formatted API key.
## [0.41.0] - 2017-03-25 ## [0.41.0] - 2017-03-25
### Notes
- [:ledger: View full changelog][0.41.0]
### Added ### Added
- `$show_in_help` attribute for commands, to set if it should be displayed in the `/help` command. - `$show_in_help` attribute for commands, to set if it should be displayed in the `/help` command.
- Link to new Telegram group: `https://telegram.me/PHP_Telegram_Bot_Support` - Link to new Telegram group: `https://telegram.me/PHP_Telegram_Bot_Support`
- Introduce change log. - Introduce change log.
## [0.40.1] - 2017-03-07 ## [0.40.1] - 2017-03-07
### Notes
- [:ledger: View full changelog][0.40.1]
### Fixed ### Fixed
- Infinite message loop, caused by incorrect Entity variable. - Infinite message loop, caused by incorrect Entity variable.
## [0.40.0] - 2017-02-20 ## [0.40.0] - 2017-02-20
### Notes
- [:ledger: View full changelog][0.40.0]
### Added ### Added
- Request limiter for incoming requests. - Request limiter for incoming requests.
### Fixed ### Fixed
- Faulty formatting in logger. - Faulty formatting in logger.
## [0.39.0] - 2017-01-20 ## [0.39.0] - 2017-01-20
### Notes
- [:ledger: View full changelog][0.39.0]
### Added ### Added
- Newest bot API changes. - Newest bot API changes.
- Allow direct access to PDO object (`DB::getPdo()`). - Allow direct access to PDO object (`DB::getPdo()`).
...@@ -269,10 +317,14 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c ...@@ -269,10 +317,14 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
- Various bugs and recommendations by Scrutinizer. - Various bugs and recommendations by Scrutinizer.
## [0.38.1] - 2016-12-25 ## [0.38.1] - 2016-12-25
### Notes
- [:ledger: View full changelog][0.38.1]
### Fixed ### Fixed
- Usage of self-signed certificates in conjunction with the new `allowed_updates` webhook parameter. - Usage of self-signed certificates in conjunction with the new `allowed_updates` webhook parameter.
## [0.38.0] - 2016-12-25 ## [0.38.0] - 2016-12-25
### Notes
- [:ledger: View full changelog][0.38.0]
### Added ### Added
- New `switch_inline_query_current_chat` option for inline keyboard. - New `switch_inline_query_current_chat` option for inline keyboard.
- Support for `channel_post` and `edited_channel_post`. - Support for `channel_post` and `edited_channel_post`.
...@@ -281,17 +333,21 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c ...@@ -281,17 +333,21 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
- Update WebhookInfo entity and `setWebhook` to allow passing of new arguments. - Update WebhookInfo entity and `setWebhook` to allow passing of new arguments.
## [0.37.1] - 2016-12-24 ## [0.37.1] - 2016-12-24
### Notes
- [:ledger: View full changelog][0.37.1]
### Fixed ### Fixed
- Keyboards that are built without using the KeyboardButton objects. - Keyboards that are built without using the KeyboardButton objects.
- Commands that are called via `/command@botname` by correctly passing them the bot name. - Commands that are called via `/command@botname` by correctly passing them the bot name.
## [0.37.0] - 2016-12-13 ## [0.37.0] - 2016-12-13
### Notes
- [:ledger: View full changelog][0.37.0]
### Changed ### Changed
- Logging improvements to Botan integration. - Logging improvements to Botan integration.
### Deprecated ### Deprecated
- Move `hideKeyboard` to `removeKeyboard`. - Move `hideKeyboard` to `removeKeyboard`.
[0.58.0-sql-migration]: https://github.com/php-telegram-bot/core/tree/develop/utils/db-schema-update/0.57.0-0.58.0.sql [0.58.0-sql-migration]: https://github.com/php-telegram-bot/core/tree/master/utils/db-schema-update/0.57.0-0.58.0.sql
[0.58.0-bc-return-value-of-empty-entity-properties]: https://github.com/php-telegram-bot/core/wiki/Breaking-backwards-compatibility#return-value-of-empty-entity-properties [0.58.0-bc-return-value-of-empty-entity-properties]: https://github.com/php-telegram-bot/core/wiki/Breaking-backwards-compatibility#return-value-of-empty-entity-properties
[0.58.0-bc-startcommand-is-now-a-usercommand]: https://github.com/php-telegram-bot/core/wiki/Breaking-backwards-compatibility#startcommand-is-now-a-usercommand [0.58.0-bc-startcommand-is-now-a-usercommand]: https://github.com/php-telegram-bot/core/wiki/Breaking-backwards-compatibility#startcommand-is-now-a-usercommand
[0.57.0-sql-migration]: https://github.com/php-telegram-bot/core/tree/master/utils/db-schema-update/0.56.0-0.57.0.sql [0.57.0-sql-migration]: https://github.com/php-telegram-bot/core/tree/master/utils/db-schema-update/0.56.0-0.57.0.sql
...@@ -313,6 +369,7 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c ...@@ -313,6 +369,7 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
[0.44.0-bc-update-content-type]: https://github.com/php-telegram-bot/core/wiki/Breaking-backwards-compatibility#update-getupdatecontent [0.44.0-bc-update-content-type]: https://github.com/php-telegram-bot/core/wiki/Breaking-backwards-compatibility#update-getupdatecontent
[example-bot]: https://github.com/php-telegram-bot/example-bot [example-bot]: https://github.com/php-telegram-bot/example-bot
[PSR-3]: https://www.php-fig.org/psr/psr-3 [PSR-3]: https://www.php-fig.org/psr/psr-3
[Tidelift]: https://tidelift.com/subscription/pkg/packagist-longman-telegram-bot?utm_source=packagist-longman-telegram-bot&utm_medium=referral&utm_campaign=changelog
[Unreleased]: https://github.com/php-telegram-bot/core/compare/master...develop [Unreleased]: https://github.com/php-telegram-bot/core/compare/master...develop
[0.58.0]: https://github.com/php-telegram-bot/core/compare/0.57.0...0.58.0 [0.58.0]: https://github.com/php-telegram-bot/core/compare/0.57.0...0.58.0
......
<img src="assets/logo/512px/logo_plain.png" title="PHP Telegram Bot" alt="PHP Telegram Bot logo"> <h1 align="center">
PHP Telegram Bot<br>
<br>
<img src="assets/logo/512px/logo_plain.png" title="PHP Telegram Bot" alt="PHP Telegram Bot logo">
<br>
</h1>
# PHP Telegram Bot A Telegram Bot based on the official [Telegram Bot API]
A Telegram Bot based on the official [Telegram Bot API][Telegram-Bot-API] [![API Version](https://img.shields.io/badge/Bot%20API-4.3%20%28May%202019%29-32a2da.svg)](https://core.telegram.org/bots/api#may-31-2019)
[![Join the bot support group on Telegram](https://img.shields.io/badge/telegram-@PHP__Telegram__Bot__Support-64659d.svg)](https://telegram.me/PHP_Telegram_Bot_Support)
[![Join the bot support group on Telegram](https://img.shields.io/badge/telegram-@PHP__Telegram__Bot__Support-32a2da.svg)](https://telegram.me/PHP_Telegram_Bot_Support) [![Donate](https://img.shields.io/badge/%F0%9F%92%99-Donate%20%2F%20Support%20Us-blue.svg)](#donate)
[![Donate](https://img.shields.io/badge/%F0%9F%92%99-Donate-blue.svg)](#donate)
[![Build Status](https://travis-ci.org/php-telegram-bot/core.svg?branch=master)](https://travis-ci.org/php-telegram-bot/core) [![Build Status](https://travis-ci.org/php-telegram-bot/core.svg?branch=master)](https://travis-ci.org/php-telegram-bot/core)
[![Dependencies](https://tidelift.com/badges/github/php-telegram-bot/core)][Tidelift] [![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/php-telegram-bot/core/master.svg?style=flat)](https://scrutinizer-ci.com/g/php-telegram-bot/core/?b=master)
[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/php-telegram-bot/core/master.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-telegram-bot/core/?b=master) [![Code Quality](https://img.shields.io/scrutinizer/g/php-telegram-bot/core/master.svg?style=flat)](https://scrutinizer-ci.com/g/php-telegram-bot/core/?b=master)
[![Code Quality](https://img.shields.io/scrutinizer/g/php-telegram-bot/core/master.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-telegram-bot/core/?b=master)
[![Latest Stable Version](https://img.shields.io/packagist/v/longman/telegram-bot.svg)](https://packagist.org/packages/longman/telegram-bot) [![Latest Stable Version](https://img.shields.io/packagist/v/longman/telegram-bot.svg)](https://packagist.org/packages/longman/telegram-bot)
[![Dependencies](https://tidelift.com/badges/github/php-telegram-bot/core?style=flat)][Tidelift]
[![Total Downloads](https://img.shields.io/packagist/dt/longman/telegram-bot.svg)](https://packagist.org/packages/longman/telegram-bot) [![Total Downloads](https://img.shields.io/packagist/dt/longman/telegram-bot.svg)](https://packagist.org/packages/longman/telegram-bot)
[![Downloads Month](https://img.shields.io/packagist/dm/longman/telegram-bot.svg)](https://packagist.org/packages/longman/telegram-bot) [![Downloads Month](https://img.shields.io/packagist/dm/longman/telegram-bot.svg)](https://packagist.org/packages/longman/telegram-bot)
[![Minimum PHP Version](http://img.shields.io/badge/php-%3E%3D5.6-8892BF.svg)](https://php.net/) [![Minimum PHP Version](http://img.shields.io/badge/php-%3E%3D5.6-8892BF.svg)](https://php.net/)
[![License](https://img.shields.io/packagist/l/longman/telegram-bot.svg)](https://github.com/php-telegram-bot/core/LICENSE) [![License](https://img.shields.io/packagist/l/longman/telegram-bot.svg)](https://github.com/php-telegram-bot/core/LICENSE)
![Telegram Bot API Logo](assets/logo/512px/logo_plain.png)
A Telegram Bot based on the official [Telegram Bot API][Telegram-Bot-API]
## Table of Contents ## Table of Contents
- [Introduction](#introduction) - [Introduction](#introduction)
- [Instructions](#instructions) - [Instructions](#instructions)
...@@ -65,61 +65,55 @@ A Telegram Bot based on the official [Telegram Bot API][Telegram-Bot-API] ...@@ -65,61 +65,55 @@ A Telegram Bot based on the official [Telegram Bot API][Telegram-Bot-API]
- [License](#license) - [License](#license)
- [Credits](#credits) - [Credits](#credits)
## Introduction ## Introduction
This is a pure PHP Telegram Bot, fully extensible via plugins. This is a pure PHP Telegram Bot, fully extensible via plugins.
Telegram recently announced official support for a [Bot
API](https://telegram.org/blog/bot-revolution) allowing integrators of Telegram announced official support for a [Bot API](https://telegram.org/blog/bot-revolution), allowing integrators of all sorts to bring automated interactions to the mobile platform.
all sorts to bring automated interactions to the mobile platform. This This Bot aims to provide a platform where one can simply write a bot and have interactions in a matter of minutes.
Bot aims to provide a platform where one can simply write a plugin
and have interactions in a matter of minutes.
The Bot can: The Bot can:
- retrieve updates with webhook and getUpdates methods. - Retrieve updates with [webhook][#webhook-installation] and [getUpdates][#getupdates-installation] methods.
- supports all types and methods according to Telegram API (25 May 2016). - Supports all types and methods according to Telegram API 4.3 (May 2019).
- supports supergroups. - Supports supergroups.
- handle commands in chat with other bots. - Handle commands in chat with other bots.
- manage Channel from the bot admin interface. - Manage Channel from the bot admin interface.
- full support for **inline bots**. - Full support for **inline bots**.
- inline keyboard. - Inline keyboard.
- Messages, InlineQuery and ChosenInlineQuery are stored in the Database. - Messages, InlineQuery and ChosenInlineQuery are stored in the Database.
- Conversation feature - Conversation feature.
---
----- This code is available on [GitHub](https://github.com/php-telegram-bot/core). Pull requests are welcome.
This code is available on
[Github](https://github.com/php-telegram-bot/core). Pull requests are welcome.
## Instructions ## Instructions
### Create your first bot ### Create your first bot
1. Message @botfather https://telegram.me/botfather with the following 1. Message [`@BotFather`](https://telegram.me/BotFather) with the following text: `/newbot`
text: `/newbot`
If you don't know how to message by username, click the search If you don't know how to message by username, click the search field on your Telegram app and type `@BotFather`, where you should be able to initiate a conversation. Be careful not to send it to the wrong contact, because some users have similar usernames to `BotFather`.
field on your Telegram app and type `@botfather`, where you should be able
to initiate a conversation. Be careful not to send it to the wrong
contact, because some users has similar usernames to `botfather`.
![botfather initial conversation](http://i.imgur.com/aI26ixR.png) ![BotFather initial conversation](https://user-images.githubusercontent.com/9423417/60736229-bc2aeb80-9f45-11e9-8d35-5b53145347bc.png)
2. @botfather replies with `Alright, a new bot. How are we going to 2. `@BotFather` replies with:
call it? Please choose a name for your bot.`
```
Alright, a new bot. How are we going to call it? Please choose a name for your bot.
```
3. Type whatever name you want for your bot. 3. Type whatever name you want for your bot.
4. @botfather replies with ```Good. Now let's choose a username for your 4. `@BotFather` replies with:
bot. It must end in `bot`. Like this, for example: TetrisBot or
tetris_bot.``` ```
Good. Now let's choose a username for your bot. It must end in `bot`. Like this, for example: TetrisBot or tetris_bot.
```
5. Type whatever username you want for your bot, minimum 5 characters, 5. Type whatever username you want for your bot, minimum 5 characters, and must end with `bot`. For example: `telesample_bot`
and must end with `bot`. For example: `telesample_bot`
6. @botfather replies with: 6. `@BotFather` replies with:
``` ```
Done! Congratulations on your new bot. You will find it at Done! Congratulations on your new bot. You will find it at
...@@ -136,16 +130,22 @@ and must end with `bot`. For example: `telesample_bot` ...@@ -136,16 +130,22 @@ and must end with `bot`. For example: `telesample_bot`
7. Note down the 'token' mentioned above. 7. Note down the 'token' mentioned above.
8. Type `/setprivacy` to @botfather. *Optionally set the bot privacy:*
![botfather later conversation](http://i.imgur.com/tWDVvh4.png) 1. Send `/setprivacy` to `@BotFather`.
9. @botfather replies with `Choose a bot to change group messages settings.` ![BotFather later conversation](https://user-images.githubusercontent.com/9423417/60736340-26439080-9f46-11e9-970f-8f33bbe39c5f.png)
10. Type (or select) `@telesample_bot` (change to the username you set at step 5 2. `@BotFather` replies with:
```
Choose a bot to change group messages settings.
```
3. Type (or select) `@telesample_bot` (change to the username you set at step 5
above, but start it with `@`) above, but start it with `@`)
11. @botfather replies with 4. `@BotFather` replies with:
``` ```
'Enable' - your bot will only receive messages that either start with the '/' symbol or mention the bot by username. 'Enable' - your bot will only receive messages that either start with the '/' symbol or mention the bot by username.
...@@ -153,14 +153,17 @@ above, but start it with `@`) ...@@ -153,14 +153,17 @@ above, but start it with `@`)
Current status is: ENABLED Current status is: ENABLED
``` ```
12. Type (or select) `Disable` to let your bot receive all messages sent to a 5. Type (or select) `Disable` to let your bot receive all messages sent to a group.
group. This step is up to you actually.
13. @botfather replies with `Success! The new status is: DISABLED. /help` 6. `@BotFather` replies with:
```
Success! The new status is: DISABLED. /help
```
### Require this package with Composer ### Require this package with Composer
Install this package through [Composer][composer]. Install this package through [Composer].
Edit your project's `composer.json` file to require `longman/telegram-bot`. Edit your project's `composer.json` file to require `longman/telegram-bot`.
Create *composer.json* file Create *composer.json* file
...@@ -196,7 +199,7 @@ The bot can handle updates with [**Webhook**](#webhook-installation) or [**getUp ...@@ -196,7 +199,7 @@ The bot can handle updates with [**Webhook**](#webhook-installation) or [**getUp
## Webhook installation ## Webhook installation
Note: For a more detailed explanation, head over to the [example-bot repository][example-bot-repository] and follow the instructions there. Note: For a more detailed explanation, head over to the [example-bot repository] and follow the instructions there.
In order to set a [Webhook][api-setwebhook] you need a server with HTTPS and composer support. In order to set a [Webhook][api-setwebhook] you need a server with HTTPS and composer support.
(For a [self signed certificate](#self-signed-certificate) you need to add some extra code) (For a [self signed certificate](#self-signed-certificate) you need to add some extra code)
...@@ -563,13 +566,13 @@ $telegram->setUploadPath('/your/path/Upload'); ...@@ -563,13 +566,13 @@ $telegram->setUploadPath('/your/path/Upload');
## Documentation ## Documentation
Take a look at the repo [Wiki][wiki] for further information and tutorials! Take a look at the repo [Wiki] for further information and tutorials!
Feel free to improve! Feel free to improve!
## Example bot ## Example bot
We're busy working on a full A-Z example bot, to help get you started with this library and to show you how to use all its features. We're busy working on a full A-Z example bot, to help get you started with this library and to show you how to use all its features.
You can check the progress of the [example bot repository][example-bot-repository]). You can check the progress of the [example-bot repository]).
## Projects with this library ## Projects with this library
...@@ -580,8 +583,7 @@ Here's a list of projects that feats this library, feel free to add yours! ...@@ -580,8 +583,7 @@ Here's a list of projects that feats this library, feel free to add yours!
## Troubleshooting ## Troubleshooting
If you like living on the edge, please report any bugs you find on the If you like living on the edge, please report any bugs you find on the [PHP Telegram Bot issues][issues] page.
[PHP Telegram Bot issues][issues] page.
## Contributing ## Contributing
...@@ -591,10 +593,6 @@ See [CONTRIBUTING](CONTRIBUTING.md) for more information. ...@@ -591,10 +593,6 @@ See [CONTRIBUTING](CONTRIBUTING.md) for more information.
See [SECURITY](SECURITY.md) for more information. See [SECURITY](SECURITY.md) for more information.
## Security
See [SECURITY](SECURITY.md) for more information.
## Donate ## Donate
All work on this bot consists of many hours of coding during our free time, to provide you with a Telegram Bot library that is easy to use and extend. All work on this bot consists of many hours of coding during our free time, to provide you with a Telegram Bot library that is easy to use and extend.
...@@ -615,16 +613,27 @@ Thank you for keeping this project alive :pray: ...@@ -615,16 +613,27 @@ Thank you for keeping this project alive :pray:
## License ## License
Please see the [LICENSE](LICENSE) included in this repository for a full copy of the MIT license, Please see the [LICENSE](LICENSE) included in this repository for a full copy of the MIT license, which this project is licensed under.
which this project is licensed under.
## Credits ## Credits
Credit list in [CREDITS](CREDITS) Credit list in [CREDITS](CREDITS)
[Telegram-Bot-API]: https://core.telegram.org/bots/api "Telegram Bot API" ---
[composer]: https://getcomposer.org/ "Composer"
[example-bot-repository]: https://github.com/php-telegram-bot/example-bot "Example Bot repository" <div align="center">
<b>
<a href="https://tidelift.com/subscription/pkg/packagist-longman-telegram-bot?utm_source=packagist-longman-telegram-bot&utm_medium=referral&utm_campaign=readme-footer">Get professional support for this package with a Tidelift subscription</a>
</b>
<br>
<sub>
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
</sub>
</div>
[Telegram Bot API]: https://core.telegram.org/bots/api "Telegram Bot API"
[Composer]: https://getcomposer.org/ "Composer"
[example-bot repository]: https://github.com/php-telegram-bot/example-bot "Example Bot repository"
[api-setwebhook]: https://core.telegram.org/bots/api#setwebhook "Webhook on Telegram Bot API" [api-setwebhook]: https://core.telegram.org/bots/api#setwebhook "Webhook on Telegram Bot API"
[set.php]: https://github.com/php-telegram-bot/example-bot/blob/master/set.php "example set.php" [set.php]: https://github.com/php-telegram-bot/example-bot/blob/master/set.php "example set.php"
[unset.php]: https://github.com/php-telegram-bot/example-bot/blob/master/unset.php "example unset.php" [unset.php]: https://github.com/php-telegram-bot/example-bot/blob/master/unset.php "example unset.php"
...@@ -637,7 +646,7 @@ Credit list in [CREDITS](CREDITS) ...@@ -637,7 +646,7 @@ Credit list in [CREDITS](CREDITS)
[HelpCommand.php]: https://github.com/php-telegram-bot/example-bot/blob/master/Commands/HelpCommand.php "example /help command" [HelpCommand.php]: https://github.com/php-telegram-bot/example-bot/blob/master/Commands/HelpCommand.php "example /help command"
[SendtochannelCommand.php]: https://github.com/php-telegram-bot/core/blob/master/src/Commands/AdminCommands/SendtochannelCommand.php "/sendtochannel admin command" [SendtochannelCommand.php]: https://github.com/php-telegram-bot/core/blob/master/src/Commands/AdminCommands/SendtochannelCommand.php "/sendtochannel admin command"
[DB::selectChats]: https://github.com/php-telegram-bot/core/blob/0.46.0/src/DB.php#L1000 "DB::selectChats() parameters" [DB::selectChats]: https://github.com/php-telegram-bot/core/blob/0.46.0/src/DB.php#L1000 "DB::selectChats() parameters"
[wiki]: https://github.com/php-telegram-bot/core/wiki "PHP Telegram Bot Wiki" [Wiki]: https://github.com/php-telegram-bot/core/wiki "PHP Telegram Bot Wiki"
[wiki-create-your-own-commands]: https://github.com/php-telegram-bot/core/wiki/Create-your-own-commands "Create your own commands" [wiki-create-your-own-commands]: https://github.com/php-telegram-bot/core/wiki/Create-your-own-commands "Create your own commands"
[issues]: https://github.com/php-telegram-bot/core/issues "PHP Telegram Bot Issues" [issues]: https://github.com/php-telegram-bot/core/issues "PHP Telegram Bot Issues"
......
# Security # Security Policy
To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure.
Tidelift will then coordinate the fix and disclosure.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment