Application
Table of Contents
Interfaces
- BotShortcutsContract
- HistoryManagerInterface
- Manages the scene history stack for back-navigation.
- SceneManagerInterface
- Controls scene transitions on behalf of `SceneWizard`.
- SceneRegistryInterface
- Resolves a scene identifier to a concrete `Scene` subclass name.
- KeyBuilder
- Contract for assembling a string key from an FSM {@see StorageKey} and an optional sub-record discriminator.
- MongoCollectionInterface
- Minimal collection interface required by `MongoStorage`.
- Downloadable
- InputPollMediaInterface
- Marker interface for the {@see InputPollMedia} union.
- InputPollOptionMediaInterface
- Marker interface for the {@see InputPollOptionMedia} union.
Classes
- Bot
- Bot facade.
- BotContextController
- BotDefault
- Sentinel for "use the bot's configured default for this field".
- DefaultBotProperties
- Serializer
- Walks a TelegramObject/TelegramMethod into a snake_case-keyed array (dump) and back (load). Bot threading + InputFile detachment + JSON encoding all live in BaseSession::prepareValue.
- AmphpSession
- Production session backed by amphp/http-client (Fiber-aware HTTP/1.1).
- BaseSession
- BaseRequestMiddleware
- RequestMiddlewareManager
- TelegramApiServer
- Dispatcher
- Root router with polling/webhook entry points — port of `aiogram.dispatcher.dispatcher.Dispatcher`.
- Bases
- Dispatcher base sentinels and helpers. `UNHANDLED`/`REJECTED` are singleton objects (not strings) so identity comparison via `===` can't collide with a user handler that happens to return the same string literal.
- CallableObject
- Reflection-cached "kwarg binder" mirroring upstream `aiogram.dispatcher.event.handler.CallableObject`. The dispatcher injects a large bag of context arguments (`bot`, `event_context`, `event_from_user`, `state`, …) and each handler declares only the subset it actually needs.
- CancelHandlerException
- EventObserver
- Simple events observer used for managing events that are **not** related to Telegram updates — primarily startup/shutdown lifecycle hooks (mirrors upstream `aiogram.dispatcher.event.event.EventObserver`). Update routing is handled separately by `TelegramEventObserver` (filters + middlewares + handler results), which is intentionally a different class.
- FilterObject
- Wraps a filter callback that votes on whether a handler should run for a given update. Mirrors upstream `aiogram.dispatcher.event.handler.FilterObject`.
- HandlerObject
- Wraps a handler callback together with its filter chain and metadata flags.
- RejectedSentinel
- Sentinel singleton signalling that a handler explicitly rejected the update (filter chain produced false / handler raised SkipHandlerException). Identity only — `===` is the only reliable comparison.
- SkipHandlerException
- TelegramEventObserver
- Routing observer for a single Telegram update type — port of `aiogram.dispatcher.event.telegram.TelegramEventObserver`.
- UnhandledSentinel
- Sentinel singleton returned/compared by reference to mark a handler chain that did not produce a result (mirrors aiogram's `unittest.mock.sentinel.UNHANDLED`).
- Flag
- Per-handler metadata tag, mirror of upstream `aiogram.dispatcher.flags.Flag` (`@dataclass(frozen=True)`). Two roles:
- FlagDecorator
- Imperative attachment seam for flags. Mirrors the runtime half of `aiogram.dispatcher.flags.FlagDecorator.__call__` — the branch that mutates the callback by setting `value.aiogram_flag = {...}`.
- FlagGenerator
- Sugary factory mirror of upstream's module-level `from aiogram import flags` singleton. The Python original supports `flags.admin_only` (attribute access with no parens), `flags.throttle(5)` (callable returning a decorator with a value), and `flags.chat_action(action='typing')` (keyword form). PHP can't make attribute access return a configurable value, so we collapse all three into a single magic-static call form: `FlagGenerator::<name>(?$value)`.
- Flags
- Read flags from a target, combining both attachment styles:
- BaseMiddleware
- Abstract base class for dispatcher-side middlewares (mirrors aiogram's `aiogram.dispatcher.middlewares.base.BaseMiddleware`).
- ErrorsMiddleware
- Top-of-chain dispatcher middleware (mirror of aiogram's `aiogram.dispatcher.middlewares.error.ErrorsMiddleware`) that **routes real exceptions to the `errors` observer**.
- EventContext
- Readonly DTO carrying the user/chat/thread context extracted from any incoming update by `UserContextMiddleware` (mirror of `aiogram.dispatcher.middlewares.user_context.EventContext`).
- MiddlewareManager
- Ordered registry of dispatcher-side `BaseMiddleware` instances for a single update type (mirrors aiogram's `aiogram.dispatcher.middlewares.manager.MiddlewareManager`).
- UserContextMiddleware
- Dispatcher-side middleware that resolves the user/chat/thread context for the incoming event and writes the canonical kwargs into `$data` so that downstream handlers, filters, and inner middlewares can bind them via reflection.
- PollingOptions
- Tuning knobs for `Dispatcher::startPolling` — port of the constructor parameters of `aiogram.dispatcher.dispatcher.Dispatcher.start_polling` grouped into a single value object.
- Router
- Per-update-type router — port of `aiogram.dispatcher.router.Router`.
- CallbackAnswerException
- ClientDecodeException
- DataNotDictLikeException
- DetailedPhpBotGramException
- PhpBotGramException
- RestartingTelegram
- SceneException
- TelegramApiException
- TelegramBadRequestException
- TelegramConflictException
- TelegramEntityTooLarge
- TelegramForbiddenException
- TelegramMigrateToChat
- TelegramNetworkException
- TelegramNotFoundException
- TelegramRetryAfter
- TelegramServerException
- TelegramUnauthorizedException
- TokenValidationException
- Thrown when `Token::validate` rejects an input. Mirrors aiogram's `aiogram.utils.token.TokenValidationError`. Catch this specifically to distinguish credential-format failures from other PhpBotGramException.
- UnsupportedKeywordArgumentException
- UpdateTypeLookupException
- BaseFilter
- Empty-extension alias for {@see Filter} mirroring upstream's `aiogram.filters.base.BaseFilter` import path (`aiogram/filters/base.py:9`).
- CallbackData
- Abstract base for typed callback-data payloads embedded inside `InlineKeyboardButton::$callbackData`. Mirrors `aiogram.filters.callback_data.CallbackData` (`aiogram/filters/callback_data.py:34-149`).
- CallbackPrefix
- Class-level metadata carrier for `CallbackData` subclasses. Declares the wire prefix and separator that the framework uses to pack/unpack a typed callback-data payload.
- CallbackQueryFilter
- Dispatcher-side filter that bridges incoming `CallbackQuery` events to a typed `CallbackData` subclass. Created via `MyCallbackData::filter()`, not instantiated directly by user code (though direct construction is supported for tests and Logic combinator wiring).
- ChatMemberUpdatedFilter
- Dispatcher-side filter that matches a `ChatMemberUpdated` event by comparing the wire-level statuses of `old_chat_member` and `new_chat_member`.
- Command
- Slash-command matcher. Port of `aiogram.filters.command.Command` (`aiogram/filters/command.py:25-198`). Accepts a message and matches its `text` (or fallback `caption`) against one or more registered command patterns. On match, returns `['command' => CommandObject]` so the parsed pieces flow into the handler as a `$command` kwarg.
- CommandObject
- Readonly DTO carrying the parsed pieces of a Telegram slash-command (`/cmd@mention args`). Produced by {@see Command}::__invoke and injected into the handler kwargs under the `command` key.
- CommandStart
- Convenience filter that matches the `/start` command and (optionally) enforces deep-link semantics. Port of `aiogram.filters.command.CommandStart` (`aiogram/filters/command.py:240-303`).
- ExceptionMessageFilter
- Filter that accepts an `ErrorEvent` whose `->exception->getMessage()` matches a regex pattern; on match, returns the match metadata as kwargs so the dispatcher merges them into the handler invocation.
- ExceptionTypeFilter
- Filter that accepts an `ErrorEvent` whose `->exception` is an instance of one of the registered exception class-strings.
- BaseField
- Abstract base for the typed F-DSL field wrappers. Each subclass binds a `MagicFilter` chain to a narrowly-typed comparator surface — `StringField` exposes string predicates, `IntField` exposes numeric ones, and so on — so call sites get IDE autocomplete and PHPStan-checked parameters without users having to drop into the raw chain API.
- BoolField
- Typed F-DSL wrapper for boolean Telegram fields (`User::$isPremium`, `Message::$isTopicMessage`, …). Surfaces only the two truth-value comparators so call sites read as `MessageF::isTopicMessage()->isTrue()` rather than `equals(true)`.
- DateTimeField
- Typed F-DSL wrapper for `\DateTime`-valued Telegram fields (`Message::$date`, `Message::$editDate`, …). The temporal helpers delegate to MagicFilter's numeric comparators, which use PHP's native `<`/`>`-on-DateTime semantics — DateTime instances compare by their canonical timestamp.
- IntField
- Typed F-DSL wrapper for integer Telegram fields (`Message::$messageId`, `User::$id`, …). Provides the usual numeric comparators plus a convenience `between($lo, $hi)` helper that composes gte+lte under an `AndFilter` so users don't have to spell out the conjunction by hand.
- NullableIntField
- Typed F-DSL wrapper for nullable int fields (`?int` — e.g.
- NullableObjectField
- Typed F-DSL wrapper for nullable nested-object fields (`?User`, `?Message`, …). Only exposes presence-tests because deeper predicates are object-type-specific and belong on per-type sub-builders emitted by codegen (`MessageF::fromUser()` → `NullableObjectField`).
- NullableStringField
- Typed F-DSL wrapper for nullable string fields (`?string` — most of the optional text fields on `Message`, `User`, …). Mirrors the `StringField` comparator surface and adds two presence-tests (`isSet` / `isNull`) so callers can express null-checks without dropping into raw MagicFilter.
- RegexField
- Typed F-DSL wrapper for PCRE-pattern matching over a string-valued chain. The match operation reads the running string off the chain, runs `preg_match` against it, and either rejects (no match) or accepts — optionally injecting the match payload as kwargs.
- StringField
- Typed F-DSL wrapper for string-valued Telegram fields (e.g.
- Filter
- Abstract base for every dispatcher-side filter. Concrete subclasses (Command, StateFilter, ChatMemberUpdatedFilter, the Logic combinators below, the F-DSL builders, …) implement `__invoke` to vote on whether a handler should run for a given Telegram update.
- AndFilter
- "Every child must accept" combinator with a kwarg cascade.
- InvertFilter
- Negation combinator. Mirrors upstream `aiogram.filters.logic._InvertFilter` at `aiogram/filters/logic.py`, with one deliberate PHP-side simplification.
- OrFilter
- "At least one child must accept" combinator. Mirrors upstream `aiogram.filters.logic._OrFilter` at `aiogram/filters/logic.py`.
- MagicData
- Filter that resolves a `MagicFilter` chain against the dispatch data dict, i.e. `['event' => $event, ...$kwargs]`. Allows chain expressions to reach into both the event payload AND the dispatcher's contextual kwargs (FSM state, storage, bot, anything middleware injected):
- StateFilter
- Filter that matches a Telegram event against one or more FSM states.
- After
- Describes what the framework should do **after** a scene handler returns.
- FsmContext
- Per-context FSM handle that delegates all operations to the backing storage.
- FsmContextMiddleware
- Dispatcher-side middleware that resolves the FSM context for each incoming update and injects `state`, `raw_state`, and `fsm_storage` into the kwarg bag so that handlers and filters can access FSM state via reflection binding.
- OnAttribute
- Abstract base for all `#[On*]` scene event-marker attributes.
- OnCallbackQuery
- Marks a scene method as a handler for `callback_query` events.
- OnChannelPost
- Marks a scene method as a handler for `channel_post` events.
- OnChatJoinRequest
- Marks a scene method as a handler for `chat_join_request` events.
- OnChatMember
- Marks a scene method as a handler for `chat_member` events.
- OnChosenInlineResult
- Marks a scene method as a handler for `chosen_inline_result` events.
- OnEditedChannelPost
- Marks a scene method as a handler for `edited_channel_post` events.
- OnEditedMessage
- Marks a scene method as a handler for `edited_message` events.
- OnInlineQuery
- Marks a scene method as a handler for `inline_query` events.
- OnMessage
- Marks a scene method as a handler for `message` events.
- OnMyChatMember
- Marks a scene method as a handler for `my_chat_member` events.
- OnPoll
- Marks a scene method as a handler for `poll` events.
- OnPollAnswer
- Marks a scene method as a handler for `poll_answer` events.
- OnPreCheckoutQuery
- Marks a scene method as a handler for `pre_checkout_query` events.
- OnShippingQuery
- Marks a scene method as a handler for `shipping_query` events.
- SceneState
- Class-level attribute that declares the FSM state name for a `Scene` subclass.
- HandlerContainer
- Bundles a named handler callable with its associated filters and optional post-handler action.
- HistoryManager
- Manages the scene history stack for back-navigation.
- SceneConfig
- Immutable configuration record for a single scene class.
- SceneHandlerWrapper
- Wraps a scene instance-method handler into a callable suitable for registration with a `TelegramEventObserver`.
- SceneRegistry
- Registry that owns all registered scene classes and wires the per-update `ScenesManager` into the dispatcher middleware stack.
- ScenesManager
- Per-update scene transition front-end.
- Scene
- Abstract base for all scene classes in the Scene subsystem.
- SceneWizard
- Per-scene state machine instance handed to each scene method.
- State
- Represents a single FSM state value with optional group association.
- States
- Module-level FSM state sentinels.
- StatesGroup
- Abstract base class for a named group of related FSM states.
- BaseEventIsolation
- Abstract base for FSM event-isolation strategies.
- BaseStorage
- Abstract base for all FSM storage backends.
- DefaultKeyBuilder
- Simple colon-joined key builder with an `fsm` prefix.
- DisabledEventIsolation
- A no-op event isolation strategy — concurrent updates are never serialised.
- Lock
- A thin wrapper around an optional `Amp\Sync\Lock` that implements the acquire/release pattern for FSM event isolation.
- MemoryStorage
- In-memory FSM storage backend.
- MemoryStorageRecord
- Mutable value object holding a single FSM storage slot.
- MongoCollectionAdapter
- Thin adapter that wraps `\MongoDB\Collection` and makes it satisfy `MongoCollectionInterface`.
- MongoStorage
- MongoDB-backed FSM storage.
- RedisEventIsolation
- Redis-backed FSM event isolation via a distributed SET NX PX lock.
- RedisStorage
- Redis-backed FSM storage using `amphp/redis ^2`.
- SimpleEventIsolation
- A mutex-backed event isolation strategy that serialises concurrent updates sharing the same `StorageKey`.
- StorageKey
- Immutable contextual key that identifies a single FSM record. Every FSM storage operation is addressed by one of these keys; the key encodes the Telegram context (bot, chat, thread, user, optional business connection) plus an optional `destiny` tag for advanced multi-slot scenarios.
- AddStickerToSet
- Use this method to add a new sticker to a set created by the bot. Emoji sticker sets can have up to 200 stickers. Other sticker sets can have up to 120 stickers. Returns True on success.
- AnswerCallbackQuery
- Use this method to send answers to callback queries sent from inline keyboards. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert. On success, True is returned.
- AnswerChatJoinRequestQuery
- Use this method to process a received chat join request query. Returns True on success.
- AnswerGuestQuery
- Use this method to reply to a received guest message. On success, a SentGuestMessage object is returned.
- AnswerInlineQuery
- Use this method to send answers to an inline query. On success, True is returned.
- AnswerPreCheckoutQuery
- Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of an Update with the field pre_checkout_query. Use this method to respond to such pre-checkout queries. On success, True is returned. Note: The Bot API must receive an answer within 10 seconds after the pre-checkout query was sent.
- AnswerShippingQuery
- If you sent an invoice requesting a shipping address and the parameter is_flexible was specified, the Bot API will send an Update with a shipping_query field to the bot. Use this method to reply to shipping queries. On success, True is returned.
- AnswerWebAppQuery
- Use this method to set the result of an interaction with a Web App and send a corresponding message on behalf of the user to the chat from which the query originated. On success, a SentWebAppMessage object is returned.
- ApproveChatJoinRequest
- Use this method to approve a chat join request. The bot must be an administrator in the chat for this to work and must have the can_invite_users administrator right. Returns True on success.
- ApproveSuggestedPost
- Use this method to approve a suggested post in a direct messages chat. The bot must have the 'can_post_messages' administrator right in the corresponding channel chat. Returns True on success.
- BanChatMember
- Use this method to ban a user in a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the chat on their own using invite links, etc., unless unbanned first. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.
- BanChatSenderChat
- Use this method to ban a channel chat in a supergroup or a channel. Until the chat is unbanned, the owner of the banned chat won't be able to send messages on behalf of any of their channels. The bot must be an administrator in the supergroup or channel for this to work and must have the appropriate administrator rights. Returns True on success.
- Close
- Use this method to close the bot instance before moving it from one local server to another. You need to delete the webhook before calling this method to ensure that the bot isn't launched again after server restart. The method will return error 429 in the first 10 minutes after the bot is launched. Returns True on success. Requires no parameters.
- CloseForumTopic
- Use this method to close an open topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success.
- CloseGeneralForumTopic
- Use this method to close an open 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. Returns True on success.
- ConvertGiftToStars
- Converts a given regular gift to Telegram Stars. Requires the can_convert_gifts_to_stars business bot right. Returns True on success.
- CopyMessage
- Use this method to copy messages of any kind. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessage, but the copied message doesn't have a link to the original message. Returns the MessageId of the sent message on success.
- CopyMessages
- Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are skipped. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessages, but the copied messages don't have a link to the original message. Album grouping is kept for copied messages. On success, an array of MessageId of the sent messages is returned.
- CreateChatInviteLink
- Use this method to create an additional invite link for a chat. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. The link can be revoked using the method revokeChatInviteLink. Returns the new invite link as ChatInviteLink object.
- CreateChatSubscriptionInviteLink
- Use this method to create a subscription invite link for a channel chat. The bot must have the can_invite_users administrator rights. The link can be edited using the method editChatSubscriptionInviteLink or revoked using the method revokeChatInviteLink. Returns the new invite link as a ChatInviteLink object.
- CreateForumTopic
- Use this method to create a topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator right. Returns information about the created topic as a ForumTopic object.
- CreateInvoiceLink
- Use this method to create a link for an invoice. Returns the created invoice link as String on success.
- CreateNewStickerSet
- Use this method to create a new sticker set owned by a user. The bot will be able to edit the sticker set thus created. Returns True on success.
- DeclineChatJoinRequest
- Use this method to decline a chat join request. The bot must be an administrator in the chat for this to work and must have the can_invite_users administrator right. Returns True on success.
- DeclineSuggestedPost
- Use this method to decline a suggested post in a direct messages chat. The bot must have the 'can_manage_direct_messages' administrator right in the corresponding channel chat. Returns True on success.
- DeleteAllMessageReactions
- Use this method to remove up to 10000 recent reactions in a group or a supergroup chat added by a given user or chat. The bot must have the 'can_delete_messages' administrator right in the chat. Returns True on success.
- DeleteBusinessMessages
- Delete messages on behalf of a business account. Requires the can_delete_sent_messages business bot right to delete messages sent by the bot itself, or the can_delete_all_messages business bot right to delete any message. Returns True on success.
- DeleteChatPhoto
- Use this method to delete a chat photo. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.
- DeleteChatStickerSet
- Use this method to delete a group sticker set from a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Use the field can_set_sticker_set optionally returned in getChat requests to check if the bot can use this method. Returns True on success.
- DeleteForumTopic
- Use this method to delete a forum topic along with all its messages in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the can_delete_messages administrator rights. Returns True on success.
- DeleteMessage
- Use this method to delete a message, including service messages, with the following limitations: - A message can only be deleted if it was sent less than 48 hours ago.
- DeleteMessageReaction
- Use this method to remove a reaction from a message in a group or a supergroup chat. The bot must have the 'can_delete_messages' administrator right in the chat. Returns True on success.
- DeleteMessages
- Use this method to delete multiple messages simultaneously. If some of the specified messages can't be found, they are skipped. Returns True on success.
- DeleteMyCommands
- Use this method to delete the list of the bot's commands for the given scope and user language. After deletion, higher level commands will be shown to affected users. Returns True on success.
- DeleteStickerFromSet
- Use this method to delete a sticker from a set created by the bot. Returns True on success.
- DeleteStickerSet
- Use this method to delete a sticker set that was created by the bot. Returns True on success.
- DeleteStory
- Deletes a story previously posted by the bot on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns True on success.
- DeleteWebhook
- Use this method to remove webhook integration if you decide to switch back to getUpdates. Returns True on success.
- EditChatInviteLink
- Use this method to edit a non-primary invite link created by the bot. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the edited invite link as a ChatInviteLink object.
- EditChatSubscriptionInviteLink
- Use this method to edit a subscription invite link created by the bot. The bot must have the can_invite_users administrator rights. Returns the edited invite link as a ChatInviteLink object.
- EditForumTopic
- Use this method to edit name and icon of a topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success.
- EditGeneralForumTopic
- Use this method to edit the name of the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. Returns True on success.
- EditMessageCaption
- Use this method to edit captions of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.
- EditMessageChecklist
- Use this method to edit a checklist on behalf of a connected business account. On success, the edited Message is returned.
- EditMessageLiveLocation
- Use this method to edit live location messages. A location can be edited until its live_period expires or editing is explicitly disabled by a call to stopMessageLiveLocation. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.
- EditMessageMedia
- Use this method to edit animation, audio, document, live photo, photo, or video messages, or to replace a text or a rich message with a media. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo, a live photo, or a video otherwise. When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file_id or specify a URL. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.
- EditMessageReplyMarkup
- Use this method to edit only the reply markup of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.
- EditMessageText
- Use this method to edit text, rich and game messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.
- EditStory
- Edits a story previously posted by the bot on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns Story on success.
- EditUserStarSubscription
- Allows the bot to cancel or re-enable extension of a subscription paid in Telegram Stars. Returns True on success.
- ExportChatInviteLink
- Use this method to generate a new primary invite link for a chat; any previously generated primary link is revoked. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the new invite link as String on success.
- ForwardMessage
- Use this method to forward messages of any kind. Service messages and messages with protected content can't be forwarded. On success, the sent Message is returned.
- ForwardMessages
- Use this method to forward multiple messages of any kind. If some of the specified messages can't be found or forwarded, they are skipped. Service messages and messages with protected content can't be forwarded. Album grouping is kept for forwarded messages. On success, an array of MessageId of the sent messages is returned.
- GetAvailableGifts
- Returns the list of gifts that can be sent by the bot to users and channel chats. Requires no parameters. Returns a Gifts object.
- GetBusinessAccountGifts
- Returns the gifts received and owned by a managed business account. Requires the can_view_gifts_and_stars business bot right. Returns OwnedGifts on success.
- GetBusinessAccountStarBalance
- Returns the amount of Telegram Stars owned by a managed business account. Requires the can_view_gifts_and_stars business bot right. Returns StarAmount on success.
- GetBusinessConnection
- Use this method to get information about the connection of the bot with a business account. Returns a BusinessConnection object on success.
- GetChat
- Use this method to get up-to-date information about the chat. Returns a ChatFullInfo object on success.
- GetChatAdministrators
- Use this method to get a list of administrators in a chat. Returns an Array of ChatMember objects.
- GetChatGifts
- Returns the gifts owned by a chat. Returns OwnedGifts on success.
- GetChatMember
- Use this method to get information about a member of a chat. The method is only guaranteed to work for other users if the bot is an administrator in the chat. Returns a ChatMember object on success.
- GetChatMemberCount
- Use this method to get the number of members in a chat. Returns Int on success.
- GetChatMenuButton
- Use this method to get the current value of the bot's menu button in a private chat, or the default menu button. Returns MenuButton on success.
- GetCustomEmojiStickers
- Use this method to get information about custom emoji stickers by their identifiers. Returns an Array of Sticker objects.
- GetFile
- Use this method to get basic information about a file and prepare it for downloading. For the moment, bots can download files of up to 20MB in size. On success, a File object is returned. The file can then be downloaded via the link https://api.telegram.org/file/bot<token>/<file_path>, where <file_path> is taken from the response. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling getFile again.
- GetForumTopicIconStickers
- Use this method to get custom emoji stickers, which can be used as a forum topic icon by any user. Requires no parameters. Returns an Array of Sticker objects.
- GetGameHighScores
- Use this method to get data for high score tables. Will return the score of the specified user and several of their neighbors in a game. Returns an Array of GameHighScore objects.
- GetManagedBotAccessSettings
- Use this method to get the access settings of a managed bot. Returns a BotAccessSettings object on success.
- GetManagedBotToken
- Use this method to get the token of a managed bot. Returns the token as String on success.
- GetMe
- A simple method for testing your bot's authentication token. Requires no parameters. Returns basic information about the bot in form of a User object.
- GetMyCommands
- Use this method to get the current list of the bot's commands for the given scope and user language. Returns an Array of BotCommand objects. If commands aren't set, an empty list is returned.
- GetMyDefaultAdministratorRights
- Use this method to get the current default administrator rights of the bot. Returns ChatAdministratorRights on success.
- GetMyDescription
- Use this method to get the current bot description for the given user language. Returns BotDescription on success.
- GetMyName
- Use this method to get the current bot name for the given user language. Returns BotName on success.
- GetMyShortDescription
- Use this method to get the current bot short description for the given user language. Returns BotShortDescription on success.
- GetMyStarBalance
- A method to get the current Telegram Stars balance of the bot. Requires no parameters. On success, returns a StarAmount object.
- GetStarTransactions
- Returns the bot's Telegram Star transactions in chronological order. On success, returns a StarTransactions object.
- GetStickerSet
- Use this method to get a sticker set. On success, a StickerSet object is returned.
- GetUpdates
- Use this method to receive incoming updates using long polling (wiki). Returns an Array of Update objects.
- GetUserChatBoosts
- Use this method to get the list of boosts added to a chat by a user. Requires administrator rights in the chat. Returns a UserChatBoosts object.
- GetUserGifts
- Returns the gifts owned and hosted by a user. Returns OwnedGifts on success.
- GetUserPersonalChatMessages
- Use this method to get the last messages from the personal chat (i.e., the chat currently added to their profile) of a given user. On success, an array of Message objects is returned.
- GetUserProfileAudios
- Use this method to get a list of profile audios for a user. Returns a UserProfileAudios object.
- GetUserProfilePhotos
- Use this method to get a list of profile pictures for a user. Returns a UserProfilePhotos object.
- GetWebhookInfo
- Use this method to get current webhook status. Requires no parameters. On success, returns a WebhookInfo object. If the bot is using getUpdates, will return an object with the url field empty.
- GiftPremiumSubscription
- Gifts a Telegram Premium subscription to the given user. Returns True on success.
- HideGeneralForumTopic
- Use this method to hide the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. The topic will be automatically closed if it was open. Returns True on success.
- LeaveChat
- Use this method for your bot to leave a group, supergroup or channel. Returns True on success.
- LogOut
- Use this method to log out from the cloud Bot API server before launching the bot locally. You must log out the bot before running it locally, otherwise there is no guarantee that the bot will receive updates. After a successful call, you can immediately log in on a local server, but will not be able to log in back to the cloud Bot API server for 10 minutes. Returns True on success. Requires no parameters.
- PinChatMessage
- Use this method to add a message to the list of pinned messages in a chat. In private chats and channel direct messages chats, all non-service messages can be pinned. Conversely, the bot must be an administrator with the 'can_pin_messages' right or the 'can_edit_messages' right to pin messages in groups and channels respectively. Returns True on success.
- PostStory
- Posts a story on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns Story on success.
- PromoteChatMember
- Use this method to promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Pass False for all boolean parameters to demote a user. Returns True on success.
- ReadBusinessMessage
- Marks incoming message as read on behalf of a business account. Requires the can_read_messages business bot right. Returns True on success.
- RefundStarPayment
- Refunds a successful payment in Telegram Stars. Returns True on success.
- RemoveBusinessAccountProfilePhoto
- Removes the current profile photo of a managed business account. Requires the can_edit_profile_photo business bot right. Returns True on success.
- RemoveChatVerification
- Removes verification from a chat that is currently verified on behalf of the organization represented by the bot. Returns True on success.
- RemoveMyProfilePhoto
- Removes the profile photo of the bot. Requires no parameters. Returns True on success.
- RemoveUserVerification
- Removes verification from a user who is currently verified on behalf of the organization represented by the bot. Returns True on success.
- ReopenForumTopic
- Use this method to reopen a closed topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success.
- ReopenGeneralForumTopic
- Use this method to reopen a closed 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. The topic will be automatically unhidden if it was hidden. Returns True on success.
- ReplaceManagedBotToken
- Use this method to revoke the current token of a managed bot and generate a new one. Returns the new token as String on success.
- ReplaceStickerInSet
- Use this method to replace an existing sticker in a sticker set with a new one. The method is equivalent to calling deleteStickerFromSet, then addStickerToSet, then setStickerPositionInSet. Returns True on success.
- RepostStory
- Reposts a story on behalf of a business account from another business account. Both business accounts must be managed by the same bot, and the story on the source account must have been posted (or reposted) by the bot. Requires the can_manage_stories business bot right for both business accounts. Returns Story on success.
- Request
- Response
- RestrictChatMember
- Use this method to restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work and must have the appropriate administrator rights. Pass True for all permissions to lift restrictions from a user. Returns True on success.
- RevokeChatInviteLink
- Use this method to revoke an invite link created by the bot. If the primary link is revoked, a new link is automatically generated. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the revoked invite link as ChatInviteLink object.
- SavePreparedInlineMessage
- Stores a message that can be sent by a user of a Mini App. Returns a PreparedInlineMessage object.
- SavePreparedKeyboardButton
- Stores a keyboard button that can be used by a user within a Mini App. Returns a PreparedKeyboardButton object.
- SendAnimation
- Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent Message is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future.
- SendAudio
- Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format. On success, the sent Message is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future.
- SendChatAction
- Use this method when you need to tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). Returns True on success.
- SendChatJoinRequestWebApp
- Use this method to process a received chat join request query by showing a Mini App to the user before deciding the outcome. Returns True on success.
- SendChecklist
- Use this method to send a checklist on behalf of a connected business account. On success, the sent Message is returned.
- SendContact
- Use this method to send phone contacts. On success, the sent Message is returned.
- SendDice
- Use this method to send an animated emoji that will display a random value. On success, the sent Message is returned.
- SendDocument
- Use this method to send general files. On success, the sent Message is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future.
- SendGame
- Use this method to send a game. On success, the sent Message is returned.
- SendGift
- Sends a gift to the given user or channel chat. The gift can't be converted to Telegram Stars by the receiver. Returns True on success.
- SendInvoice
- Use this method to send invoices. On success, the sent Message is returned.
- SendLivePhoto
- Use this method to send live photos. On success, the sent Message is returned.
- SendLocation
- Use this method to send point on the map. On success, the sent Message is returned.
- SendMediaGroup
- Use this method to send a group of photos, live photos, videos, documents or audios as an album. Documents and audio files can be only grouped in an album with messages of the same type. On success, an array of Message objects that were sent is returned.
- SendMessage
- Use this method to send text messages. On success, the sent Message is returned.
- SendMessageDraft
- Use this method to stream a partial message to a user while the message is being generated. Note that the streamed draft is ephemeral and acts as a temporary 30-second preview - once the output is finalized, you must call sendMessage with the complete message to persist it in the user's chat. Returns True on success.
- SendPaidMedia
- Use this method to send paid media. On success, the sent Message is returned.
- SendPhoto
- Use this method to send photos. On success, the sent Message is returned.
- SendPoll
- Use this method to send a native poll. On success, the sent Message is returned.
- SendRichMessage
- Use this method to send rich messages. If the message contains a block with a media element, then the bot must have the right to send the media to the chat. On success, the sent Message is returned.
- SendRichMessageDraft
- Use this method to stream a partial rich message to a user while the message is being generated. Note that the streamed draft is ephemeral and acts as a temporary 30-second preview - once the output is finalized, you must call sendRichMessage with the complete message to persist it in the user's chat. Returns True on success.
- SendSticker
- Use this method to send static .WEBP, animated .TGS, or video .WEBM stickers. On success, the sent Message is returned.
- SendVenue
- Use this method to send information about a venue. On success, the sent Message is returned.
- SendVideo
- Use this method to send video files, Telegram clients support MPEG4 videos (other formats may be sent as Document). On success, the sent Message is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future.
- SendVideoNote
- As of v.4.0, Telegram clients support rounded square MPEG4 videos of up to 1 minute long. Use this method to send video messages. On success, the sent Message is returned.
- SendVoice
- Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS, or in .MP3 format, or in .M4A format (other formats may be sent as Audio or Document). On success, the sent Message is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.
- SetBusinessAccountBio
- Changes the bio of a managed business account. Requires the can_change_bio business bot right. Returns True on success.
- SetBusinessAccountGiftSettings
- Changes the privacy settings pertaining to incoming gifts in a managed business account. Requires the can_change_gift_settings business bot right. Returns True on success.
- SetBusinessAccountName
- Changes the first and last name of a managed business account. Requires the can_change_name business bot right. Returns True on success.
- SetBusinessAccountProfilePhoto
- Changes the profile photo of a managed business account. Requires the can_edit_profile_photo business bot right. Returns True on success.
- SetBusinessAccountUsername
- Changes the username of a managed business account. Requires the can_change_username business bot right. Returns True on success.
- SetChatAdministratorCustomTitle
- Use this method to set a custom title for an administrator in a supergroup promoted by the bot. Returns True on success.
- SetChatDescription
- Use this method to change the description of a group, a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.
- SetChatMemberTag
- Use this method to set a tag for a regular member in a group or a supergroup. The bot must be an administrator in the chat for this to work and must have the can_manage_tags administrator right. Returns True on success.
- SetChatMenuButton
- Use this method to change the bot's menu button in a private chat, or the default menu button. Returns True on success.
- SetChatPermissions
- Use this method to set default chat permissions for all members. The bot must be an administrator in the group or a supergroup for this to work and must have the can_restrict_members administrator rights. Returns True on success.
- SetChatPhoto
- Use this method to set a new profile photo for the chat. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.
- SetChatStickerSet
- Use this method to set a new group sticker set for a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Use the field can_set_sticker_set optionally returned in getChat requests to check if the bot can use this method. Returns True on success.
- SetChatTitle
- Use this method to change the title of a chat. Titles can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.
- SetCustomEmojiStickerSetThumbnail
- Use this method to set the thumbnail of a custom emoji sticker set. Returns True on success.
- SetGameScore
- Use this method to set the score of the specified user in a game message. On success, if the message is not an inline message, the Message is returned, otherwise True is returned. Returns an error, if the new score is not greater than the user's current score in the chat and force is False.
- SetManagedBotAccessSettings
- Use this method to change the access settings of a managed bot. Returns True on success.
- SetMessageReaction
- Use this method to change the chosen reactions on a message. Service messages of some types can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. Bots can't use paid reactions. Returns True on success.
- SetMyCommands
- Use this method to change the list of the bot's commands. See this manual for more details about bot commands. Returns True on success.
- SetMyDefaultAdministratorRights
- Use this method to change the default administrator rights requested by the bot when it's added as an administrator to groups or channels. These rights will be suggested to users, but they are free to modify the list before adding the bot. Returns True on success.
- SetMyDescription
- Use this method to change the bot's description, which is shown in the chat with the bot if the chat is empty. Returns True on success.
- SetMyName
- Use this method to change the bot's name. Returns True on success.
- SetMyProfilePhoto
- Changes the profile photo of the bot. Returns True on success.
- SetMyShortDescription
- Use this method to change the bot's short description, which is shown on the bot's profile page and is sent together with the link when users share the bot. Returns True on success.
- SetPassportDataErrors
- Informs a user that some of the Telegram Passport elements they provided contains errors. The user will not be able to re-submit their Passport to you until the errors are fixed (the contents of the field for which you returned the error must change). Returns True on success.
- SetStickerEmojiList
- Use this method to change the list of emoji assigned to a regular or custom emoji sticker. The sticker must belong to a sticker set created by the bot. Returns True on success.
- SetStickerKeywords
- Use this method to change search keywords assigned to a regular or custom emoji sticker. The sticker must belong to a sticker set created by the bot. Returns True on success.
- SetStickerMaskPosition
- Use this method to change the mask position of a mask sticker. The sticker must belong to a sticker set that was created by the bot. Returns True on success.
- SetStickerPositionInSet
- Use this method to move a sticker in a set created by the bot to a specific position. Returns True on success.
- SetStickerSetThumbnail
- Use this method to set the thumbnail of a regular or mask sticker set. The format of the thumbnail file must match the format of the stickers in the set. Returns True on success.
- SetStickerSetTitle
- Use this method to set the title of a created sticker set. Returns True on success.
- SetUserEmojiStatus
- Changes the emoji status for a given user that previously allowed the bot to manage their emoji status via the Mini App method requestEmojiStatusAccess. Returns True on success.
- SetWebhook
- Use this method to specify a URL and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified URL, containing a JSON-serialized Update. In case of an unsuccessful request (a request with response HTTP status code different from 2XY), we will repeat the request and give up after a reasonable amount of attempts. Returns True on success.
- StopMessageLiveLocation
- Use this method to stop updating a live location message before live_period expires. On success, if the message is not an inline message, the edited Message is returned, otherwise True is returned.
- StopPoll
- Use this method to stop a poll which was sent by the bot. On success, the stopped Poll is returned.
- TelegramMethod
- TransferBusinessAccountStars
- Transfers Telegram Stars from the business account balance to the bot's balance. Requires the can_transfer_stars business bot right. Returns True on success.
- TransferGift
- Transfers an owned unique gift to another user. Requires the can_transfer_and_upgrade_gifts business bot right. Requires can_transfer_stars business bot right if the transfer is paid. Returns True on success.
- UnbanChatMember
- Use this method to unban a previously banned user in a supergroup or channel. The user will not return to the group or channel automatically, but will be able to join via link, etc. The bot must be an administrator for this to work. By default, this method guarantees that after the call the user is not a member of the chat, but will be able to join it. So if the user is a member of the chat they will also be removed from the chat. If you don't want this, use the parameter only_if_banned. Returns True on success.
- UnbanChatSenderChat
- Use this method to unban a previously banned channel chat in a supergroup or channel. The bot must be an administrator for this to work and must have the appropriate administrator rights. Returns True on success.
- UnhideGeneralForumTopic
- Use this method to unhide the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. Returns True on success.
- UnpinAllChatMessages
- Use this method to clear the list of pinned messages in a chat. In private chats and channel direct messages chats, no additional rights are required to unpin all pinned messages. Conversely, the bot must be an administrator with the 'can_pin_messages' right or the 'can_edit_messages' right to unpin all pinned messages in groups and channels respectively. Returns True on success.
- UnpinAllForumTopicMessages
- Use this method to clear the list of pinned messages in a forum topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup. Returns True on success.
- UnpinAllGeneralForumTopicMessages
- Use this method to clear the list of pinned messages in a General forum topic. The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup. Returns True on success.
- UnpinChatMessage
- Use this method to remove a message from the list of pinned messages in a chat. In private chats and channel direct messages chats, all messages can be unpinned. Conversely, the bot must be an administrator with the 'can_pin_messages' right or the 'can_edit_messages' right to unpin messages in groups and channels respectively. Returns True on success.
- UpgradeGift
- Upgrades a given regular gift to a unique gift. Requires the can_transfer_and_upgrade_gifts business bot right. Additionally requires the can_transfer_stars business bot right if the upgrade is paid. Returns True on success.
- UploadStickerFile
- Use this method to upload a file with a sticker for later use in the createNewStickerSet, addStickerToSet, or replaceStickerInSet methods (the file can be used multiple times). Returns the uploaded File on success.
- VerifyChat
- Verifies a chat on behalf of the organization which is represented by the bot. Returns True on success.
- VerifyUser
- Verifies a user on behalf of the organization which is represented by the bot. Returns True on success.
- AcceptedGiftTypes
- This object describes the types of gifts that can be gifted to a user or a chat.
- AffiliateInfo
- Contains information about the affiliate that received a commission via this transaction.
- Animation
- This object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound).
- Audio
- This object represents an audio file to be treated as music by the Telegram clients.
- BackgroundFill
- This object describes the way a background is filled based on the selected colors. Currently, it can be one of - BackgroundFillSolid - BackgroundFillGradient - BackgroundFillFreeformGradient
- BackgroundFillFreeformGradient
- The background is a freeform gradient that rotates after every message in the chat.
- BackgroundFillGradient
- The background is a gradient fill.
- BackgroundFillSolid
- The background is filled using the selected color.
- BackgroundFillUnion
- Discriminator resolver for the {@see BackgroundFill} union.
- BackgroundType
- This object describes the type of a background. Currently, it can be one of - BackgroundTypeFill - BackgroundTypeWallpaper - BackgroundTypePattern - BackgroundTypeChatTheme
- BackgroundTypeChatTheme
- The background is taken directly from a built-in chat theme.
- BackgroundTypeFill
- The background is automatically filled based on the selected colors.
- BackgroundTypePattern
- The background is a .PNG or .TGV (gzipped subset of SVG with MIME type 'application/x-tgwallpattern') pattern to be combined with the background fill chosen by the user.
- BackgroundTypeUnion
- Discriminator resolver for the {@see BackgroundType} union.
- BackgroundTypeWallpaper
- The background is a wallpaper in the JPEG format.
- Birthdate
- Describes the birthdate of a user.
- BotAccessSettings
- This object describes the access settings of a bot.
- BotCommand
- This object represents a bot command.
- BotCommandScope
- This object represents the scope to which bot commands are applied. Currently, the following 7 scopes are supported: - BotCommandScopeDefault - BotCommandScopeAllPrivateChats - BotCommandScopeAllGroupChats - BotCommandScopeAllChatAdministrators - BotCommandScopeChat - BotCommandScopeChatAdministrators - BotCommandScopeChatMember
- BotCommandScopeAllChatAdministrators
- Represents the scope of bot commands, covering all group and supergroup chat administrators.
- BotCommandScopeAllGroupChats
- Represents the scope of bot commands, covering all group and supergroup chats.
- BotCommandScopeAllPrivateChats
- Represents the scope of bot commands, covering all private chats.
- BotCommandScopeChat
- Represents the scope of bot commands, covering a specific chat.
- BotCommandScopeChatAdministrators
- Represents the scope of bot commands, covering all administrators of a specific group or supergroup chat.
- BotCommandScopeChatMember
- Represents the scope of bot commands, covering a specific member of a group or supergroup chat.
- BotCommandScopeDefault
- Represents the default scope of bot commands. Default commands are used if no commands with a narrower scope are specified for the user.
- BotCommandScopeUnion
- Discriminator resolver for the {@see BotCommandScope} union.
- BotDescription
- This object represents the bot's description.
- BotName
- This object represents the bot's name.
- BotShortDescription
- This object represents the bot's short description.
- BufferedInputFile
- Standalone abstract — InputFile is intentionally NOT a TelegramObject. Upstream aiogram declares `class InputFile(ABC)` (aiogram/types/input_file.py); attaching it to the TelegramObject tree would make it eligible for Serializer dump/load, which is wrong: InputFile values are detached by `BaseSession::prepareValue` into the multipart `$files` channel and never go through JSON.
- BusinessBotRights
- Represents the rights of a business bot.
- BusinessConnection
- Describes the connection of the bot with a business account.
- BusinessIntro
- Contains information about the start page settings of a Telegram Business account.
- BusinessLocation
- Contains information about the location of a Telegram Business account.
- BusinessMessagesDeleted
- This object is received when messages are deleted from a connected business account.
- BusinessOpeningHours
- Describes the opening hours of a business.
- BusinessOpeningHoursInterval
- Describes an interval of time during which a business is open.
- CallbackGame
- A placeholder, currently holds no information. Use BotFather to set up your game.
- CallbackQuery
- This object represents an incoming callback query from a callback button in an inline keyboard. If the button that originated the query was attached to a message sent by the bot, the field message will be present. If the button was attached to a message sent via the bot (in inline mode), the field inline_message_id will be present. Exactly one of the fields data or game_short_name will be present.
- Chat
- This object represents a chat.
- ChatAdministratorRights
- Represents the rights of an administrator in a chat.
- ChatBackground
- This object represents a chat background.
- ChatBoost
- This object contains information about a chat boost.
- ChatBoostAdded
- This object represents a service message about a user boosting a chat.
- ChatBoostRemoved
- This object represents a boost removed from a chat.
- ChatBoostSource
- This object describes the source of a chat boost. It can be one of - ChatBoostSourcePremium - ChatBoostSourceGiftCode - ChatBoostSourceGiveaway
- ChatBoostSourceGiftCode
- The boost was obtained by the creation of Telegram Premium gift codes to boost a chat. Each such code boosts the chat 4 times for the duration of the corresponding Telegram Premium subscription.
- ChatBoostSourceGiveaway
- The boost was obtained by the creation of a Telegram Premium or a Telegram Star giveaway. This boosts the chat 4 times for the duration of the corresponding Telegram Premium subscription for Telegram Premium giveaways and prize_star_count / 500 times for one year for Telegram Star giveaways.
- ChatBoostSourcePremium
- The boost was obtained by subscribing to Telegram Premium or by gifting a Telegram Premium subscription to another user.
- ChatBoostSourceUnion
- Discriminator resolver for the {@see ChatBoostSource} union.
- ChatBoostUpdated
- This object represents a boost added to a chat or changed.
- ChatFullInfo
- This object contains full information about a chat.
- ChatInviteLink
- Represents an invite link for a chat.
- ChatJoinRequest
- Represents a join request sent to a chat.
- ChatLocation
- Represents a location to which a chat is connected.
- ChatMember
- This object contains information about one member of a chat. Currently, the following 6 types of chat members are supported: - ChatMemberOwner - ChatMemberAdministrator - ChatMemberMember - ChatMemberRestricted - ChatMemberLeft - ChatMemberBanned
- ChatMemberAdministrator
- Represents a chat member that has some additional privileges.
- ChatMemberBanned
- Represents a chat member that was banned in the chat and can't return to the chat or view chat messages.
- ChatMemberLeft
- Represents a chat member that isn't currently a member of the chat, but may join it themselves.
- ChatMemberMember
- Represents a chat member that has no additional privileges or restrictions.
- ChatMemberOwner
- Represents a chat member that owns the chat and has all administrator privileges.
- ChatMemberRestricted
- Represents a chat member that is under certain restrictions in the chat. Supergroups only.
- ChatMemberUnion
- Discriminator resolver for the {@see ChatMember} union.
- ChatMemberUpdated
- This object represents changes in the status of a chat member.
- ChatOwnerChanged
- Describes a service message about an ownership change in the chat.
- ChatOwnerLeft
- Describes a service message about the chat owner leaving the chat.
- ChatPermissions
- Describes actions that a non-administrator user is allowed to take in a chat.
- ChatPhoto
- This object represents a chat photo.
- ChatShared
- This object contains information about a chat that was shared with the bot using a KeyboardButtonRequestChat button.
- Checklist
- Describes a checklist.
- ChecklistTask
- Describes a task in a checklist.
- ChecklistTasksAdded
- Describes a service message about tasks added to a checklist.
- ChecklistTasksDone
- Describes a service message about checklist tasks marked as done or not done.
- ChosenInlineResult
- Represents a result of an inline query that was chosen by the user and sent to their chat partner.
- Contact
- This object represents a phone contact.
- CopyTextButton
- This object represents an inline keyboard button that copies specified text to the clipboard.
- DateTime
- Marker subclass of DateTimeImmutable used for fields whose schema declares an integer Unix timestamp but should be exposed as a DateTime in PHP (e.g. Message::date). The Serializer converts on the way in (timestamp → DateTime) and out (DateTime → timestamp).
- Dice
- This object represents an animated emoji that displays a random value.
- DirectMessagePriceChanged
- Describes a service message about a change in the price of direct messages sent to a channel chat.
- DirectMessagesTopic
- Describes a topic of a direct messages chat.
- Document
- This object represents a general file (as opposed to photos, voice messages and audio files).
- EncryptedCredentials
- Describes data required for decrypting and authenticating EncryptedPassportElement. See the Telegram Passport Documentation for a complete description of the data decryption and authentication processes.
- EncryptedPassportElement
- Describes documents or other Telegram Passport elements shared with the bot by the user.
- ErrorEvent
- Dispatcher-synthetic event raised when a registered Telegram handler throws an exception that isn't an internal signalling marker (`SkipHandler` / `CancelHandler`). Mirrors aiogram's `aiogram.types.error_event.ErrorEvent`.
- ExternalReplyInfo
- This object contains information about a message that is being replied to, which may come from another chat or forum topic.
- File
- This object represents a file ready to be downloaded. The file can be downloaded via the link https://api.telegram.org/file/bot<token>/<file_path>. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling getFile.
- ForceReply
- Upon receiving a message with this object, Telegram clients will display a reply interface to the user (act as if the user has selected the bot's message and tapped 'Reply'). This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to sacrifice privacy mode. Not supported in channels and for messages sent on behalf of a user account.
- ForumTopic
- This object represents a forum topic.
- ForumTopicClosed
- This object represents a service message about a forum topic closed in the chat. Currently holds no information.
- ForumTopicCreated
- This object represents a service message about a new forum topic created in the chat.
- ForumTopicEdited
- This object represents a service message about an edited forum topic.
- ForumTopicReopened
- This object represents a service message about a forum topic reopened in the chat. Currently holds no information.
- FsInputFile
- Standalone abstract — InputFile is intentionally NOT a TelegramObject. Upstream aiogram declares `class InputFile(ABC)` (aiogram/types/input_file.py); attaching it to the TelegramObject tree would make it eligible for Serializer dump/load, which is wrong: InputFile values are detached by `BaseSession::prepareValue` into the multipart `$files` channel and never go through JSON.
- Game
- This object represents a game. Use BotFather to create and edit games, their short names will act as unique identifiers.
- GameHighScore
- This object represents one row of the high scores table for a game.
- GeneralForumTopicHidden
- This object represents a service message about General forum topic hidden in the chat. Currently holds no information.
- GeneralForumTopicUnhidden
- This object represents a service message about General forum topic unhidden in the chat. Currently holds no information.
- Gift
- This object represents a gift that can be sent by the bot.
- GiftBackground
- This object describes the background of a gift.
- GiftInfo
- Describes a service message about a regular gift that was sent or received.
- Gifts
- This object represent a list of gifts.
- Giveaway
- This object represents a message about a scheduled giveaway.
- GiveawayCompleted
- This object represents a service message about the completion of a giveaway without public winners.
- GiveawayCreated
- This object represents a service message about the creation of a scheduled giveaway.
- GiveawayWinners
- This object represents a message about the completion of a giveaway with public winners.
- InaccessibleMessage
- This object describes a message that was deleted or is otherwise inaccessible to the bot.
- InlineKeyboardButton
- This object represents one button of an inline keyboard. Exactly one of the fields other than text, icon_custom_emoji_id, and style must be used to specify the type of the button.
- InlineKeyboardMarkup
- This object represents an inline keyboard that appears right next to the message it belongs to.
- InlineQuery
- This object represents an incoming inline query. When the user sends an empty query, your bot could return some default or trending results.
- InlineQueryResult
- This object represents one result of an inline query. Telegram clients currently support results of the following 20 types: - InlineQueryResultCachedAudio - InlineQueryResultCachedDocument - InlineQueryResultCachedGif - InlineQueryResultCachedMpeg4Gif - InlineQueryResultCachedPhoto - InlineQueryResultCachedSticker - InlineQueryResultCachedVideo - InlineQueryResultCachedVoice - InlineQueryResultArticle - InlineQueryResultAudio - InlineQueryResultContact - InlineQueryResultGame - InlineQueryResultDocument - InlineQueryResultGif - InlineQueryResultLocation - InlineQueryResultMpeg4Gif - InlineQueryResultPhoto - InlineQueryResultVenue - InlineQueryResultVideo - InlineQueryResultVoice Note: All URLs passed in inline query results will be available to end users and therefore must be assumed to be public.
- InlineQueryResultArticle
- Represents a link to an article or web page.
- InlineQueryResultAudio
- Represents a link to an MP3 audio file. By default, this audio file will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the audio.
- InlineQueryResultCachedAudio
- Represents a link to an MP3 audio file stored on the Telegram servers. By default, this audio file will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the audio.
- InlineQueryResultCachedDocument
- Represents a link to a file stored on the Telegram servers. By default, this file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the file.
- InlineQueryResultCachedGif
- Represents a link to an animated GIF file stored on the Telegram servers. By default, this animated GIF file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with specified content instead of the animation.
- InlineQueryResultCachedMpeg4Gif
- Represents a link to a video animation (H.264/MPEG-4 AVC video without sound) stored on the Telegram servers. By default, this animated MPEG-4 file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation.
- InlineQueryResultCachedPhoto
- Represents a link to a photo stored on the Telegram servers. By default, this photo will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the photo.
- InlineQueryResultCachedSticker
- Represents a link to a sticker stored on the Telegram servers. By default, this sticker will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the sticker.
- InlineQueryResultCachedVideo
- Represents a link to a video file stored on the Telegram servers. By default, this video file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the video.
- InlineQueryResultCachedVoice
- Represents a link to a voice message stored on the Telegram servers. By default, this voice message will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the voice message.
- InlineQueryResultContact
- Represents a contact with a phone number. By default, this contact will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the contact.
- InlineQueryResultDocument
- Represents a link to a file. By default, this file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the file. Currently, only .PDF and .ZIP files can be sent using this method.
- InlineQueryResultGame
- Represents a Game.
- InlineQueryResultGif
- Represents a link to an animated GIF file. By default, this animated GIF file will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation.
- InlineQueryResultLocation
- Represents a location on a map. By default, the location will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the location.
- InlineQueryResultMpeg4Gif
- Represents a link to a video animation (H.264/MPEG-4 AVC video without sound). By default, this animated MPEG-4 file will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation.
- InlineQueryResultPhoto
- Represents a link to a photo. By default, this photo will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the photo.
- InlineQueryResultsButton
- This object represents a button to be shown above inline query results. You must use exactly one of the optional fields.
- InlineQueryResultUnion
- Discriminator resolver for the {@see InlineQueryResult} union.
- InlineQueryResultVenue
- Represents a venue. By default, the venue will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the venue.
- InlineQueryResultVideo
- Represents a link to a page containing an embedded video player or a video file. By default, this video file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the video.
- InlineQueryResultVoice
- Represents a link to a voice recording in an .OGG container encoded with OPUS. By default, this voice recording will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the the voice message.
- InputChecklist
- Describes a checklist to create.
- InputChecklistTask
- Describes a task to add to a checklist.
- InputContactMessageContent
- Represents the content of a contact message to be sent as the result of an inline query.
- InputFile
- Standalone abstract — InputFile is intentionally NOT a TelegramObject. Upstream aiogram declares `class InputFile(ABC)` (aiogram/types/input_file.py); attaching it to the TelegramObject tree would make it eligible for Serializer dump/load, which is wrong: InputFile values are detached by `BaseSession::prepareValue` into the multipart `$files` channel and never go through JSON.
- InputInvoiceMessageContent
- Represents the content of an invoice message to be sent as the result of an inline query.
- InputLocationMessageContent
- Represents the content of a location message to be sent as the result of an inline query.
- InputMedia
- This object represents the content of a media message to be sent. It should be one of - InputMediaAnimation - InputMediaAudio - InputMediaDocument - InputMediaLivePhoto - InputMediaPhoto - InputMediaVideo
- InputMediaAnimation
- Represents an animation file (GIF or H.264/MPEG-4 AVC video without sound) to be sent.
- InputMediaAudio
- Represents an audio file to be treated as music to be sent.
- InputMediaDocument
- Represents a general file to be sent.
- InputMediaLink
- Represents an HTTP link to be sent.
- InputMediaLivePhoto
- Represents a live photo to be sent.
- InputMediaLocation
- Represents a location to be sent.
- InputMediaPhoto
- Represents a photo to be sent.
- InputMediaSticker
- Represents a sticker file to be sent.
- InputMediaUnion
- Discriminator resolver for the {@see InputMedia} union.
- InputMediaVenue
- Represents a venue to be sent.
- InputMediaVideo
- Represents a video to be sent.
- InputMessageContent
- This object represents the content of a message to be sent as a result of an inline query. Telegram clients currently support the following types: - InputTextMessageContent - InputRichMessageContent - InputLocationMessageContent - InputVenueMessageContent - InputContactMessageContent - InputInvoiceMessageContent
- InputPaidMedia
- This object describes the paid media to be sent. Currently, it can be one of - InputPaidMediaLivePhoto - InputPaidMediaPhoto - InputPaidMediaVideo
- InputPaidMediaLivePhoto
- The paid media to send is a live photo.
- InputPaidMediaPhoto
- The paid media to send is a photo.
- InputPaidMediaUnion
- Discriminator resolver for the {@see InputPaidMedia} union.
- InputPaidMediaVideo
- The paid media to send is a video.
- InputPollMedia
- This object represents the content of a poll description or a quiz explanation to be sent. It should be one of - InputMediaAnimation - InputMediaAudio - InputMediaDocument - InputMediaLivePhoto - InputMediaLocation - InputMediaPhoto - InputMediaVenue - InputMediaVideo
- InputPollMediaUnion
- Discriminator resolver for the {@see InputPollMedia} union.
- InputPollOption
- This object contains information about one answer option in a poll to be sent.
- InputPollOptionMedia
- This object represents the content of a poll option to be sent. It should be one of - InputMediaAnimation - InputMediaLink - InputMediaLivePhoto - InputMediaLocation - InputMediaPhoto - InputMediaSticker - InputMediaVenue - InputMediaVideo
- InputPollOptionMediaUnion
- Discriminator resolver for the {@see InputPollOptionMedia} union.
- InputProfilePhoto
- This object describes a profile photo to set. Currently, it can be one of - InputProfilePhotoStatic - InputProfilePhotoAnimated
- InputProfilePhotoAnimated
- An animated profile photo in the MPEG4 format.
- InputProfilePhotoStatic
- A static profile photo in the .JPG format.
- InputProfilePhotoUnion
- Discriminator resolver for the {@see InputProfilePhoto} union.
- InputRichMessage
- Describes a rich message to be sent. Exactly one of the fields html or markdown must be used.
- InputRichMessageContent
- Represents the content of a rich message to be sent as the result of an inline query.
- InputSticker
- This object describes a sticker to be added to a sticker set.
- InputStoryContent
- This object describes the content of a story to post. Currently, it can be one of - InputStoryContentPhoto - InputStoryContentVideo
- InputStoryContentPhoto
- Describes a photo to post as a story.
- InputStoryContentUnion
- Discriminator resolver for the {@see InputStoryContent} union.
- InputStoryContentVideo
- Describes a video to post as a story.
- InputTextMessageContent
- Represents the content of a text message to be sent as the result of an inline query.
- InputVenueMessageContent
- Represents the content of a venue message to be sent as the result of an inline query.
- Invoice
- This object contains basic information about an invoice.
- KeyboardButton
- This object represents one button of the reply keyboard. At most one of the fields other than text, icon_custom_emoji_id, and style must be used to specify the type of the button. For simple text buttons, String can be used instead of this object to specify the button text.
- KeyboardButtonPollType
- This object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed.
- KeyboardButtonRequestChat
- This object defines the criteria used to request a suitable chat. Information about the selected chat will be shared with the bot when the corresponding button is pressed. The bot will be granted requested rights in the chat if appropriate.. Source: https://core.telegram.org/bots/api#keyboardbuttonrequestchat
- KeyboardButtonRequestManagedBot
- This object defines the parameters for the creation of a managed bot. Information about the created bot will be shared with the bot using the update managed_bot and a Message with the field managed_bot_created.
- KeyboardButtonRequestUsers
- This object defines the criteria used to request suitable users. Information about the selected users will be shared with the bot when the corresponding button is pressed.
- LabeledPrice
- This object represents a portion of the price for goods or services.
- Link
- Represents an HTTP link.
- LinkPreviewOptions
- Describes the options used for link preview generation.
- LivePhoto
- This object represents a live photo.
- Location
- This object represents a point on the map.
- LocationAddress
- Describes the physical address of a location.
- LoginUrl
- This object represents a parameter of the inline keyboard button used to automatically authorize a user. Serves as a great replacement for the Telegram Login Widget when the user is coming from Telegram. All the user needs to do is tap/click a button and confirm that they want to log in: Telegram apps support these buttons as of version 5.7.
- ManagedBotCreated
- This object contains information about the bot that was created to be managed by the current bot.
- ManagedBotUpdated
- This object contains information about the creation, token update, or owner update of a bot that is managed by the current bot.
- MaskPosition
- This object describes the position on faces where a mask should be placed by default.
- MaybeInaccessibleMessage
- This object describes a message that can be inaccessible to the bot. It can be one of - Message - InaccessibleMessage
- MenuButton
- This object describes the bot's menu button in a private chat. It should be one of - MenuButtonCommands - MenuButtonWebApp - MenuButtonDefault If a menu button other than MenuButtonDefault is set for a private chat, then it is applied in the chat. Otherwise the default menu button is applied. By default, the menu button opens the list of bot commands.
- MenuButtonCommands
- Represents a menu button, which opens the bot's list of commands.
- MenuButtonDefault
- Describes that no specific value for the menu button was set.
- MenuButtonUnion
- Discriminator resolver for the {@see MenuButton} union.
- MenuButtonWebApp
- Represents a menu button, which launches a Web App.
- Message
- This object represents a message.
- MessageAutoDeleteTimerChanged
- This object represents a service message about a change in auto-delete timer settings.
- MessageEntity
- This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.
- MessageId
- This object represents a unique message identifier.
- MessageOrigin
- This object describes the origin of a message. It can be one of - MessageOriginUser - MessageOriginHiddenUser - MessageOriginChat - MessageOriginChannel
- MessageOriginChannel
- The message was originally sent to a channel chat.
- MessageOriginChat
- The message was originally sent on behalf of a chat to a group chat.
- MessageOriginHiddenUser
- The message was originally sent by an unknown user.
- MessageOriginUnion
- Discriminator resolver for the {@see MessageOrigin} union.
- MessageOriginUser
- The message was originally sent by a known user.
- MessageReactionCountUpdated
- This object represents reaction changes on a message with anonymous reactions.
- MessageReactionUpdated
- This object represents a change of a reaction on a message performed by a user.
- MutableTelegramObject
- Non-readonly parent for the small set of schema types whose `replace.yml` carries `bases: [MutableTelegramObject]` — currently 16 entities, primarily keyboard/menu/input-media builders that need post-construction mutation.
- OrderInfo
- This object represents information about an order.
- OwnedGift
- This object describes a gift received and owned by a user or a chat. Currently, it can be one of - OwnedGiftRegular - OwnedGiftUnique
- OwnedGiftRegular
- Describes a regular gift owned by a user or a chat.
- OwnedGifts
- Contains the list of gifts received and owned by a user or a chat.
- OwnedGiftUnion
- Discriminator resolver for the {@see OwnedGift} union.
- OwnedGiftUnique
- Describes a unique gift received and owned by a user or a chat.
- PaidMedia
- This object describes paid media. Currently, it can be one of - PaidMediaLivePhoto - PaidMediaPhoto - PaidMediaPreview - PaidMediaVideo
- PaidMediaInfo
- Describes the paid media added to a message.
- PaidMediaLivePhoto
- The paid media is a live photo.
- PaidMediaPhoto
- The paid media is a photo.
- PaidMediaPreview
- The paid media isn't available before the payment.
- PaidMediaPurchased
- This object contains information about a paid media purchase.
- PaidMediaUnion
- Discriminator resolver for the {@see PaidMedia} union.
- PaidMediaVideo
- The paid media is a video.
- PaidMessagePriceChanged
- Describes a service message about a change in the price of paid messages within a chat.
- PassportData
- Describes Telegram Passport data shared with the bot by the user.
- PassportElementError
- This object represents an error in the Telegram Passport element which was submitted that should be resolved by the user. It should be one of: - PassportElementErrorDataField - PassportElementErrorFrontSide - PassportElementErrorReverseSide - PassportElementErrorSelfie - PassportElementErrorFile - PassportElementErrorFiles - PassportElementErrorTranslationFile - PassportElementErrorTranslationFiles - PassportElementErrorUnspecified
- PassportElementErrorDataField
- Represents an issue in one of the data fields that was provided by the user. The error is considered resolved when the field's value changes.
- PassportElementErrorFile
- Represents an issue with a document scan. The error is considered resolved when the file with the document scan changes.
- PassportElementErrorFiles
- Represents an issue with a list of scans. The error is considered resolved when the list of files containing the scans changes.
- PassportElementErrorFrontSide
- Represents an issue with the front side of a document. The error is considered resolved when the file with the front side of the document changes.
- PassportElementErrorReverseSide
- Represents an issue with the reverse side of a document. The error is considered resolved when the file with reverse side of the document changes.
- PassportElementErrorSelfie
- Represents an issue with the selfie with a document. The error is considered resolved when the file with the selfie changes.
- PassportElementErrorTranslationFile
- Represents an issue with one of the files that constitute the translation of a document. The error is considered resolved when the file changes.
- PassportElementErrorTranslationFiles
- Represents an issue with the translated version of a document. The error is considered resolved when a file with the document translation change.
- PassportElementErrorUnion
- Discriminator resolver for the {@see PassportElementError} union.
- PassportElementErrorUnspecified
- Represents an issue in an unspecified place. The error is considered resolved when new data is added.
- PassportFile
- This object represents a file uploaded to Telegram Passport. Currently all Telegram Passport files are in JPEG format when decrypted and don't exceed 10MB.
- PhotoSize
- This object represents one size of a photo or a file / sticker thumbnail.
- Poll
- This object contains information about a poll.
- PollAnswer
- This object represents an answer of a user in a non-anonymous poll.
- PollMedia
- At most one of the optional fields can be present in any given object.
- PollOption
- This object contains information about one answer option in a poll.
- PollOptionAdded
- Describes a service message about an option added to a poll.
- PollOptionDeleted
- Describes a service message about an option deleted from a poll.
- PreCheckoutQuery
- This object contains information about an incoming pre-checkout query.
- PreparedInlineMessage
- Describes an inline message to be sent by a user of a Mini App.
- PreparedKeyboardButton
- Describes a keyboard button to be used by a user of a Mini App.
- ProximityAlertTriggered
- This object represents the content of a service message, sent whenever a user in the chat triggers a proximity alert set by another user.
- ReactionCount
- Represents a reaction added to a message along with the number of times it was added.
- ReactionType
- This object describes the type of a reaction. Currently, it can be one of - ReactionTypeEmoji - ReactionTypeCustomEmoji - ReactionTypePaid
- ReactionTypeCustomEmoji
- The reaction is based on a custom emoji.
- ReactionTypeEmoji
- The reaction is based on an emoji.
- ReactionTypePaid
- The reaction is paid.
- ReactionTypeUnion
- Discriminator resolver for the {@see ReactionType} union.
- RefundedPayment
- This object contains basic information about a refunded payment.
- ReplyKeyboardMarkup
- This object represents a custom keyboard with reply options (see Introduction to bots for details and examples). Not supported in channels and for messages sent on behalf of a business account.
- ReplyKeyboardRemove
- Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see ReplyKeyboardMarkup). Not supported in channels and for messages sent on behalf of a business account.
- ReplyParameters
- Describes reply parameters for the message that is being sent.
- ResponseParameters
- Describes why a request was unsuccessful.
- RevenueWithdrawalState
- This object describes the state of a revenue withdrawal operation. Currently, it can be one of - RevenueWithdrawalStatePending - RevenueWithdrawalStateSucceeded - RevenueWithdrawalStateFailed
- RevenueWithdrawalStateFailed
- The withdrawal failed and the transaction was refunded.
- RevenueWithdrawalStatePending
- The withdrawal is in progress.
- RevenueWithdrawalStateSucceeded
- The withdrawal succeeded.
- RevenueWithdrawalStateUnion
- Discriminator resolver for the {@see RevenueWithdrawalState} union.
- RichBlock
- This object represents a block in a rich formatted message. Currently, it can be any of the following types: - RichBlockParagraph - RichBlockSectionHeading - RichBlockPreformatted - RichBlockFooter - RichBlockDivider - RichBlockMathematicalExpression - RichBlockAnchor - RichBlockList - RichBlockBlockQuotation - RichBlockPullQuotation - RichBlockCollage - RichBlockSlideshow - RichBlockTable - RichBlockDetails - RichBlockMap - RichBlockAnimation - RichBlockAudio - RichBlockPhoto - RichBlockVideo - RichBlockVoiceNote - RichBlockThinking
- RichBlockAnchor
- A block with an anchor, corresponding to the HTML tag <a> with the attribute name.
- RichBlockAnimation
- A block with an animation, corresponding to the HTML tag <video>.
- RichBlockAudio
- A block with a music file, corresponding to the HTML tag <audio>.
- RichBlockBlockQuotation
- A block quotation, corresponding to the HTML tag <blockquote>.
- RichBlockCaption
- Caption of a rich formatted block.
- RichBlockCollage
- A collage, corresponding to the custom HTML tag <tg-collage>.
- RichBlockDetails
- An expandable block for details disclosure, corresponding to the HTML tag <details>.
- RichBlockDivider
- A divider, corresponding to the HTML tag <hr/>.
- RichBlockFooter
- A footer, corresponding to the HTML tag <footer>.
- RichBlockList
- A list of blocks, corresponding to the HTML tag <ul> or <ol> with multiple nested tags <li>.
- RichBlockListItem
- An item of a list.
- RichBlockMap
- A block with a map, corresponding to the custom HTML tag <tg-map>.
- RichBlockMathematicalExpression
- A block with a mathematical expression in LaTeX format, corresponding to the custom HTML tag <tg-math-block>.
- RichBlockParagraph
- A text paragraph, corresponding to the HTML tag <p>.
- RichBlockPhoto
- A block with a photo, corresponding to the HTML tag <photo>.
- RichBlockPreformatted
- A preformatted text block, corresponding to the nested HTML tags <pre> and <code>.
- RichBlockPullQuotation
- A quotation with centered text, loosely corresponding to the HTML tag <aside>.
- RichBlockSectionHeading
- A section heading, corresponding to the HTML tags <h1>, <h2>, <h3>, <h4>, <h5>, or <h6>.
- RichBlockSlideshow
- A slideshow, corresponding to the custom HTML tag <tg-slideshow>.
- RichBlockTable
- A table, corresponding to the HTML tag <table>.
- RichBlockTableCell
- Cell in a table.
- RichBlockThinking
- A block with a 'Thinking…' placeholder, corresponding to the custom HTML tag <tg-thinking>. The block may be used only in sendRichMessageDraft, therefore it can't be received in messages. See https://t.me/addemoji/AIActions for examples of custom emoji, which are recommended for usage in the block.
- RichBlockUnion
- Discriminator resolver for the {@see RichBlock} union.
- RichBlockVideo
- A block with a video, corresponding to the HTML tag <video>.
- RichBlockVoiceNote
- A block with a voice note, corresponding to the HTML tag <audio>.
- RichMessage
- Rich formatted message.
- RichText
- This object represents a rich formatted text. Currently, it can be either a String for plain text, an Array of RichText, or any of the following types: - RichTextBold - RichTextItalic - RichTextUnderline - RichTextStrikethrough - RichTextSpoiler - RichTextDateTime - RichTextTextMention - RichTextSubscript - RichTextSuperscript - RichTextMarked - RichTextCode - RichTextCustomEmoji - RichTextMathematicalExpression - RichTextUrl - RichTextEmailAddress - RichTextPhoneNumber - RichTextBankCardNumber - RichTextMention - RichTextHashtag - RichTextCashtag - RichTextBotCommand - RichTextAnchor - RichTextAnchorLink - RichTextReference - RichTextReferenceLink
- RichTextAnchor
- An anchor.
- RichTextAnchorLink
- A link to an anchor.
- RichTextBankCardNumber
- A text with a bank card number.
- RichTextBold
- A bold text.
- RichTextBotCommand
- A bot command.
- RichTextCashtag
- A cashtag.
- RichTextCode
- A monowidth text.
- RichTextCustomEmoji
- A custom emoji.
- RichTextDateTime
- Formatted date and time.
- RichTextEmailAddress
- A text with an email address.
- RichTextHashtag
- A hashtag.
- RichTextItalic
- An italicized text.
- RichTextMarked
- A marked text.
- RichTextMathematicalExpression
- A mathematical expression.
- RichTextMention
- A mention by a username.
- RichTextPhoneNumber
- A text with a phone number.
- RichTextReference
- A reference.
- RichTextReferenceLink
- A link to a reference.
- RichTextSpoiler
- A text covered by a spoiler.
- RichTextStrikethrough
- A strikethrough text.
- RichTextSubscript
- A subscript text.
- RichTextSuperscript
- A superscript text.
- RichTextTextMention
- A mention of a Telegram user by their identifier.
- RichTextUnderline
- An underlined text.
- RichTextUnion
- Discriminator resolver for the {@see RichText} union.
- RichTextUrl
- A text with a link.
- SentGuestMessage
- Describes an inline message sent by a guest bot.
- SentWebAppMessage
- Describes an inline message sent by a Web App on behalf of a user.
- SharedUser
- This object contains information about a user that was shared with the bot using a KeyboardButtonRequestUsers button.
- ShippingAddress
- This object represents a shipping address.
- ShippingOption
- This object represents one shipping option.
- ShippingQuery
- This object contains information about an incoming shipping query.
- StarAmount
- Describes an amount of Telegram Stars.
- StarTransaction
- Describes a Telegram Star transaction. Note that if the buyer initiates a chargeback with the payment provider from whom they acquired Stars (e.g., Apple, Google) following this transaction, the refunded Stars will be deducted from the bot's balance. This is outside of Telegram's control.
- StarTransactions
- Contains a list of Telegram Star transactions.
- Sticker
- This object represents a sticker.
- StickerSet
- This object represents a sticker set.
- Story
- This object represents a story.
- StoryArea
- Describes a clickable area on a story media.
- StoryAreaPosition
- Describes the position of a clickable area within a story.
- StoryAreaType
- Describes the type of a clickable area on a story. Currently, it can be one of - StoryAreaTypeLocation - StoryAreaTypeSuggestedReaction - StoryAreaTypeLink - StoryAreaTypeWeather - StoryAreaTypeUniqueGift
- StoryAreaTypeLink
- Describes a story area pointing to an HTTP or tg:// link. Currently, a story can have up to 3 link areas.
- StoryAreaTypeLocation
- Describes a story area pointing to a location. Currently, a story can have up to 10 location areas.
- StoryAreaTypeSuggestedReaction
- Describes a story area pointing to a suggested reaction. Currently, a story can have up to 5 suggested reaction areas.
- StoryAreaTypeUnion
- Discriminator resolver for the {@see StoryAreaType} union.
- StoryAreaTypeUniqueGift
- Describes a story area pointing to a unique gift. Currently, a story can have at most 1 unique gift area.
- StoryAreaTypeWeather
- Describes a story area containing weather information. Currently, a story can have up to 3 weather areas.
- SuccessfulPayment
- This object contains basic information about a successful payment. Note that if the buyer initiates a chargeback with the relevant payment provider following this transaction, the funds may be debited from your balance. This is outside of Telegram's control.
- SuggestedPostApprovalFailed
- Describes a service message about the failed approval of a suggested post. Currently, only caused by insufficient user funds at the time of approval.
- SuggestedPostApproved
- Describes a service message about the approval of a suggested post.
- SuggestedPostDeclined
- Describes a service message about the rejection of a suggested post.
- SuggestedPostInfo
- Contains information about a suggested post.
- SuggestedPostPaid
- Describes a service message about a successful payment for a suggested post.
- SuggestedPostParameters
- Contains parameters of a post that is being suggested by the bot.
- SuggestedPostPrice
- Describes the price of a suggested post.
- SuggestedPostRefunded
- Describes a service message about a payment refund for a suggested post.
- SwitchInlineQueryChosenChat
- This object represents an inline button that switches the current user to inline mode in a chosen chat, with an optional default inline query.
- TelegramObject
- TextQuote
- This object contains information about the quoted part of a message that is replied to by the given message.
- TransactionPartner
- This object describes the source of a transaction, or its recipient for outgoing transactions. Currently, it can be one of - TransactionPartnerUser - TransactionPartnerChat - TransactionPartnerAffiliateProgram - TransactionPartnerFragment - TransactionPartnerTelegramAds - TransactionPartnerTelegramApi - TransactionPartnerOther
- TransactionPartnerAffiliateProgram
- Describes the affiliate program that issued the affiliate commission received via this transaction.
- TransactionPartnerChat
- Describes a transaction with a chat.
- TransactionPartnerFragment
- Describes a withdrawal transaction with Fragment.
- TransactionPartnerOther
- Describes a transaction with an unknown source or recipient.
- TransactionPartnerTelegramAds
- Describes a withdrawal transaction to the Telegram Ads platform.
- TransactionPartnerTelegramApi
- Describes a transaction with payment for paid broadcasting.
- TransactionPartnerUnion
- Discriminator resolver for the {@see TransactionPartner} union.
- TransactionPartnerUser
- Describes a transaction with a user.
- UniqueGift
- This object describes a unique gift that was upgraded from a regular gift.
- UniqueGiftBackdrop
- This object describes the backdrop of a unique gift.
- UniqueGiftBackdropColors
- This object describes the colors of the backdrop of a unique gift.
- UniqueGiftColors
- This object contains information about the color scheme for a user's name, message replies and link previews based on a unique gift.
- UniqueGiftInfo
- Describes a service message about a unique gift that was sent or received.
- UniqueGiftModel
- This object describes the model of a unique gift.
- UniqueGiftSymbol
- This object describes the symbol shown on the pattern of a unique gift.
- Unspecified
- Sentinel singleton for "argument was not provided" cases.
- Update
- This object represents an incoming update.
- UrlInputFile
- Standalone abstract — InputFile is intentionally NOT a TelegramObject. Upstream aiogram declares `class InputFile(ABC)` (aiogram/types/input_file.py); attaching it to the TelegramObject tree would make it eligible for Serializer dump/load, which is wrong: InputFile values are detached by `BaseSession::prepareValue` into the multipart `$files` channel and never go through JSON.
- User
- This object represents a Telegram user or bot.
- UserChatBoosts
- This object represents a list of boosts added to a chat by a user.
- UserProfileAudios
- This object represents the audios displayed on a user's profile.
- UserProfilePhotos
- This object represent a user's profile pictures.
- UserRating
- This object describes the rating of a user based on their Telegram Star spendings.
- UsersShared
- This object contains information about the users whose identifiers were shared with the bot using a KeyboardButtonRequestUsers button.
- Venue
- This object represents a venue.
- Video
- This object represents a video file.
- VideoChatEnded
- This object represents a service message about a video chat ended in the chat.
- VideoChatParticipantsInvited
- This object represents a service message about new members invited to a video chat.
- VideoChatScheduled
- This object represents a service message about a video chat scheduled in the chat.
- VideoChatStarted
- This object represents a service message about a video chat started in the chat. Currently holds no information.
- VideoNote
- This object represents a video message (available in Telegram apps as of v.4.0).
- VideoQuality
- This object represents a video file of a specific quality.
- Voice
- This object represents a voice note.
- WebAppData
- Describes data sent from a Web App to the bot.
- WebAppInfo
- Describes a Web App.
- WebhookInfo
- Describes the current status of a webhook.
- WriteAccessAllowed
- This object represents a service message about a user allowing a bot to write messages after adding it to the attachment menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method requestWriteAccess.
- AuthWidget
- Telegram Login Widget signature validation.
- Backoff
- Stateful exponential-backoff helper for the long-poll retry loop — port of `aiogram.utils.backoff.Backoff`.
- BackoffConfig
- Tuning knobs for the long-poll retry `Backoff` — port of `aiogram.utils.backoff.BackoffConfig`.
- CallbackAnswer
- Mutable config DTO that carries the answer parameters for a single {@see CallbackAnswerMiddleware} invocation.
- CallbackAnswerMiddleware
- Dispatcher-side middleware that automatically answers callback queries.
- ChatActionHandle
- A handle returned by {@see ChatActionSender::start()}.
- ChatActionMiddleware
- Dispatcher-side middleware that wraps every Message handler with a {@see ChatActionSender} by default.
- ChatActionSender
- Periodically emits a `sendChatAction` call to Telegram while a long operation is running, giving the user visual feedback that the bot is active.
- DeepLinking
- Telegram deep-linking helpers.
- InlineKeyboardBuilder
- Fluent builder for `InlineKeyboardMarkup`.
- KeyboardBuilder
- Abstract builder that manages a two-dimensional button grid.
- ReplyKeyboardBuilder
- Fluent builder for `ReplyKeyboardMarkup`.
- Link
- Telegram and documentation link builders.
- AttrDict
- Hybrid dict / object that lets `MagicFilter` resolve both `F->foo` (the attribute path) and `F[foo]` (the subscript path) against a single value.
- MagicFilterException
- Base for every exception thrown from the magic-filter runtime.
- ParamsConflict
- User-facing error: a caller passed mutually-exclusive options to a MagicFilter builder method (for example `regexp(mode=…, search=…)` — both at once is meaningless).
- RejectOperations
- Internal flow-control exception: raised by an operation to indicate it cannot resolve against the current value (missing attribute, key error, type mismatch, cast failure, …). Caught by `MagicFilter::_resolve` which then marks the remaining non-`important` operations as rejected and threads `null` through the chain until either an `important` operation runs or the chain terminates.
- SwitchMode
- Control-flow exception family used internally by GetItem-style operations to switch the resolver into "all" or "any" mode over an iterable subject.
- SwitchModeToAll
- Signals the resolver to evaluate the remaining operations against every element of the current iterable value and accept only when ALL succeed.
- SwitchModeToAny
- Signals the resolver to evaluate the remaining operations against every element of the current iterable value and accept when ANY succeeds.
- MagicFilter
- Lazy, immutable chain of predicate operations that resolves against a subject value when `resolve()` is called.
- MagicFilterAsFilter
- Bridge that turns a `MagicFilter` chain into a dispatcher-consumable `Filter`. Mirrors the upstream `MagicFilter` → `Filter` adapter behaviour: aiogram passes a `MagicFilter` instance straight where a `Filter` is expected and the dispatcher's `_check` wraps it via `MagicFilter.resolve`. The PHP `Filter` abstract is more rigid (`__invoke(object, array)`); this bridge implements that contract.
- AsFilterResultOperation
- Terminal-only operation: wrap the chain's final value into a `{name => value}` map that the dispatcher merges into handler kwargs. Returns `null` (rejection) only when the final value is `null` or an empty `iterable` — `false`, `0`, `''` are still accepting values carrying a payload.
- BaseOperation
- Single step in a MagicFilter chain. Each operation is invoked with the value the previous operation produced AND the original subject (the "initial value") so that combinator-style operations can resolve nested `MagicFilter` references against the same root.
- CallOperation
- Invoke the running value as a callable: `F->text->lower()` resolves to `$value->lower()` IF `lower` returned a callable from the previous step (typical chain: `F->text->lower` reads attribute, `F->text->lower()` then calls it).
- CastOperation
- Apply a unary transformation to the running value: `F->id->cast(intval(...))` passes the value through `intval` and forwards the result.
- CombinationOperation
- Binary combinator between the running value (left operand) and either a literal or another `MagicFilter` chain (right operand). Powers AND, XOR, arithmetic combinations, etc.
- ComparatorOperation
- Binary comparison between the running value and a literal (or another `MagicFilter` chain that resolves against the same root): supports `==`, `!=`, `<`, `<=`, `>`, `>=` via a pluggable comparator closure.
- ExtractOperation
- Filter an iterable subject through an inner `MagicFilter`, keeping only the items for which the inner accepts.
- FunctionOperation
- Apply an external callable to the running value, optionally with extra positional / named arguments resolved against the chain root.
- GetAttributeOperation
- Read a named attribute from the running value: `F->message->text` resolves to `$value->text` (object) or `$value['text']` (array/ArrayAccess).
- GetItemOperation
- Subscript / index access: `F->items[$key]` resolves to `$value[$key]`.
- Helper
- Internal helper for operations that may accept either a literal value or a nested `MagicFilter` chain on the right-hand side (`F->id == F->reply->fromUser->id`).
- ImportantBaseOperation
- Marker subclass: operations that must always evaluate even when a previous operation in the chain raised `RejectOperations`. The `MagicFilter::_resolve` loop checks `important()` after a rejection and only executes operations that opt in via this base.
- ImportantCombinationOperation
- `CombinationOperation` flavour that bypasses the resolver's reject short-circuit. Used by OR composition so a left-hand rejection (missing attribute, failed cast) doesn't blank the verdict before the right-hand alternative gets to vote.
- ImportantFunctionOperation
- `FunctionOperation` flavour that must run even when the chain has been rejected by an earlier operation. Used by `MagicFilter::__invert()` (the `~F->…` negation) so a missing attribute upstream still inverts into an accepting `true` rather than collapsing the verdict to `false`.
- MethodCallOperation
- Invoke a named method on the running value: `F->text->lower()` resolves to `$value->lower()`. The Python upstream models this as `__getattr__` (binding the method) followed by `__call__` (invoking it); PHP doesn't expose bound methods as first-class values, so we collapse the pair into one step here.
- RCombinationOperation
- Reverse-binary combinator: the running value is on the RIGHT and a fixed literal (or nested `MagicFilter`) is on the LEFT. Powers the `__rxxx__` family of upstream operators — for example `'pong' + F.text` produces an `RCombinationOperation(left='pong', combinator=add)` whose `resolve(value)` returns `'pong' . $value`.
- SelectorOperation
- Sub-chain predicate: hand the running value to an inner `MagicFilter` and either pass the value through (when the inner accepts) or reject the chain.
- MediaGroupBuilder
- Fluent builder for Telegram media groups.
- Payload
- URL-safe base64 payload helpers.
- HtmlDecoration
- HTML decoration strategy.
- MarkdownDecoration
- Markdown V2 decoration strategy.
- TextDecoration
- Abstract base for text decoration strategies (HTML, Markdown V2).
- Token
- WebApp
- HMAC-SHA256-based standard WebApp signature validation and init data parsing.
- WebAppChat
- Represents the chat object embedded in WebApp init data.
- WebAppInitData
- Parsed representation of Telegram WebApp init data.
- WebAppSignature
- Ed25519-based third-party WebApp signature validation.
- WebAppUser
- Represents the user object embedded in WebApp init data.
- BaseRequestHandler
- Abstract base for webhook request handlers.
- IpFilter
- CIDR-based IP allowlist for incoming webhook requests.
- AmphpServer
- Stand-alone amphp/http-server v3 boot helper.
- Setup
- Wires phpbotgram into an **existing** `amphp/http-server` app.
- SimpleRequestHandler
- Single-bot webhook handler with optional constant-time secret-token validation.
- TokenBasedRequestHandler
- Multi-bot webhook handler that extracts the bot token from the URL path.
Traits
- BotShortcuts
- CallbackQueryShortcuts
- Hand-authored shortcut helpers for `CallbackQuery`.
- ChatShortcuts
- Hand-authored shortcut helpers for `Chat`.
- InaccessibleMessageShortcuts
- Hand-authored shortcut helpers for `InaccessibleMessage`.
- MessageShortcuts
- Hand-authored shortcut helpers for `Message`.
- UpdateShortcuts
- Hand-authored shortcut helpers for `Update`.
- UserShortcuts
- Hand-authored shortcut helpers for `User`.
Enums
- BotCommandScopeType
- This object represents the scope to which bot commands are applied.
- ButtonStyle
- This object represents a button style (inline- or reply-keyboard).
- ChatAction
- This object represents bot actions.
- ChatBoostSourceType
- This object represents a type of chat boost source.
- ChatMemberStatus
- This object represents chat member status.
- ChatType
- This object represents a chat type
- ContentType
- This object represents a type of content in message
- Currency
- Currencies supported by Telegram Bot API
- DiceEmoji
- Emoji on which the dice throw animation is based
- EncryptedPassportElement
- This object represents type of encrypted passport element.
- InlineQueryResultType
- Type of inline query result
- InputMediaType
- This object represents input media type
- InputPaidMediaType
- This object represents the type of a media in a paid message.
- InputProfilePhotoType
- This object represents input profile photo type
- InputStoryContentType
- This object represents input story content photo type.
- KeyboardButtonPollTypeType
- This object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed.
- MaskPositionPoint
- The part of the face relative to which the mask should be placed.
- MenuButtonType
- This object represents an type of Menu button
- MessageEntityType
- This object represents type of message entity
- MessageOriginType
- This object represents origin of a message.
- OwnedGiftType
- This object represents owned gift type
- PaidMediaType
- This object represents the type of a media in a paid message.
- ParseMode
- Formatting options
- PassportElementErrorType
- This object represents a passport element error type.
- PollType
- This object represents poll type
- ReactionTypeType
- This object represents reaction type.
- RevenueWithdrawalStateType
- This object represents a revenue withdrawal state type
- RichBlockType
- This object represents a block in a rich formatted message.
- RichTextType
- This object represents the rich text type.
- StickerFormat
- Format of the sticker
- StickerType
- The part of the face relative to which the mask should be placed.
- StoryAreaTypeType
- This object represents input profile photo type
- TopicIconColor
- Color of the topic icon in RGB format.
- TransactionPartnerType
- This object represents a type of transaction partner.
- TransactionPartnerUserTransactionTypeEnum
- This object represents type of the transaction that were made by partner user.
- UpdateType
- This object represents the complete list of allowed update types
- FsmStrategy
- Determines how FSM state is scoped to a Telegram context.
- SceneAction
- Enumerates the lifecycle actions a scene handler can perform.
- StoragePart
- Represents the three sub-record kinds that a key builder can address within a single FSM storage entry.
- DeepLinkType
- Telegram deep-link types.
- RegexpMode
- Regex-evaluation mode selector for `MagicFilter::regexp(...)`.
Constants
- F : mixed = new \Gruven\PhpBotGram\Utils\MagicFilter\MagicF...
- Top-level `F` constant — a fresh root `MagicFilter` users import to build fluent predicate chains.
Constants
F
Top-level `F` constant — a fresh root `MagicFilter` users import to build fluent predicate chains.
public
mixed
F
= new \Gruven\PhpBotGram\Utils\MagicFilter\MagicFilter()
Usage:
use const Gruven\PhpBotGram\F;
$filter = (F->message->text->equals('hello'))->asFilter();
Direct PHP equivalent of from aiogram import F in upstream Python.
Available because PHP 8.5 added object-initializer support to
namespace-level const declarations — see the RFC "New in initializers"
(PHP 8.1) extended to top-level const in PHP 8.5.
The constant is loaded eagerly via the composer.json autoload.files
entry — PSR-4 only autoloads class symbols, so a standalone const
file must be force-loaded by Composer. Each call site sees the same
MagicFilter instance because const is process-wide, but every
chain operation (F->message, F->text, …) clones into a new
MagicFilter, so the shared root is never mutated.