Update
extends TelegramObject
in package
uses
UpdateShortcuts
This object represents an incoming update.
At most one of the optional fields can be present in any given update.
Source: https://core.telegram.org/bots/api#update
Table of Contents
Properties
- $bot : Bot|null
- $businessConnection : BusinessConnection|null
- $businessMessage : Message|null
- $callbackQuery : CallbackQuery|null
- $channelPost : Message|null
- $chatBoost : ChatBoostUpdated|null
- $chatJoinRequest : ChatJoinRequest|null
- $chatMember : ChatMemberUpdated|null
- $chosenInlineResult : ChosenInlineResult|null
- $deletedBusinessMessages : BusinessMessagesDeleted|null
- $editedBusinessMessage : Message|null
- $editedChannelPost : Message|null
- $editedMessage : Message|null
- $guestMessage : Message|null
- $inlineQuery : InlineQuery|null
- $managedBot : ManagedBotUpdated|null
- $message : Message|null
- $messageReaction : MessageReactionUpdated|null
- $messageReactionCount : MessageReactionCountUpdated|null
- $myChatMember : ChatMemberUpdated|null
- $poll : Poll|null
- $pollAnswer : PollAnswer|null
- $preCheckoutQuery : PreCheckoutQuery|null
- $purchasedPaidMedia : PaidMediaPurchased|null
- $removedChatBoost : ChatBoostRemoved|null
- $shippingQuery : ShippingQuery|null
- $updateId : int
Methods
- __construct() : mixed
- as_() : static
- Alias of withBot() for grep-translating aiogram code that uses obj.as_(bot).
- eventType() : string|null
- withBot() : static
- Returns a clone of $this with $bot rebound recursively. Walks every public property; nested `BotContextController` instances are rebound via their own `withBot`, arrays (including nested arrays of arbitrary depth — e.g.
Properties
$bot read-only
public
Bot|null
$bot
= null
$businessConnection read-only
public
BusinessConnection|null
$businessConnection
= null
$businessMessage read-only
public
Message|null
$businessMessage
= null
$callbackQuery read-only
public
CallbackQuery|null
$callbackQuery
= null
$channelPost read-only
public
Message|null
$channelPost
= null
$chatBoost read-only
public
ChatBoostUpdated|null
$chatBoost
= null
$chatJoinRequest read-only
public
ChatJoinRequest|null
$chatJoinRequest
= null
$chatMember read-only
public
ChatMemberUpdated|null
$chatMember
= null
$chosenInlineResult read-only
public
ChosenInlineResult|null
$chosenInlineResult
= null
$deletedBusinessMessages read-only
public
BusinessMessagesDeleted|null
$deletedBusinessMessages
= null
$editedBusinessMessage read-only
public
Message|null
$editedBusinessMessage
= null
$editedChannelPost read-only
public
Message|null
$editedChannelPost
= null
$editedMessage read-only
public
Message|null
$editedMessage
= null
$guestMessage read-only
public
Message|null
$guestMessage
= null
$inlineQuery read-only
public
InlineQuery|null
$inlineQuery
= null
$managedBot read-only
public
ManagedBotUpdated|null
$managedBot
= null
$message read-only
public
Message|null
$message
= null
$messageReaction read-only
public
MessageReactionUpdated|null
$messageReaction
= null
$messageReactionCount read-only
public
MessageReactionCountUpdated|null
$messageReactionCount
= null
$myChatMember read-only
public
ChatMemberUpdated|null
$myChatMember
= null
$poll read-only
public
Poll|null
$poll
= null
$pollAnswer read-only
public
PollAnswer|null
$pollAnswer
= null
$preCheckoutQuery read-only
public
PreCheckoutQuery|null
$preCheckoutQuery
= null
$purchasedPaidMedia read-only
public
PaidMediaPurchased|null
$purchasedPaidMedia
= null
$removedChatBoost read-only
public
ChatBoostRemoved|null
$removedChatBoost
= null
$shippingQuery read-only
public
ShippingQuery|null
$shippingQuery
= null
$updateId read-only
public
int
$updateId
Methods
__construct()
public
__construct(int $updateId[, Message|null $message = null ][, Message|null $editedMessage = null ][, Message|null $channelPost = null ][, Message|null $editedChannelPost = null ][, BusinessConnection|null $businessConnection = null ][, Message|null $businessMessage = null ][, Message|null $editedBusinessMessage = null ][, BusinessMessagesDeleted|null $deletedBusinessMessages = null ][, Message|null $guestMessage = null ][, MessageReactionUpdated|null $messageReaction = null ][, MessageReactionCountUpdated|null $messageReactionCount = null ][, InlineQuery|null $inlineQuery = null ][, ChosenInlineResult|null $chosenInlineResult = null ][, CallbackQuery|null $callbackQuery = null ][, ShippingQuery|null $shippingQuery = null ][, PreCheckoutQuery|null $preCheckoutQuery = null ][, PaidMediaPurchased|null $purchasedPaidMedia = null ][, Poll|null $poll = null ][, PollAnswer|null $pollAnswer = null ][, ChatMemberUpdated|null $myChatMember = null ][, ChatMemberUpdated|null $chatMember = null ][, ChatJoinRequest|null $chatJoinRequest = null ][, ChatBoostUpdated|null $chatBoost = null ][, ChatBoostRemoved|null $removedChatBoost = null ][, ManagedBotUpdated|null $managedBot = null ][, Bot|null $bot = null ]) : mixed
Parameters
- $updateId : int
- $message : Message|null = null
- $editedMessage : Message|null = null
- $channelPost : Message|null = null
- $editedChannelPost : Message|null = null
- $businessConnection : BusinessConnection|null = null
- $businessMessage : Message|null = null
- $editedBusinessMessage : Message|null = null
- $deletedBusinessMessages : BusinessMessagesDeleted|null = null
- $guestMessage : Message|null = null
- $messageReaction : MessageReactionUpdated|null = null
- $messageReactionCount : MessageReactionCountUpdated|null = null
- $inlineQuery : InlineQuery|null = null
- $chosenInlineResult : ChosenInlineResult|null = null
- $callbackQuery : CallbackQuery|null = null
- $shippingQuery : ShippingQuery|null = null
- $preCheckoutQuery : PreCheckoutQuery|null = null
- $purchasedPaidMedia : PaidMediaPurchased|null = null
- $poll : Poll|null = null
- $pollAnswer : PollAnswer|null = null
- $myChatMember : ChatMemberUpdated|null = null
- $chatMember : ChatMemberUpdated|null = null
- $chatJoinRequest : ChatJoinRequest|null = null
- $chatBoost : ChatBoostUpdated|null = null
- $removedChatBoost : ChatBoostRemoved|null = null
- $managedBot : ManagedBotUpdated|null = null
- $bot : Bot|null = null
as_()
Alias of withBot() for grep-translating aiogram code that uses obj.as_(bot).
public
as_(Bot|null $bot) : static
IMPORTANT: behaves DIFFERENTLY from upstream — upstream mutates self.bot in place and returns self. The PHP port can't mutate readonly, so this returns a clone. Callers must reassign: $msg = $msg->as($bot).
Parameters
- $bot : Bot|null
Return values
staticeventType()
public
eventType() : string|null
Return values
string|nullwithBot()
Returns a clone of $this with $bot rebound recursively. Walks every public property; nested `BotContextController` instances are rebound via their own `withBot`, arrays (including nested arrays of arbitrary depth — e.g.
public
withBot(Bot|null $bot) : static
list<list<KeyboardButton>>) are walked element-wise. Plain values
(scalars, DateTime, enums, InputFile etc.) pass through untouched.
Mirrors upstream pydantic model_validate(context={"bot": bot}) (aiogram
ContextController.as_/model_dump_json+model_validate).
Scope note: PHP 8.5 treats public readonly as effectively
public protected(set) readonly for clone-with — only code running with
a scope in the property's declaring class hierarchy (declaring class plus
its ancestors and descendants) can use clone($obj, ['x' => ...]) against
it. Because this method lives on BotContextController and every
TelegramObject/TelegramMethod subclass extends it, the walker's
clone($this, [...]) call legally rewrites subclass-declared readonly
slots like Message::$chat. External callers cannot use the same syntax
— they must funnel through this method.
Parameters
- $bot : Bot|null