Skip to content

Commit 35cfcbe

Browse files
committed
Add new Update helpers for use in commands
1 parent d567e3e commit 35cfcbe

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
99
- 64 bit PHP installs are required to handle files larger than 2GB!
1010
### Added
1111
- Bot API 6.1 (@jyxjjj, @OxMohsen, @noplanman) (#1333, #1338, #1339)
12+
- New Update field helpers for Command class.
1213
### Changed
1314
### Deprecated
1415
### Removed

src/Commands/Command.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,15 @@
1313

1414
use Longman\TelegramBot\DB;
1515
use Longman\TelegramBot\Entities\CallbackQuery;
16+
use Longman\TelegramBot\Entities\ChatJoinRequest;
17+
use Longman\TelegramBot\Entities\ChatMemberUpdated;
1618
use Longman\TelegramBot\Entities\ChosenInlineResult;
1719
use Longman\TelegramBot\Entities\InlineQuery;
1820
use Longman\TelegramBot\Entities\Message;
1921
use Longman\TelegramBot\Entities\Payments\PreCheckoutQuery;
2022
use Longman\TelegramBot\Entities\Payments\ShippingQuery;
2123
use Longman\TelegramBot\Entities\Poll;
24+
use Longman\TelegramBot\Entities\PollAnswer;
2225
use Longman\TelegramBot\Entities\ServerResponse;
2326
use Longman\TelegramBot\Entities\Update;
2427
use Longman\TelegramBot\Exception\TelegramException;
@@ -40,6 +43,10 @@
4043
* @method ShippingQuery getShippingQuery() Optional. New incoming shipping query. Only for invoices with flexible price
4144
* @method PreCheckoutQuery getPreCheckoutQuery() Optional. New incoming pre-checkout query. Contains full information about checkout
4245
* @method Poll getPoll() Optional. New poll state. Bots receive only updates about polls, which are sent or stopped by the bot
46+
* @method PollAnswer getPollAnswer() Optional. A user changed their answer in a non-anonymous poll. Bots receive new votes only in polls that were sent by the bot itself.
47+
* @method ChatMemberUpdated getMyChatMember() Optional. The bot's chat member status was updated in a chat. For private chats, this update is received only when the bot is blocked or unblocked by the user.
48+
* @method ChatMemberUpdated getChatMember() Optional. A chat member's status was updated in a chat. The bot must be an administrator in the chat and must explicitly specify “chat_member” in the list of allowed_updates to receive these updates.
49+
* @method ChatJoinRequest getChatJoinRequest() Optional. A request to join the chat has been sent. The bot must have the can_invite_users administrator right in the chat to receive these updates.
4350
*/
4451
abstract class Command
4552
{

0 commit comments

Comments
 (0)