phpbotgram

ExternalReplyInfo extends TelegramObject
in package

FinalYes

This object contains information about a message that is being replied to, which may come from another chat or forum topic.

Source: https://core.telegram.org/bots/api#externalreplyinfo

Table of Contents

Properties

$animation  : Animation|null
$audio  : Audio|null
$bot  : Bot|null
$chat  : Chat|null
$checklist  : Checklist|null
$contact  : Contact|null
$dice  : Dice|null
$document  : Document|null
$game  : Game|null
$giveaway  : Giveaway|null
$giveawayWinners  : GiveawayWinners|null
$hasMediaSpoiler  : bool|null
$invoice  : Invoice|null
$linkPreviewOptions  : LinkPreviewOptions|null
$livePhoto  : LivePhoto|null
$location  : Location|null
$messageId  : int|null
$origin  : MessageOrigin
$paidMedia  : PaidMediaInfo|null
$photo  : array<string|int, mixed>|null
$poll  : Poll|null
$sticker  : Sticker|null
$story  : Story|null
$venue  : Venue|null
$video  : Video|null
$videoNote  : VideoNote|null
$voice  : Voice|null

Methods

__construct()  : mixed
as_()  : static
Alias of withBot() for grep-translating aiogram code that uses obj.as_(bot).
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

Methods

__construct()

public __construct(MessageOrigin $origin[, Chat|null $chat = null ][, int|null $messageId = null ][, LinkPreviewOptions|null $linkPreviewOptions = null ][, Animation|null $animation = null ][, Audio|null $audio = null ][, Document|null $document = null ][, LivePhoto|null $livePhoto = null ][, PaidMediaInfo|null $paidMedia = null ][, null|array<int, PhotoSize$photo = null ][, Sticker|null $sticker = null ][, Story|null $story = null ][, Video|null $video = null ][, VideoNote|null $videoNote = null ][, Voice|null $voice = null ][, bool|null $hasMediaSpoiler = null ][, Checklist|null $checklist = null ][, Contact|null $contact = null ][, Dice|null $dice = null ][, Game|null $game = null ][, Giveaway|null $giveaway = null ][, GiveawayWinners|null $giveawayWinners = null ][, Invoice|null $invoice = null ][, Location|null $location = null ][, Poll|null $poll = null ][, Venue|null $venue = null ][, Bot|null $bot = null ]) : mixed
Parameters
$origin : MessageOrigin
$chat : Chat|null = null
$messageId : int|null = null
$linkPreviewOptions : LinkPreviewOptions|null = null
$animation : Animation|null = null
$audio : Audio|null = null
$document : Document|null = null
$livePhoto : LivePhoto|null = null
$paidMedia : PaidMediaInfo|null = null
$photo : null|array<int, PhotoSize> = null
$sticker : Sticker|null = null
$story : Story|null = null
$video : Video|null = null
$videoNote : VideoNote|null = null
$voice : Voice|null = null
$hasMediaSpoiler : bool|null = null
$checklist : Checklist|null = null
$contact : Contact|null = null
$dice : Dice|null = null
$game : Game|null = null
$giveaway : Giveaway|null = null
$giveawayWinners : GiveawayWinners|null = null
$invoice : Invoice|null = null
$location : Location|null = null
$poll : Poll|null = null
$venue : Venue|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
static

withBot()

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
Return values
static
On this page

Search results