Update
This object represents an incoming update. At most one of the optional parameters can be present in any given update.
📝 Schema
Field | Type | Description |
---|---|---|
update_id | Integer | The update's unique identifier. Update identifiers start from a certain positive number and increase sequentially. This identifier becomes especially handy if you're using webhooks, since it allows you to ignore repeated updates or to restore the correct update sequence, should they get out of order. If there are no new updates for at least a week, then identifier of the next update will be chosen randomly instead of sequentially. |
message | Message | Optional. New incoming message of any kind - text, photo, sticker, etc. |
edited_message | Message | Optional. New version of a message that is known to the bot and was edited. This update may at times be triggered by changes to message fields that are either unavailable or not actively used by your bot. |
callback_query | CallbackQuery | Optional. New incoming callback query |
⚙️ Get methods
getUpdateId()
Retrieves the unique identifier for the update.
$updateId = $updateObject->getUpdateId();
getMessage()
Retrieves the new incoming message if it is part of the update. Returns a Message object if present.
$message = $updateObject->getMessage();
getEditedMessage()
Retrieves the new version of an edited message if it is part of the update. Returns a Message object if present.
$editedMessage = $updateObject->getEditedMessage();
getCallbackQuery()
Retrieves the new incoming callback query if it is part of the update. Returns a CallbackQuery object if present.
$callbackQuery = $updateObject->getCallbackQuery();
➕ More
tip
For further information, refer to the official Bale documentation for more details.