|
14 | 14 | [![Duplicated Lines (%)][sonar-duplicated-lines-icon]][sonar-path]
|
15 | 15 | [![Security Rating][sonar-security-rating-icon]][sonar-path]
|
16 | 16 |
|
17 |
| -#### Supported Telegram Bot API v4.9 (June 4, 2020) |
| 17 | +#### Supported Telegram Bot API 5.0 (November 4, 2020) |
18 | 18 |
|
19 | 19 | ## Installation
|
20 | 20 |
|
@@ -48,45 +48,54 @@ $bot->send(\TgBotApi\BotApiBase\Method\SendMessageMethod::create($userId, 'Hi'))
|
48 | 48 |
|
49 | 49 | You can configure it to work in symfony, for example, in [this way](https://gist.github.com/greenplugin/09179bee606aa01b1ee00d049ab78fc4).
|
50 | 50 |
|
| 51 | +If you want to use your own api server - you can set url as 4th param in bot api |
| 52 | + |
| 53 | +```php |
| 54 | +$bot = new \TgBotApi\BotApiBase\BotApi('<bot key>', $apiClient, new \TgBotApi\BotApiBase\BotApiNormalizer(), '<your-domain>'); |
| 55 | +``` |
| 56 | + |
51 | 57 | ### Allowed methods:
|
52 | 58 |
|
53 | 59 | |Method|Allowed type|response|
|
54 | 60 | |:--|:--|:--|
|
55 |
| -|add|AddStickerToSetMethod|bool| |
56 |
| -|answer|AnswerCallbackQueryMethod, AnswerInlineQueryMethod, AnswerPreCheckoutQueryMethod, AnswerShippingQueryMethod|bool| |
57 |
| -|create|CreateNewStickerSetMethod|bool| |
58 |
| -|delete|DeleteChatPhotoMethod, DeleteChatStickerSetMethod, DeleteMessageMethod, DeleteStickerFromSetMethod, DeleteWebhookMethod|bool| |
59 |
| -|edit|EditMessageCaptionMethod, EditMessageLiveLocationMethod, EditMessageMediaMethod, EditMessageReplyMarkupMethod, EditMessageTextMethod|bool| |
60 |
| -|forward|ForwardMessageMethod|MessageType| |
61 |
| -|kick|KickChatMemberMethod|bool| |
62 |
| -|leave|LeaveChatMethod|bool| |
63 |
| -|pin|PinChatMessageMethod|bool| |
64 |
| -|promote|PromoteChatMemberMethod|bool| |
65 |
| -|restrict|RestrictChatMemberMethod|bool| |
66 |
| -|send|SendPhotoMethod, SendAudioMethod, SendDocumentMethod, SendVideoMethod, SendAnimationMethod, SendVoiceMethod, SendVideoNoteMethod, SendGameMethod, SendInvoiceMethod, SendLocationMethod, SendVenueMethod, SendContactMethod, SendStickerMethod, SendMessageMethod, SendPollMethod, SendDiceMethod|MessageType| |
67 |
| -|set|SetChatDescriptionMethod, SetChatPhotoMethod, SetChatStickerSetMethod, SetChatTitleMethod, SetGameScoreMethod, SetStickerPositionInSetMethod, SetWebhookMethod, SetPassportDataErrorsMethod, SetChatPermissionsMethod, SetChatAdministratorCustomTitleMethod, SetMyCommandMethod, SetStickerSetThumbMethod|bool| |
68 |
| -|stop|StopMessageLiveLocationMethod|bool| |
69 |
| -|stopPoll|StopPollMethod|Poll| |
70 |
| -|unban|UnbanChatMemberMethod|bool| |
71 |
| -|unpin|UnpinChatMessageMethod|bool| |
72 |
| -|upload|UploadStickerFileMethod|FileType| |
73 |
| -|exportChatInviteLink|ExportChatInviteLinkMethod|string| |
74 |
| -|sendChatAction|SendChatActionMethod|bool| |
75 |
| -|getUpdates|GetUpdatesMethod|UpdateType[]| |
76 |
| -|getMe|GetMeMethod|UserType| |
77 |
| -|getMyCommands|GetMyCommandsMethod|BotCommandType| |
78 |
| -|getUserProfilePhotos|GetUserProfilePhotosMethod|UserProfilePhotosType| |
79 |
| -|getWebhookInfo|GetWebhookInfoMethod|WebhookInfoType| |
80 |
| -|getChatMembersCount|GetChatMembersCountMethod|int| |
81 |
| -|getChat|GetChatMethod|ChatType| |
82 |
| -|getChatAdministrators|GetChatAdministratorsMethod|ChatMemberType[]| |
83 |
| -|getChatMember|GetChatMemberMethod|ChatMemberType| |
84 |
| -|getGameHighScores|GetGameHighScoresMethod|GameHighScoreType[]| |
85 |
| -|getStickerSet|GetStickerSetMethod|StickerSetType| |
86 |
| -|getFile|GetFileMethod|FileType| |
87 |
| -|sendMediaGroup|SendMediaGroupMethod|MessageType[]| |
88 |
| -|getAbsoluteFilePath|FileType|string| |
89 |
| -|call($method, [string $type])|any method class, [optional expected type]|array or excepted type object| |
| 61 | +|`add`|AddStickerToSetMethod|bool| |
| 62 | +|`answer`|AnswerCallbackQueryMethod, AnswerInlineQueryMethod, AnswerPreCheckoutQueryMethod, AnswerShippingQueryMethod|bool| |
| 63 | +|`create`|CreateNewStickerSetMethod|bool| |
| 64 | +|`delete`|DeleteChatPhotoMethod, DeleteChatStickerSetMethod, DeleteMessageMethod, DeleteStickerFromSetMethod, DeleteWebhookMethod|bool| |
| 65 | +|`edit`|EditMessageCaptionMethod, EditMessageLiveLocationMethod, EditMessageMediaMethod, EditMessageReplyMarkupMethod, EditMessageTextMethod|bool| |
| 66 | +|`forward`|ForwardMessageMethod|MessageType| |
| 67 | +|`kick`|KickChatMemberMethod|bool| |
| 68 | +|`leave`|LeaveChatMethod|bool| |
| 69 | +|`pin`|PinChatMessageMethod|bool| |
| 70 | +|`promote`|PromoteChatMemberMethod|bool| |
| 71 | +|`restrict`|RestrictChatMemberMethod|bool| |
| 72 | +|`send`|SendPhotoMethod, SendAudioMethod, SendDocumentMethod, SendVideoMethod, SendAnimationMethod, SendVoiceMethod, SendVideoNoteMethod, SendGameMethod, SendInvoiceMethod, SendLocationMethod, SendVenueMethod, SendContactMethod, SendStickerMethod, SendMessageMethod, SendPollMethod, SendDiceMethod|MessageType| |
| 73 | +|`set`|SetChatDescriptionMethod, SetChatPhotoMethod, SetChatStickerSetMethod, SetChatTitleMethod, SetGameScoreMethod, SetStickerPositionInSetMethod, SetWebhookMethod, SetPassportDataErrorsMethod, SetChatPermissionsMethod, SetChatAdministratorCustomTitleMethod, SetMyCommandMethod, SetStickerSetThumbMethod|bool| |
| 74 | +|`stop`|StopMessageLiveLocationMethod|bool| |
| 75 | +|`stopPoll`|StopPollMethod|Poll| |
| 76 | +|`unban`|UnbanChatMemberMethod|bool| |
| 77 | +|`unpin`|UnpinChatMessageMethod, UnpinAllChatMessagesMethod|bool| |
| 78 | +|`upload`|UploadStickerFileMethod|FileType| |
| 79 | +|`exportChatInviteLink`|ExportChatInviteLinkMethod|string| |
| 80 | +|`sendChatAction`|SendChatActionMethod|bool| |
| 81 | +|`getUpdates`|GetUpdatesMethod|UpdateType[]| |
| 82 | +|`getMe`|GetMeMethod|UserType| |
| 83 | +|`getMyCommands`|GetMyCommandsMethod|BotCommandType| |
| 84 | +|`getUserProfilePhotos`|GetUserProfilePhotosMethod|UserProfilePhotosType| |
| 85 | +|`getWebhookInfo`|GetWebhookInfoMethod|WebhookInfoType| |
| 86 | +|`getChatMembersCount`|GetChatMembersCountMethod|int| |
| 87 | +|`getChat`|GetChatMethod|ChatType| |
| 88 | +|`getChatAdministrators`|GetChatAdministratorsMethod|ChatMemberType[]| |
| 89 | +|`getChatMember`|GetChatMemberMethod|ChatMemberType| |
| 90 | +|`getGameHighScores`|GetGameHighScoresMethod|GameHighScoreType[]| |
| 91 | +|`getStickerSet`|GetStickerSetMethod|StickerSetType| |
| 92 | +|`getFile`|GetFileMethod|FileType| |
| 93 | +|`sendMediaGroup`|SendMediaGroupMethod|MessageType[]| |
| 94 | +|`getAbsoluteFilePath`|FileType|string| |
| 95 | +|`logOut`|LogOutMethod|bool| |
| 96 | +|`close`|CloseMethod|bool| |
| 97 | +|`copyMessage`|CopyMessageMethod|MessageIdType| |
| 98 | +|`call($method, [string $type])`|any method class, [optional expected type]|array or excepted type object| |
90 | 99 |
|
91 | 100 | Implemented all methods and types referenced by [official Api](https://core.telegram.org/bots/api)
|
92 | 101 |
|
@@ -146,7 +155,7 @@ If you discover any security related issues, please email [email protected] inst
|
146 | 155 | The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
|
147 | 156 |
|
148 | 157 | [ico-php-v]: https://img.shields.io/travis/php-v/tg-bot-api/bot-api-base.svg?style=flat-square
|
149 |
| -[ico-bot-api]: https://img.shields.io/badge/Bot%20API-4.9-blue.svg?style=flat-square |
| 158 | +[ico-bot-api]: https://img.shields.io/badge/Bot%20API-5.0-blue.svg?style=flat-square |
150 | 159 | [ico-version]: https://img.shields.io/packagist/v/tg-bot-api/bot-api-base.svg?style=flat-square
|
151 | 160 | [ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square
|
152 | 161 | [ico-travis]: https://img.shields.io/travis/tg-bot-api/bot-api-base/master.svg?style=flat-square
|
|
0 commit comments