phpbotgram

MessageShortcuts

Hand-authored shortcut helpers for `Message`.

Loaded by HandAuthoredShortcutsIntegrator (Phase 2 codegen stage 8) and stitched into the regenerated Message class via a use MessageShortcuts; directive. Methods declared here cover behaviour that cannot be expressed through aliases.yml's lowering grammar — namely the as_reply_parameters() helper that the schema's reply_* aliases invoke via self.as_reply_parameters() in their fill: blocks.

The integrator collision-checks every declared method against the aliases.yml-derived shortcut set for Message; clashing names fail codegen rather than silently shadow the generated implementation.

Table of Contents

Properties

$chat  : Chat
$messageId  : int

Methods

asReplyParameters()  : ReplyParameters
Build a `ReplyParameters` referencing this message.

Properties

Methods

asReplyParameters()

Build a `ReplyParameters` referencing this message.

public asReplyParameters([bool|BotDefault|null $allowSendingWithoutReply = new BotDefault('allow_sending_without_reply') ][, string|null $quote = null ][, BotDefault|string|null $quoteParseMode = new BotDefault('parse_mode') ][, null|array<int, MessageEntity$quoteEntities = null ][, int|null $quotePosition = null ]) : ReplyParameters

Mirrors aiogram's Message.as_reply_parameters(...) (full upstream signature): produces a ReplyParameters payload pinned to (message_id, chat_id) plus the optional quote-formatting controls that aiogram exposes — allow_sending_without_reply, quote, quote_parse_mode, quote_entities, quote_position — so the generated reply_* shortcuts can default reply_parameters to "reply to this message" without the caller spelling out the IDs.

Both allowSendingWithoutReply and quoteParseMode default to a BotDefault(...) sentinel that mirrors aiogram's Default(...). The sentinels are passed through to ReplyParameters unchanged — ReplyParameters itself widens both fields to admit the sentinel, so deferred resolution happens at wire-encode time (in BaseSession::prepareValue) against the bot bound at the dispatch call-site. Eagerly resolving here would lose the sentinel for any caller that constructs the ReplyParameters ahead of time and dispatches against a separate Bot (the aiogram parity behaviour).

Parameters
$allowSendingWithoutReply : bool|BotDefault|null = new BotDefault('allow_sending_without_reply')
$quote : string|null = null
$quoteParseMode : BotDefault|string|null = new BotDefault('parse_mode')
$quoteEntities : null|array<int, MessageEntity> = null
$quotePosition : int|null = null
Return values
ReplyParameters
On this page

Search results