MessageApi
This file is generated from spec/openapi.json (Bot API 10.3) by tools/generate.php.
Do not edit it by hand - run composer spec:build instead.
Sending, editing, forwarding, reacting to, pinning, and deleting messages of every media type.
Mixed into Telegram through Methods. Every method is named exactly as the Bot API names it, takes exactly the fields the Bot API documents (use named arguments for the optional ones), and resolves with the hydrated result.
Tags
Table of Contents
Methods
- copyMessage() : PromiseInterface<string|int, MessageId>
- 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_ids 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() : PromiseInterface<string|int, Collection<string|int, MessageId>>
- 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_ids 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.
- deleteAllMessageReactions() : PromiseInterface<string|int, bool>
- 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.
- deleteEphemeralMessage() : PromiseInterface<string|int, bool>
- Use this method to delete an ephemeral message. Note that it is not guaranteed that the user will receive the message deletion event, especially if they are offline. Returns True on success.
- deleteMessage() : PromiseInterface<string|int, bool>
- 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() : PromiseInterface<string|int, bool>
- 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() : PromiseInterface<string|int, bool>
- 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.
- editEphemeralMessageCaption() : PromiseInterface<string|int, bool>
- Use this method to edit the caption of an ephemeral message. Note that it is not guaranteed that the user will receive the message edit event, especially if they are offline. On success, True is returned.
- editEphemeralMessageMedia() : PromiseInterface<string|int, bool>
- Use this method to edit the media of an ephemeral message. Note that it is not guaranteed that the user will receive the message edit event, especially if they are offline. On success, True is returned.
- editEphemeralMessageReplyMarkup() : PromiseInterface<string|int, bool>
- Use this method to edit only the reply markup of an ephemeral message. Note that it is not guaranteed that the user will receive the message edit event, especially if they are offline. On success, True is returned.
- editEphemeralMessageText() : PromiseInterface<string|int, bool>
- Use this method to edit an ephemeral text or rich message. Note that it is not guaranteed that the user will receive the message edit event, especially if they are offline. On success, True is returned.
- editMessageCaption() : PromiseInterface<string|int, Message|bool>
- 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() : PromiseInterface<string|int, Message>
- Use this method to edit a checklist on behalf of a connected business account. On success, the edited Message is returned.
- editMessageLiveLocation() : PromiseInterface<string|int, Message|bool>
- 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() : PromiseInterface<string|int, Message|bool>
- 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() : PromiseInterface<string|int, Message|bool>
- 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() : PromiseInterface<string|int, Message|bool>
- 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.
- forwardMessage() : PromiseInterface<string|int, Message>
- 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() : PromiseInterface<string|int, Collection<string|int, MessageId>>
- 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.
- pinChatMessage() : PromiseInterface<string|int, bool>
- 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.
- sendAnimation() : PromiseInterface<string|int, Message>
- 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() : PromiseInterface<string|int, Message>
- 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.
- sendChatAction() : PromiseInterface<string|int, bool>
- Use this method when you need to tell the user that something is happening on the bot's side.
- sendChecklist() : PromiseInterface<string|int, Message>
- Use this method to send a checklist on behalf of a connected business account. On success, the sent Message is returned.
- sendContact() : PromiseInterface<string|int, Message>
- Use this method to send phone contacts. On success, the sent Message is returned.
- sendDice() : PromiseInterface<string|int, Message>
- Use this method to send an animated emoji that will display a random value. On success, the sent Message is returned.
- sendDocument() : PromiseInterface<string|int, Message>
- 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.
- sendLivePhoto() : PromiseInterface<string|int, Message>
- Use this method to send live photos. On success, the sent Message is returned.
- sendLocation() : PromiseInterface<string|int, Message>
- Use this method to send point on the map. On success, the sent Message is returned.
- sendMediaGroup() : PromiseInterface<string|int, Collection<string|int, Message>>
- Use this method to send a group of photos, live photos, videos, documents or audios as an album.
- sendMessage() : PromiseInterface<string|int, Message>
- Use this method to send text messages. On success, the sent Message is returned.
- sendMessageDraft() : PromiseInterface<string|int, bool>
- 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() : PromiseInterface<string|int, Message>
- Use this method to send paid media. On success, the sent Message is returned.
- sendPhoto() : PromiseInterface<string|int, Message>
- Use this method to send photos. On success, the sent Message is returned.
- sendPoll() : PromiseInterface<string|int, Message>
- Use this method to send a native poll. On success, the sent Message is returned.
- sendRichMessage() : PromiseInterface<string|int, Message>
- 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() : PromiseInterface<string|int, bool>
- Use this method to stream a partial rich message to a user while the message is being generated.
- sendVenue() : PromiseInterface<string|int, Message>
- Use this method to send information about a venue. On success, the sent Message is returned.
- sendVideo() : PromiseInterface<string|int, Message>
- 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() : PromiseInterface<string|int, Message>
- Use this method to send a rounded square MPEG4 video of up to 1 minute long. On success, the sent Message is returned.
- sendVoice() : PromiseInterface<string|int, Message>
- 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.
- setMessageReaction() : PromiseInterface<string|int, bool>
- 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.
- stopMessageLiveLocation() : PromiseInterface<string|int, Message|bool>
- 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() : PromiseInterface<string|int, Poll>
- Use this method to stop a poll which was sent by the bot. On success, the stopped Poll is returned.
- unpinAllChatMessages() : PromiseInterface<string|int, bool>
- 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.
- unpinChatMessage() : PromiseInterface<string|int, bool>
- 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.
Methods
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_ids 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.
public
copyMessage(int|string $chat_id, int|string $from_chat_id, int $message_id[, int|null $message_thread_id = null ][, int|null $direct_messages_topic_id = null ][, int|null $video_start_timestamp = null ][, string|null $caption = null ][, string|null $parse_mode = null ][, array<int, MessageEntity|array<string|int, mixed>>|null $caption_entities = null ][, bool|null $show_caption_above_media = null ][, bool|null $disable_notification = null ][, bool|null $protect_content = null ][, bool|null $allow_paid_broadcast = null ][, string|null $message_effect_id = null ][, SuggestedPostParameters|array<string|int, mixed>|null $suggested_post_parameters = null ][, ReplyParameters|array<string|int, mixed>|null $reply_parameters = null ][, InlineKeyboardMarkup|array<string|int, mixed>|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply|null $reply_markup = null ]) : PromiseInterface<string|int, MessageId>
Parameters
- $chat_id : int|string
-
Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username
- $from_chat_id : int|string
-
Unique identifier for the chat where the original message was sent (or username of the target bot, supergroup or channel in the format @username)
- $message_id : int
-
Message identifier in the chat specified in from_chat_id
- $message_thread_id : int|null = null
-
Optional. Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
- $direct_messages_topic_id : int|null = null
-
Optional. Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
- $video_start_timestamp : int|null = null
-
Optional. New start timestamp for the copied video in the message
- $caption : string|null = null
-
Optional. New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept.
- $parse_mode : string|null = null
-
Optional. Mode for parsing entities in the new caption. See formatting options for more details.
- $caption_entities : array<int, MessageEntity|array<string|int, mixed>>|null = null
-
Optional. A JSON-serialized list of special entities that appear in the new caption, which can be specified instead of parse_mode
- $show_caption_above_media : bool|null = null
-
Optional. Pass True if the caption must be shown above the message media. Ignored if a new caption isn't specified.
- $disable_notification : bool|null = null
-
Optional. Sends the message silently. Users will receive a notification with no sound.
- $protect_content : bool|null = null
-
Optional. Protects the contents of the sent message from forwarding and saving
- $allow_paid_broadcast : bool|null = null
-
Optional. Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance.
- $message_effect_id : string|null = null
-
Optional. Unique identifier of the message effect to be added to the message; only available when copying to private chats
- $suggested_post_parameters : SuggestedPostParameters|array<string|int, mixed>|null = null
-
Optional. A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
- $reply_parameters : ReplyParameters|array<string|int, mixed>|null = null
-
Optional. Description of the message to reply to
- $reply_markup : InlineKeyboardMarkup|array<string|int, mixed>|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply|null = null
-
Optional. Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
Tags
Return values
PromiseInterface<string|int, MessageId>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_ids 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.
public
copyMessages(int|string $chat_id, int|string $from_chat_id, array<int, int> $message_ids[, int|null $message_thread_id = null ][, int|null $direct_messages_topic_id = null ][, bool|null $disable_notification = null ][, bool|null $protect_content = null ][, bool|null $remove_caption = null ]) : PromiseInterface<string|int, Collection<string|int, MessageId>>
Parameters
- $chat_id : int|string
-
Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username
- $from_chat_id : int|string
-
Unique identifier for the chat where the original messages were sent (or username of the target bot, supergroup or channel in the format @username)
- $message_ids : array<int, int>
-
A JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to copy. The identifiers must be specified in a strictly increasing order.
- $message_thread_id : int|null = null
-
Optional. Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
- $direct_messages_topic_id : int|null = null
-
Optional. Identifier of the direct messages topic to which the messages will be sent; required if the messages are sent to a direct messages chat
- $disable_notification : bool|null = null
-
Optional. Sends the messages silently. Users will receive a notification with no sound.
- $protect_content : bool|null = null
-
Optional. Protects the contents of the sent messages from forwarding and saving
- $remove_caption : bool|null = null
-
Optional. Pass True to copy the messages without their captions
Tags
Return values
PromiseInterface<string|int, Collection<string|int, MessageId>>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.
public
deleteAllMessageReactions(int|string $chat_id[, int|null $user_id = null ][, int|null $actor_chat_id = null ]) : PromiseInterface<string|int, bool>
Parameters
- $chat_id : int|string
-
Unique identifier for the target chat or username of the target supergroup in the format @username
- $user_id : int|null = null
-
Optional. Identifier of the user whose reactions will be removed, if the reactions were added by a user
- $actor_chat_id : int|null = null
-
Optional. Identifier of the chat whose reactions will be removed, if the reactions were added by a chat
Tags
Return values
PromiseInterface<string|int, bool>deleteEphemeralMessage()
Use this method to delete an ephemeral message. Note that it is not guaranteed that the user will receive the message deletion event, especially if they are offline. Returns True on success.
public
deleteEphemeralMessage(int|string $chat_id, int $receiver_user_id, int $ephemeral_message_id) : PromiseInterface<string|int, bool>
Parameters
- $chat_id : int|string
-
Unique identifier for the target chat or username of the target supergroup in the format @username
- $receiver_user_id : int
-
Identifier of the user who received the message
- $ephemeral_message_id : int
-
Identifier of the ephemeral message to delete
Tags
Return values
PromiseInterface<string|int, bool>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.
public
deleteMessage(int|string $chat_id, int $message_id) : PromiseInterface<string|int, bool>
- Service messages about a supergroup, channel, or forum topic creation can't be deleted.
- A dice message in a private chat can only be deleted if it was sent more than 24 hours ago.
- Bots can delete outgoing messages in private chats, groups, and supergroups.
- Bots can delete incoming messages in private chats.
- Bots granted can_post_messages permissions can delete outgoing messages in channels.
- If the bot is an administrator of a group, it can delete any message there.
- If the bot has can_delete_messages administrator right in a supergroup or a channel, it can delete any message there.
- If the bot has can_manage_direct_messages administrator right in a channel, it can delete any message in the corresponding direct messages chat. Returns True on success.
Parameters
- $chat_id : int|string
-
Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username
- $message_id : int
-
Identifier of the message to delete
Tags
Return values
PromiseInterface<string|int, bool>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.
public
deleteMessageReaction(int|string $chat_id, int $message_id[, int|null $user_id = null ][, int|null $actor_chat_id = null ]) : PromiseInterface<string|int, bool>
Parameters
- $chat_id : int|string
-
Unique identifier for the target chat or username of the target supergroup in the format @username
- $message_id : int
-
Identifier of the target message
- $user_id : int|null = null
-
Optional. Identifier of the user whose reaction will be removed, if the reaction was added by a user
- $actor_chat_id : int|null = null
-
Optional. Identifier of the chat whose reaction will be removed, if the reaction was added by a chat
Tags
Return values
PromiseInterface<string|int, bool>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.
public
deleteMessages(int|string $chat_id, array<int, int> $message_ids) : PromiseInterface<string|int, bool>
Parameters
- $chat_id : int|string
-
Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username
- $message_ids : array<int, int>
-
A JSON-serialized list of 1-100 identifiers of messages to delete. See deleteMessage for limitations on which messages can be deleted.
Tags
Return values
PromiseInterface<string|int, bool>editEphemeralMessageCaption()
Use this method to edit the caption of an ephemeral message. Note that it is not guaranteed that the user will receive the message edit event, especially if they are offline. On success, True is returned.
public
editEphemeralMessageCaption(int|string $chat_id, int $receiver_user_id, int $ephemeral_message_id[, string|null $caption = null ][, string|null $parse_mode = null ][, array<int, MessageEntity|array<string|int, mixed>>|null $caption_entities = null ][, bool|null $show_caption_above_media = null ][, InlineKeyboardMarkup|array<string|int, mixed>|null $reply_markup = null ]) : PromiseInterface<string|int, bool>
Parameters
- $chat_id : int|string
-
Unique identifier for the target chat or username of the target supergroup in the format @username
- $receiver_user_id : int
-
Identifier of the user who received the message
- $ephemeral_message_id : int
-
Identifier of the ephemeral message to edit
- $caption : string|null = null
-
Optional. New caption of the message, 0-1024 characters after entities parsing
- $parse_mode : string|null = null
-
Optional. Mode for parsing entities in the message caption. See formatting options for more details.
- $caption_entities : array<int, MessageEntity|array<string|int, mixed>>|null = null
-
Optional. A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
- $show_caption_above_media : bool|null = null
-
Optional. Pass True if the caption must be shown above the message media. Supported only for animation, photo and video messages.
- $reply_markup : InlineKeyboardMarkup|array<string|int, mixed>|null = null
-
Optional. A JSON-serialized object for an inline keyboard
Tags
Return values
PromiseInterface<string|int, bool>editEphemeralMessageMedia()
Use this method to edit the media of an ephemeral message. Note that it is not guaranteed that the user will receive the message edit event, especially if they are offline. On success, True is returned.
public
editEphemeralMessageMedia(int|string $chat_id, int $receiver_user_id, int $ephemeral_message_id, InputMedia|array<string|int, mixed> $media[, InlineKeyboardMarkup|array<string|int, mixed>|null $reply_markup = null ]) : PromiseInterface<string|int, bool>
Parameters
- $chat_id : int|string
-
Unique identifier for the target chat or username of the target supergroup in the format @username
- $receiver_user_id : int
-
Identifier of the user who received the message
- $ephemeral_message_id : int
-
Identifier of the ephemeral message to edit
- $media : InputMedia|array<string|int, mixed>
-
A JSON-serialized object for the new media content of the message
- $reply_markup : InlineKeyboardMarkup|array<string|int, mixed>|null = null
-
Optional. A JSON-serialized object for an inline keyboard
Tags
Return values
PromiseInterface<string|int, bool>editEphemeralMessageReplyMarkup()
Use this method to edit only the reply markup of an ephemeral message. Note that it is not guaranteed that the user will receive the message edit event, especially if they are offline. On success, True is returned.
public
editEphemeralMessageReplyMarkup(int|string $chat_id, int $receiver_user_id, int $ephemeral_message_id[, InlineKeyboardMarkup|array<string|int, mixed>|null $reply_markup = null ]) : PromiseInterface<string|int, bool>
Parameters
- $chat_id : int|string
-
Unique identifier for the target chat or username of the target supergroup in the format @username
- $receiver_user_id : int
-
Identifier of the user who received the message
- $ephemeral_message_id : int
-
Identifier of the ephemeral message to edit
- $reply_markup : InlineKeyboardMarkup|array<string|int, mixed>|null = null
-
Optional. A JSON-serialized object for an inline keyboard
Tags
Return values
PromiseInterface<string|int, bool>editEphemeralMessageText()
Use this method to edit an ephemeral text or rich message. Note that it is not guaranteed that the user will receive the message edit event, especially if they are offline. On success, True is returned.
public
editEphemeralMessageText(int|string $chat_id, int $receiver_user_id, int $ephemeral_message_id[, string|null $text = null ][, string|null $parse_mode = null ][, array<int, MessageEntity|array<string|int, mixed>>|null $entities = null ][, InputRichMessage|array<string|int, mixed>|null $rich_message = null ][, LinkPreviewOptions|array<string|int, mixed>|null $link_preview_options = null ][, InlineKeyboardMarkup|array<string|int, mixed>|null $reply_markup = null ]) : PromiseInterface<string|int, bool>
Parameters
- $chat_id : int|string
-
Unique identifier for the target chat or username of the target supergroup in the format @username
- $receiver_user_id : int
-
Identifier of the user who received the message
- $ephemeral_message_id : int
-
Identifier of the ephemeral message to edit
- $text : string|null = null
-
Optional. New text of the message, 1-4096 characters after entity parsing; required if rich_message isn't specified
- $parse_mode : string|null = null
-
Optional. Mode for parsing entities in the message text. See formatting options for more details.
- $entities : array<int, MessageEntity|array<string|int, mixed>>|null = null
-
Optional. A JSON-serialized list of special entities that appear in message text, which can be specified instead of parse_mode
- $rich_message : InputRichMessage|array<string|int, mixed>|null = null
-
Optional. New rich content of the message; required if text isn't specified
- $link_preview_options : LinkPreviewOptions|array<string|int, mixed>|null = null
-
Optional. Link preview generation options for the message
- $reply_markup : InlineKeyboardMarkup|array<string|int, mixed>|null = null
-
Optional. A JSON-serialized object for an inline keyboard
Tags
Return values
PromiseInterface<string|int, bool>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.
public
editMessageCaption([string|null $business_connection_id = null ][, int|string|null $chat_id = null ][, int|null $message_id = null ][, string|null $inline_message_id = null ][, string|null $caption = null ][, string|null $parse_mode = null ][, array<int, MessageEntity|array<string|int, mixed>>|null $caption_entities = null ][, bool|null $show_caption_above_media = null ][, InlineKeyboardMarkup|array<string|int, mixed>|null $reply_markup = null ]) : PromiseInterface<string|int, Message|bool>
Parameters
- $business_connection_id : string|null = null
-
Optional. Unique identifier of the business connection on behalf of which the message to be edited was sent
- $chat_id : int|string|null = null
-
Optional. Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username.
- $message_id : int|null = null
-
Optional. Required if inline_message_id is not specified. Identifier of the message to edit.
- $inline_message_id : string|null = null
-
Optional. Required if chat_id and message_id are not specified. Identifier of the inline message.
- $caption : string|null = null
-
Optional. New caption of the message, 0-1024 characters after entities parsing
- $parse_mode : string|null = null
-
Optional. Mode for parsing entities in the message caption. See formatting options for more details.
- $caption_entities : array<int, MessageEntity|array<string|int, mixed>>|null = null
-
Optional. A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
- $show_caption_above_media : bool|null = null
-
Optional. Pass True if the caption must be shown above the message media. Supported only for animation, photo and video messages.
- $reply_markup : InlineKeyboardMarkup|array<string|int, mixed>|null = null
-
Optional. A JSON-serialized object for an inline keyboard
Tags
Return values
PromiseInterface<string|int, Message|bool>editMessageChecklist()
Use this method to edit a checklist on behalf of a connected business account. On success, the edited Message is returned.
public
editMessageChecklist(string $business_connection_id, int|string $chat_id, int $message_id, InputChecklist|array<string|int, mixed> $checklist[, InlineKeyboardMarkup|array<string|int, mixed>|null $reply_markup = null ]) : PromiseInterface<string|int, Message>
Parameters
- $business_connection_id : string
-
Unique identifier of the business connection on behalf of which the message will be sent
- $chat_id : int|string
-
Unique identifier for the target chat or username of the target bot in the format @username
- $message_id : int
-
Unique identifier for the target message
- $checklist : InputChecklist|array<string|int, mixed>
-
A JSON-serialized object for the new checklist
- $reply_markup : InlineKeyboardMarkup|array<string|int, mixed>|null = null
-
Optional. A JSON-serialized object for the new inline keyboard for the message
Tags
Return values
PromiseInterface<string|int, Message>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.
public
editMessageLiveLocation(float $latitude, float $longitude[, string|null $business_connection_id = null ][, int|string|null $chat_id = null ][, int|null $message_id = null ][, string|null $inline_message_id = null ][, int|null $live_period = null ][, float|null $horizontal_accuracy = null ][, int|null $heading = null ][, int|null $proximity_alert_radius = null ][, InlineKeyboardMarkup|array<string|int, mixed>|null $reply_markup = null ]) : PromiseInterface<string|int, Message|bool>
Parameters
- $latitude : float
-
Latitude of new location
- $longitude : float
-
Longitude of new location
- $business_connection_id : string|null = null
-
Optional. Unique identifier of the business connection on behalf of which the message to be edited was sent
- $chat_id : int|string|null = null
-
Optional. Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username.
- $message_id : int|null = null
-
Optional. Required if inline_message_id is not specified. Identifier of the message to edit.
- $inline_message_id : string|null = null
-
Optional. Required if chat_id and message_id are not specified. Identifier of the inline message.
- $live_period : int|null = null
-
Optional. New period in seconds during which the location can be updated, starting from the message send date. If 0x7FFFFFFF is specified, then the location can be updated forever. Otherwise, the new value must not exceed the current live_period by more than a day, and the live location expiration date must remain within the next 90 days. If not specified, then live_period remains unchanged.
- $horizontal_accuracy : float|null = null
-
Optional. The radius of uncertainty for the location, measured in meters; 0-1500
- $heading : int|null = null
-
Optional. Direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.
- $proximity_alert_radius : int|null = null
-
Optional. The maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified.
- $reply_markup : InlineKeyboardMarkup|array<string|int, mixed>|null = null
-
Optional. A JSON-serialized object for a new inline keyboard
Tags
Return values
PromiseInterface<string|int, Message|bool>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.
public
editMessageMedia(InputMedia|array<string|int, mixed> $media[, string|null $business_connection_id = null ][, int|string|null $chat_id = null ][, int|null $message_id = null ][, string|null $inline_message_id = null ][, InlineKeyboardMarkup|array<string|int, mixed>|null $reply_markup = null ]) : PromiseInterface<string|int, Message|bool>
Parameters
- $media : InputMedia|array<string|int, mixed>
-
A JSON-serialized object for the new media content of the message
- $business_connection_id : string|null = null
-
Optional. Unique identifier of the business connection on behalf of which the message to be edited was sent
- $chat_id : int|string|null = null
-
Optional. Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username.
- $message_id : int|null = null
-
Optional. Required if inline_message_id is not specified. Identifier of the message to edit.
- $inline_message_id : string|null = null
-
Optional. Required if chat_id and message_id are not specified. Identifier of the inline message.
- $reply_markup : InlineKeyboardMarkup|array<string|int, mixed>|null = null
-
Optional. A JSON-serialized object for a new inline keyboard
Tags
Return values
PromiseInterface<string|int, Message|bool>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.
public
editMessageReplyMarkup([string|null $business_connection_id = null ][, int|string|null $chat_id = null ][, int|null $message_id = null ][, string|null $inline_message_id = null ][, InlineKeyboardMarkup|array<string|int, mixed>|null $reply_markup = null ]) : PromiseInterface<string|int, Message|bool>
Parameters
- $business_connection_id : string|null = null
-
Optional. Unique identifier of the business connection on behalf of which the message to be edited was sent
- $chat_id : int|string|null = null
-
Optional. Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username.
- $message_id : int|null = null
-
Optional. Required if inline_message_id is not specified. Identifier of the message to edit.
- $inline_message_id : string|null = null
-
Optional. Required if chat_id and message_id are not specified. Identifier of the inline message.
- $reply_markup : InlineKeyboardMarkup|array<string|int, mixed>|null = null
-
Optional. A JSON-serialized object for an inline keyboard
Tags
Return values
PromiseInterface<string|int, Message|bool>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.
public
editMessageText([string|null $business_connection_id = null ][, int|string|null $chat_id = null ][, int|null $message_id = null ][, string|null $inline_message_id = null ][, string|null $text = null ][, string|null $parse_mode = null ][, array<int, MessageEntity|array<string|int, mixed>>|null $entities = null ][, LinkPreviewOptions|array<string|int, mixed>|null $link_preview_options = null ][, InputRichMessage|array<string|int, mixed>|null $rich_message = null ][, InlineKeyboardMarkup|array<string|int, mixed>|null $reply_markup = null ]) : PromiseInterface<string|int, Message|bool>
Parameters
- $business_connection_id : string|null = null
-
Optional. Unique identifier of the business connection on behalf of which the message to be edited was sent
- $chat_id : int|string|null = null
-
Optional. Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username.
- $message_id : int|null = null
-
Optional. Required if inline_message_id is not specified. Identifier of the message to edit.
- $inline_message_id : string|null = null
-
Optional. Required if chat_id and message_id are not specified. Identifier of the inline message.
- $text : string|null = null
-
Optional. New text of the message, 1-4096 characters after entity parsing; required if rich_message isn't specified
- $parse_mode : string|null = null
-
Optional. Mode for parsing entities in the message text. See formatting options for more details.
- $entities : array<int, MessageEntity|array<string|int, mixed>>|null = null
-
Optional. A JSON-serialized list of special entities that appear in message text, which can be specified instead of parse_mode
- $link_preview_options : LinkPreviewOptions|array<string|int, mixed>|null = null
-
Optional. Link preview generation options for the message
- $rich_message : InputRichMessage|array<string|int, mixed>|null = null
-
Optional. New rich content of the message; required if text isn't specified. Direct upload of new files and explicit upload of files by a URL isn't supported when an inline message is edited.
- $reply_markup : InlineKeyboardMarkup|array<string|int, mixed>|null = null
-
Optional. A JSON-serialized object for an inline keyboard
Tags
Return values
PromiseInterface<string|int, Message|bool>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.
public
forwardMessage(int|string $chat_id, int|string $from_chat_id, int $message_id[, int|null $message_thread_id = null ][, int|null $direct_messages_topic_id = null ][, int|null $video_start_timestamp = null ][, bool|null $disable_notification = null ][, bool|null $protect_content = null ][, string|null $message_effect_id = null ][, SuggestedPostParameters|array<string|int, mixed>|null $suggested_post_parameters = null ]) : PromiseInterface<string|int, Message>
Parameters
- $chat_id : int|string
-
Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username
- $from_chat_id : int|string
-
Unique identifier for the chat where the original message was sent (or username of the target bot, supergroup or channel in the format @username)
- $message_id : int
-
Message identifier in the chat specified in from_chat_id
- $message_thread_id : int|null = null
-
Optional. Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
- $direct_messages_topic_id : int|null = null
-
Optional. Identifier of the direct messages topic to which the message will be forwarded; required if the message is forwarded to a direct messages chat
- $video_start_timestamp : int|null = null
-
Optional. New start timestamp for the forwarded video in the message
- $disable_notification : bool|null = null
-
Optional. Sends the message silently. Users will receive a notification with no sound.
- $protect_content : bool|null = null
-
Optional. Protects the contents of the forwarded message from forwarding and saving
- $message_effect_id : string|null = null
-
Optional. Unique identifier of the message effect to be added to the message; only available when forwarding to private chats
- $suggested_post_parameters : SuggestedPostParameters|array<string|int, mixed>|null = null
-
Optional. A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only
Tags
Return values
PromiseInterface<string|int, Message>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.
public
forwardMessages(int|string $chat_id, int|string $from_chat_id, array<int, int> $message_ids[, int|null $message_thread_id = null ][, int|null $direct_messages_topic_id = null ][, bool|null $disable_notification = null ][, bool|null $protect_content = null ]) : PromiseInterface<string|int, Collection<string|int, MessageId>>
Parameters
- $chat_id : int|string
-
Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username
- $from_chat_id : int|string
-
Unique identifier for the chat where the original messages were sent (or username of the target bot, supergroup or channel in the format @username)
- $message_ids : array<int, int>
-
A JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to forward. The identifiers must be specified in a strictly increasing order.
- $message_thread_id : int|null = null
-
Optional. Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
- $direct_messages_topic_id : int|null = null
-
Optional. Identifier of the direct messages topic to which the messages will be forwarded; required if the messages are forwarded to a direct messages chat
- $disable_notification : bool|null = null
-
Optional. Sends the messages silently. Users will receive a notification with no sound.
- $protect_content : bool|null = null
-
Optional. Protects the contents of the forwarded messages from forwarding and saving
Tags
Return values
PromiseInterface<string|int, Collection<string|int, MessageId>>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.
public
pinChatMessage(int|string $chat_id, int $message_id[, string|null $business_connection_id = null ][, bool|null $disable_notification = null ]) : PromiseInterface<string|int, bool>
Parameters
- $chat_id : int|string
-
Unique identifier for the target chat or username of the target channel in the format @username
- $message_id : int
-
Identifier of a message to pin
- $business_connection_id : string|null = null
-
Optional. Unique identifier of the business connection on behalf of which the message will be pinned
- $disable_notification : bool|null = null
-
Optional. Pass True if it is not necessary to send a notification to all chat members about the new pinned message. Notifications are always disabled in channels and private chats.
Tags
Return values
PromiseInterface<string|int, bool>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.
public
sendAnimation(int|string $chat_id, InputFile|string $animation[, string|null $business_connection_id = null ][, int|null $message_thread_id = null ][, int|null $direct_messages_topic_id = null ][, EphemeralMessageParameters|array<string|int, mixed>|null $ephemeral_message_parameters = null ][, int|null $duration = null ][, int|null $width = null ][, int|null $height = null ][, InputFile|string|null $thumbnail = null ][, string|null $caption = null ][, string|null $parse_mode = null ][, array<int, MessageEntity|array<string|int, mixed>>|null $caption_entities = null ][, bool|null $show_caption_above_media = null ][, bool|null $has_spoiler = null ][, bool|null $disable_notification = null ][, bool|null $protect_content = null ][, bool|null $allow_paid_broadcast = null ][, string|null $message_effect_id = null ][, SuggestedPostParameters|array<string|int, mixed>|null $suggested_post_parameters = null ][, ReplyParameters|array<string|int, mixed>|null $reply_parameters = null ][, InlineKeyboardMarkup|array<string|int, mixed>|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply|null $reply_markup = null ]) : PromiseInterface<string|int, Message>
Parameters
- $chat_id : int|string
-
Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username
- $animation : InputFile|string
-
Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data. More information on Sending Files: https://core.telegram.org/bots/api#sending-files
- $business_connection_id : string|null = null
-
Optional. Unique identifier of the business connection on behalf of which the message will be sent
- $message_thread_id : int|null = null
-
Optional. Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
- $direct_messages_topic_id : int|null = null
-
Optional. Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
- $ephemeral_message_parameters : EphemeralMessageParameters|array<string|int, mixed>|null = null
-
Optional. A JSON-serialized object containing the parameters of the ephemeral message to send
- $duration : int|null = null
-
Optional. Duration of sent animation in seconds
- $width : int|null = null
-
Optional. Animation width
- $height : int|null = null
-
Optional. Animation height
- $thumbnail : InputFile|string|null = null
-
Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass "attach://<file_attach_name>" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files: https://core.telegram.org/bots/api#sending-files
- $caption : string|null = null
-
Optional. Animation caption (may also be used when resending animation by file_id), 0-1024 characters after entities parsing
- $parse_mode : string|null = null
-
Optional. Mode for parsing entities in the animation caption. See formatting options for more details.
- $caption_entities : array<int, MessageEntity|array<string|int, mixed>>|null = null
-
Optional. A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
- $show_caption_above_media : bool|null = null
-
Optional. Pass True if the caption must be shown above the message media
- $has_spoiler : bool|null = null
-
Optional. Pass True if the animation needs to be covered with a spoiler animation
- $disable_notification : bool|null = null
-
Optional. Sends the message silently. Users will receive a notification with no sound.
- $protect_content : bool|null = null
-
Optional. Protects the contents of the sent message from forwarding and saving
- $allow_paid_broadcast : bool|null = null
-
Optional. Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance.
- $message_effect_id : string|null = null
-
Optional. Unique identifier of the message effect to be added to the message; for private chats only
- $suggested_post_parameters : SuggestedPostParameters|array<string|int, mixed>|null = null
-
Optional. A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
- $reply_parameters : ReplyParameters|array<string|int, mixed>|null = null
-
Optional. Description of the message to reply to
- $reply_markup : InlineKeyboardMarkup|array<string|int, mixed>|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply|null = null
-
Optional. Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
Tags
Return values
PromiseInterface<string|int, Message>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.
public
sendAudio(int|string $chat_id, InputFile|string $audio[, string|null $business_connection_id = null ][, int|null $message_thread_id = null ][, int|null $direct_messages_topic_id = null ][, EphemeralMessageParameters|array<string|int, mixed>|null $ephemeral_message_parameters = null ][, string|null $caption = null ][, string|null $parse_mode = null ][, array<int, MessageEntity|array<string|int, mixed>>|null $caption_entities = null ][, int|null $duration = null ][, string|null $performer = null ][, string|null $title = null ][, InputFile|string|null $thumbnail = null ][, bool|null $disable_notification = null ][, bool|null $protect_content = null ][, bool|null $allow_paid_broadcast = null ][, string|null $message_effect_id = null ][, SuggestedPostParameters|array<string|int, mixed>|null $suggested_post_parameters = null ][, ReplyParameters|array<string|int, mixed>|null $reply_parameters = null ][, InlineKeyboardMarkup|array<string|int, mixed>|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply|null $reply_markup = null ]) : PromiseInterface<string|int, Message>
Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future. For sending voice messages, use the sendVoice method instead.
Parameters
- $chat_id : int|string
-
Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username
- $audio : InputFile|string
-
Audio file to send. Pass a file_id as String to send an audio file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files: https://core.telegram.org/bots/api#sending-files
- $business_connection_id : string|null = null
-
Optional. Unique identifier of the business connection on behalf of which the message will be sent
- $message_thread_id : int|null = null
-
Optional. Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
- $direct_messages_topic_id : int|null = null
-
Optional. Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
- $ephemeral_message_parameters : EphemeralMessageParameters|array<string|int, mixed>|null = null
-
Optional. A JSON-serialized object containing the parameters of the ephemeral message to send
- $caption : string|null = null
-
Optional. Audio caption, 0-1024 characters after entities parsing
- $parse_mode : string|null = null
-
Optional. Mode for parsing entities in the audio caption. See formatting options for more details.
- $caption_entities : array<int, MessageEntity|array<string|int, mixed>>|null = null
-
Optional. A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
- $duration : int|null = null
-
Optional. Duration of the audio in seconds
- $performer : string|null = null
-
Optional. Performer
- $title : string|null = null
-
Optional. Track name
- $thumbnail : InputFile|string|null = null
-
Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass "attach://<file_attach_name>" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files: https://core.telegram.org/bots/api#sending-files
- $disable_notification : bool|null = null
-
Optional. Sends the message silently. Users will receive a notification with no sound.
- $protect_content : bool|null = null
-
Optional. Protects the contents of the sent message from forwarding and saving
- $allow_paid_broadcast : bool|null = null
-
Optional. Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance.
- $message_effect_id : string|null = null
-
Optional. Unique identifier of the message effect to be added to the message; for private chats only
- $suggested_post_parameters : SuggestedPostParameters|array<string|int, mixed>|null = null
-
Optional. A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
- $reply_parameters : ReplyParameters|array<string|int, mixed>|null = null
-
Optional. Description of the message to reply to
- $reply_markup : InlineKeyboardMarkup|array<string|int, mixed>|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply|null = null
-
Optional. Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
Tags
Return values
PromiseInterface<string|int, Message>sendChatAction()
Use this method when you need to tell the user that something is happening on the bot's side.
public
sendChatAction(int|string $chat_id, string $action[, string|null $business_connection_id = null ][, int|null $message_thread_id = null ]) : PromiseInterface<string|int, bool>
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. We only recommend using this method when a response from the bot will take a noticeable amount of time to arrive.
Parameters
- $chat_id : int|string
-
Unique identifier for the target chat or username of the target bot or supergroup in the format @username. Channel chats and channel direct messages chats aren't supported.
- $action : string
-
Type of action to broadcast. Choose one, depending on what the user is about to receive: typing for text messages, upload_photo for photos, record_video or upload_video for videos, record_voice or upload_voice for voice notes, upload_document for general files, choose_sticker for stickers, find_location for location data, record_video_note or upload_video_note for video notes.
- $business_connection_id : string|null = null
-
Optional. Unique identifier of the business connection on behalf of which the action will be sent
- $message_thread_id : int|null = null
-
Optional. Unique identifier for the target message thread or topic of a forum; for supergroups and private chats of bots with forum topic mode enabled only
Tags
Return values
PromiseInterface<string|int, bool>sendChecklist()
Use this method to send a checklist on behalf of a connected business account. On success, the sent Message is returned.
public
sendChecklist(string $business_connection_id, int|string $chat_id, InputChecklist|array<string|int, mixed> $checklist[, bool|null $disable_notification = null ][, bool|null $protect_content = null ][, string|null $message_effect_id = null ][, ReplyParameters|array<string|int, mixed>|null $reply_parameters = null ][, InlineKeyboardMarkup|array<string|int, mixed>|null $reply_markup = null ]) : PromiseInterface<string|int, Message>
Parameters
- $business_connection_id : string
-
Unique identifier of the business connection on behalf of which the message will be sent
- $chat_id : int|string
-
Unique identifier for the target chat or username of the target bot in the format @username
- $checklist : InputChecklist|array<string|int, mixed>
-
A JSON-serialized object for the checklist to send
- $disable_notification : bool|null = null
-
Optional. Sends the message silently. Users will receive a notification with no sound.
- $protect_content : bool|null = null
-
Optional. Protects the contents of the sent message from forwarding and saving
- $message_effect_id : string|null = null
-
Optional. Unique identifier of the message effect to be added to the message
- $reply_parameters : ReplyParameters|array<string|int, mixed>|null = null
-
Optional. A JSON-serialized object for description of the message to reply to
- $reply_markup : InlineKeyboardMarkup|array<string|int, mixed>|null = null
-
Optional. A JSON-serialized object for an inline keyboard
Tags
Return values
PromiseInterface<string|int, Message>sendContact()
Use this method to send phone contacts. On success, the sent Message is returned.
public
sendContact(int|string $chat_id, string $phone_number, string $first_name[, string|null $business_connection_id = null ][, int|null $message_thread_id = null ][, int|null $direct_messages_topic_id = null ][, EphemeralMessageParameters|array<string|int, mixed>|null $ephemeral_message_parameters = null ][, string|null $last_name = null ][, string|null $vcard = null ][, bool|null $disable_notification = null ][, bool|null $protect_content = null ][, bool|null $allow_paid_broadcast = null ][, string|null $message_effect_id = null ][, SuggestedPostParameters|array<string|int, mixed>|null $suggested_post_parameters = null ][, ReplyParameters|array<string|int, mixed>|null $reply_parameters = null ][, InlineKeyboardMarkup|array<string|int, mixed>|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply|null $reply_markup = null ]) : PromiseInterface<string|int, Message>
Parameters
- $chat_id : int|string
-
Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username
- $phone_number : string
-
Contact's phone number
- $first_name : string
-
Contact's first name
- $business_connection_id : string|null = null
-
Optional. Unique identifier of the business connection on behalf of which the message will be sent
- $message_thread_id : int|null = null
-
Optional. Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
- $direct_messages_topic_id : int|null = null
-
Optional. Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
- $ephemeral_message_parameters : EphemeralMessageParameters|array<string|int, mixed>|null = null
-
Optional. A JSON-serialized object containing the parameters of the ephemeral message to send
- $last_name : string|null = null
-
Optional. Contact's last name
- $vcard : string|null = null
-
Optional. Additional data about the contact in the form of a vCard, 0-2048 bytes
- $disable_notification : bool|null = null
-
Optional. Sends the message silently. Users will receive a notification with no sound.
- $protect_content : bool|null = null
-
Optional. Protects the contents of the sent message from forwarding and saving
- $allow_paid_broadcast : bool|null = null
-
Optional. Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance.
- $message_effect_id : string|null = null
-
Optional. Unique identifier of the message effect to be added to the message; for private chats only
- $suggested_post_parameters : SuggestedPostParameters|array<string|int, mixed>|null = null
-
Optional. A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
- $reply_parameters : ReplyParameters|array<string|int, mixed>|null = null
-
Optional. Description of the message to reply to
- $reply_markup : InlineKeyboardMarkup|array<string|int, mixed>|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply|null = null
-
Optional. Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
Tags
Return values
PromiseInterface<string|int, Message>sendDice()
Use this method to send an animated emoji that will display a random value. On success, the sent Message is returned.
public
sendDice(int|string $chat_id[, string|null $business_connection_id = null ][, int|null $message_thread_id = null ][, int|null $direct_messages_topic_id = null ][, string|null $emoji = null ][, bool|null $disable_notification = null ][, bool|null $protect_content = null ][, bool|null $allow_paid_broadcast = null ][, string|null $message_effect_id = null ][, SuggestedPostParameters|array<string|int, mixed>|null $suggested_post_parameters = null ][, ReplyParameters|array<string|int, mixed>|null $reply_parameters = null ][, InlineKeyboardMarkup|array<string|int, mixed>|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply|null $reply_markup = null ]) : PromiseInterface<string|int, Message>
Parameters
- $chat_id : int|string
-
Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username
- $business_connection_id : string|null = null
-
Optional. Unique identifier of the business connection on behalf of which the message will be sent
- $message_thread_id : int|null = null
-
Optional. Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
- $direct_messages_topic_id : int|null = null
-
Optional. Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
- $emoji : string|null = null
-
Optional. Emoji on which the dice throw animation is based. Currently, must be one of "🎲", "🎯", "🏀", "⚽", "🎳", or "🎰". Dice can have values 1-6 for "🎲", "🎯" and "🎳", values 1-5 for "🏀" and "⚽", and values 1-64 for "🎰". Defaults to "🎲".
- $disable_notification : bool|null = null
-
Optional. Sends the message silently. Users will receive a notification with no sound.
- $protect_content : bool|null = null
-
Optional. Protects the contents of the sent message from forwarding
- $allow_paid_broadcast : bool|null = null
-
Optional. Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance.
- $message_effect_id : string|null = null
-
Optional. Unique identifier of the message effect to be added to the message; for private chats only
- $suggested_post_parameters : SuggestedPostParameters|array<string|int, mixed>|null = null
-
Optional. A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
- $reply_parameters : ReplyParameters|array<string|int, mixed>|null = null
-
Optional. Description of the message to reply to
- $reply_markup : InlineKeyboardMarkup|array<string|int, mixed>|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply|null = null
-
Optional. Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
Tags
Return values
PromiseInterface<string|int, Message>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.
public
sendDocument(int|string $chat_id, InputFile|string $document[, string|null $business_connection_id = null ][, int|null $message_thread_id = null ][, int|null $direct_messages_topic_id = null ][, EphemeralMessageParameters|array<string|int, mixed>|null $ephemeral_message_parameters = null ][, InputFile|string|null $thumbnail = null ][, string|null $caption = null ][, string|null $parse_mode = null ][, array<int, MessageEntity|array<string|int, mixed>>|null $caption_entities = null ][, bool|null $disable_content_type_detection = null ][, bool|null $disable_notification = null ][, bool|null $protect_content = null ][, bool|null $allow_paid_broadcast = null ][, string|null $message_effect_id = null ][, SuggestedPostParameters|array<string|int, mixed>|null $suggested_post_parameters = null ][, ReplyParameters|array<string|int, mixed>|null $reply_parameters = null ][, InlineKeyboardMarkup|array<string|int, mixed>|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply|null $reply_markup = null ]) : PromiseInterface<string|int, Message>
Parameters
- $chat_id : int|string
-
Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username
- $document : InputFile|string
-
File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files: https://core.telegram.org/bots/api#sending-files
- $business_connection_id : string|null = null
-
Optional. Unique identifier of the business connection on behalf of which the message will be sent
- $message_thread_id : int|null = null
-
Optional. Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
- $direct_messages_topic_id : int|null = null
-
Optional. Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
- $ephemeral_message_parameters : EphemeralMessageParameters|array<string|int, mixed>|null = null
-
Optional. A JSON-serialized object containing the parameters of the ephemeral message to send
- $thumbnail : InputFile|string|null = null
-
Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass "attach://<file_attach_name>" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files: https://core.telegram.org/bots/api#sending-files
- $caption : string|null = null
-
Optional. Document caption (may also be used when resending documents by file_id), 0-1024 characters after entities parsing
- $parse_mode : string|null = null
-
Optional. Mode for parsing entities in the document caption. See formatting options for more details.
- $caption_entities : array<int, MessageEntity|array<string|int, mixed>>|null = null
-
Optional. A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
- $disable_content_type_detection : bool|null = null
-
Optional. Disables automatic server-side content type detection for files uploaded using multipart/form-data
- $disable_notification : bool|null = null
-
Optional. Sends the message silently. Users will receive a notification with no sound.
- $protect_content : bool|null = null
-
Optional. Protects the contents of the sent message from forwarding and saving
- $allow_paid_broadcast : bool|null = null
-
Optional. Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance.
- $message_effect_id : string|null = null
-
Optional. Unique identifier of the message effect to be added to the message; for private chats only
- $suggested_post_parameters : SuggestedPostParameters|array<string|int, mixed>|null = null
-
Optional. A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
- $reply_parameters : ReplyParameters|array<string|int, mixed>|null = null
-
Optional. Description of the message to reply to
- $reply_markup : InlineKeyboardMarkup|array<string|int, mixed>|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply|null = null
-
Optional. Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
Tags
Return values
PromiseInterface<string|int, Message>sendLivePhoto()
Use this method to send live photos. On success, the sent Message is returned.
public
sendLivePhoto(int|string $chat_id, InputFile|string $live_photo, InputFile|string $photo[, string|null $business_connection_id = null ][, int|null $message_thread_id = null ][, int|null $direct_messages_topic_id = null ][, EphemeralMessageParameters|array<string|int, mixed>|null $ephemeral_message_parameters = null ][, string|null $caption = null ][, string|null $parse_mode = null ][, array<int, MessageEntity|array<string|int, mixed>>|null $caption_entities = null ][, bool|null $show_caption_above_media = null ][, bool|null $has_spoiler = null ][, bool|null $disable_notification = null ][, bool|null $protect_content = null ][, bool|null $allow_paid_broadcast = null ][, string|null $message_effect_id = null ][, SuggestedPostParameters|array<string|int, mixed>|null $suggested_post_parameters = null ][, ReplyParameters|array<string|int, mixed>|null $reply_parameters = null ][, InlineKeyboardMarkup|array<string|int, mixed>|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply|null $reply_markup = null ]) : PromiseInterface<string|int, Message>
Parameters
- $chat_id : int|string
-
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- $live_photo : InputFile|string
-
Live photo video to send. The video must be no longer than 10 seconds and must not exceed 10 MB in size. Pass a file_id as String to send a video that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files: https://core.telegram.org/bots/api#sending-files. Sending live photos by a URL is currently unsupported.
- $photo : InputFile|string
-
The static photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files: https://core.telegram.org/bots/api#sending-files. Sending live photos by a URL is currently unsupported.
- $business_connection_id : string|null = null
-
Optional. Unique identifier of the business connection on behalf of which the message will be sent
- $message_thread_id : int|null = null
-
Optional. Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
- $direct_messages_topic_id : int|null = null
-
Optional. Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
- $ephemeral_message_parameters : EphemeralMessageParameters|array<string|int, mixed>|null = null
-
Optional. A JSON-serialized object containing the parameters of the ephemeral message to send
- $caption : string|null = null
-
Optional. Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing
- $parse_mode : string|null = null
-
Optional. Mode for parsing entities in the video caption. See formatting options for more details.
- $caption_entities : array<int, MessageEntity|array<string|int, mixed>>|null = null
-
Optional. A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
- $show_caption_above_media : bool|null = null
-
Optional. Pass True if the caption must be shown above the message media
- $has_spoiler : bool|null = null
-
Optional. Pass True if the video needs to be covered with a spoiler animation
- $disable_notification : bool|null = null
-
Optional. Sends the message silently. Users will receive a notification with no sound.
- $protect_content : bool|null = null
-
Optional. Protects the contents of the sent message from forwarding and saving
- $allow_paid_broadcast : bool|null = null
-
Optional. Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance.
- $message_effect_id : string|null = null
-
Optional. Unique identifier of the message effect to be added to the message; for private chats only
- $suggested_post_parameters : SuggestedPostParameters|array<string|int, mixed>|null = null
-
Optional. A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
- $reply_parameters : ReplyParameters|array<string|int, mixed>|null = null
-
Optional. Description of the message to reply to
- $reply_markup : InlineKeyboardMarkup|array<string|int, mixed>|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply|null = null
-
Optional. Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
Tags
Return values
PromiseInterface<string|int, Message>sendLocation()
Use this method to send point on the map. On success, the sent Message is returned.
public
sendLocation(int|string $chat_id, float $latitude, float $longitude[, string|null $business_connection_id = null ][, int|null $message_thread_id = null ][, int|null $direct_messages_topic_id = null ][, EphemeralMessageParameters|array<string|int, mixed>|null $ephemeral_message_parameters = null ][, float|null $horizontal_accuracy = null ][, int|null $live_period = null ][, int|null $heading = null ][, int|null $proximity_alert_radius = null ][, bool|null $disable_notification = null ][, bool|null $protect_content = null ][, bool|null $allow_paid_broadcast = null ][, string|null $message_effect_id = null ][, SuggestedPostParameters|array<string|int, mixed>|null $suggested_post_parameters = null ][, ReplyParameters|array<string|int, mixed>|null $reply_parameters = null ][, InlineKeyboardMarkup|array<string|int, mixed>|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply|null $reply_markup = null ]) : PromiseInterface<string|int, Message>
Parameters
- $chat_id : int|string
-
Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username
- $latitude : float
-
Latitude of the location
- $longitude : float
-
Longitude of the location
- $business_connection_id : string|null = null
-
Optional. Unique identifier of the business connection on behalf of which the message will be sent
- $message_thread_id : int|null = null
-
Optional. Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
- $direct_messages_topic_id : int|null = null
-
Optional. Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
- $ephemeral_message_parameters : EphemeralMessageParameters|array<string|int, mixed>|null = null
-
Optional. A JSON-serialized object containing the parameters of the ephemeral message to send
- $horizontal_accuracy : float|null = null
-
Optional. The radius of uncertainty for the location, measured in meters; 0-1500
- $live_period : int|null = null
-
Optional. Period in seconds during which the location will be updated (see Live Locations), must be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely. Must be 0 for ephemeral messages.
- $heading : int|null = null
-
Optional. For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.
- $proximity_alert_radius : int|null = null
-
Optional. For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified.
- $disable_notification : bool|null = null
-
Optional. Sends the message silently. Users will receive a notification with no sound.
- $protect_content : bool|null = null
-
Optional. Protects the contents of the sent message from forwarding and saving
- $allow_paid_broadcast : bool|null = null
-
Optional. Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance.
- $message_effect_id : string|null = null
-
Optional. Unique identifier of the message effect to be added to the message; for private chats only
- $suggested_post_parameters : SuggestedPostParameters|array<string|int, mixed>|null = null
-
Optional. A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
- $reply_parameters : ReplyParameters|array<string|int, mixed>|null = null
-
Optional. Description of the message to reply to
- $reply_markup : InlineKeyboardMarkup|array<string|int, mixed>|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply|null = null
-
Optional. Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
Tags
Return values
PromiseInterface<string|int, Message>sendMediaGroup()
Use this method to send a group of photos, live photos, videos, documents or audios as an album.
public
sendMediaGroup(int|string $chat_id, array<int, InputMediaAudio|array<string|int, mixed>>|array<int, InputMediaDocument|array<string|int, mixed>>|array<int, InputMediaLivePhoto|array<string|int, mixed>>|array<int, InputMediaPhoto|array<string|int, mixed>>|array<int, InputMediaVideo|array<string|int, mixed>> $media[, string|null $business_connection_id = null ][, int|null $message_thread_id = null ][, int|null $direct_messages_topic_id = null ][, bool|null $disable_notification = null ][, bool|null $protect_content = null ][, bool|null $allow_paid_broadcast = null ][, string|null $message_effect_id = null ][, ReplyParameters|array<string|int, mixed>|null $reply_parameters = null ]) : PromiseInterface<string|int, Collection<string|int, Message>>
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.
Parameters
- $chat_id : int|string
-
Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username
- $media : array<int, InputMediaAudio|array<string|int, mixed>>|array<int, InputMediaDocument|array<string|int, mixed>>|array<int, InputMediaLivePhoto|array<string|int, mixed>>|array<int, InputMediaPhoto|array<string|int, mixed>>|array<int, InputMediaVideo|array<string|int, mixed>>
-
A JSON-serialized Array describing messages to be sent, must include 2-10 items
- $business_connection_id : string|null = null
-
Optional. Unique identifier of the business connection on behalf of which the message will be sent
- $message_thread_id : int|null = null
-
Optional. Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
- $direct_messages_topic_id : int|null = null
-
Optional. Identifier of the direct messages topic to which the messages will be sent; required if the messages are sent to a direct messages chat
- $disable_notification : bool|null = null
-
Optional. Sends messages silently. Users will receive a notification with no sound.
- $protect_content : bool|null = null
-
Optional. Protects the contents of the sent messages from forwarding and saving
- $allow_paid_broadcast : bool|null = null
-
Optional. Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance.
- $message_effect_id : string|null = null
-
Optional. Unique identifier of the message effect to be added to the message; for private chats only
- $reply_parameters : ReplyParameters|array<string|int, mixed>|null = null
-
Optional. Description of the message to reply to
Tags
Return values
PromiseInterface<string|int, Collection<string|int, Message>>sendMessage()
Use this method to send text messages. On success, the sent Message is returned.
public
sendMessage(int|string $chat_id, string $text[, string|null $business_connection_id = null ][, int|null $message_thread_id = null ][, int|null $direct_messages_topic_id = null ][, EphemeralMessageParameters|array<string|int, mixed>|null $ephemeral_message_parameters = null ][, string|null $parse_mode = null ][, array<int, MessageEntity|array<string|int, mixed>>|null $entities = null ][, LinkPreviewOptions|array<string|int, mixed>|null $link_preview_options = null ][, bool|null $disable_notification = null ][, bool|null $protect_content = null ][, bool|null $allow_paid_broadcast = null ][, string|null $message_effect_id = null ][, SuggestedPostParameters|array<string|int, mixed>|null $suggested_post_parameters = null ][, ReplyParameters|array<string|int, mixed>|null $reply_parameters = null ][, InlineKeyboardMarkup|array<string|int, mixed>|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply|null $reply_markup = null ]) : PromiseInterface<string|int, Message>
Parameters
- $chat_id : int|string
-
Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username
- $text : string
-
Text of the message to be sent, 1-4096 characters after entities parsing
- $business_connection_id : string|null = null
-
Optional. Unique identifier of the business connection on behalf of which the message will be sent
- $message_thread_id : int|null = null
-
Optional. Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
- $direct_messages_topic_id : int|null = null
-
Optional. Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
- $ephemeral_message_parameters : EphemeralMessageParameters|array<string|int, mixed>|null = null
-
Optional. A JSON-serialized object containing the parameters of the ephemeral message to send
- $parse_mode : string|null = null
-
Optional. Mode for parsing entities in the message text. See formatting options for more details.
- $entities : array<int, MessageEntity|array<string|int, mixed>>|null = null
-
Optional. A JSON-serialized list of special entities that appear in message text, which can be specified instead of parse_mode
- $link_preview_options : LinkPreviewOptions|array<string|int, mixed>|null = null
-
Optional. Link preview generation options for the message
- $disable_notification : bool|null = null
-
Optional. Sends the message silently. Users will receive a notification with no sound.
- $protect_content : bool|null = null
-
Optional. Protects the contents of the sent message from forwarding and saving
- $allow_paid_broadcast : bool|null = null
-
Optional. Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance.
- $message_effect_id : string|null = null
-
Optional. Unique identifier of the message effect to be added to the message; for private chats only
- $suggested_post_parameters : SuggestedPostParameters|array<string|int, mixed>|null = null
-
Optional. A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
- $reply_parameters : ReplyParameters|array<string|int, mixed>|null = null
-
Optional. Description of the message to reply to
- $reply_markup : InlineKeyboardMarkup|array<string|int, mixed>|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply|null = null
-
Optional. Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
Tags
Return values
PromiseInterface<string|int, Message>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.
public
sendMessageDraft(int $chat_id, int $draft_id[, int|null $message_thread_id = null ][, string|null $text = null ][, string|null $parse_mode = null ][, array<int, MessageEntity|array<string|int, mixed>>|null $entities = null ][, bool|null $can_stop = null ][, bool|null $keep_on_stop = null ]) : PromiseInterface<string|int, bool>
Parameters
- $chat_id : int
-
Unique identifier for the target private chat
- $draft_id : int
-
Unique identifier of the message draft; must be non-zero. Changes to drafts with the same identifier are animated. Otherwise, the draft is replaced without animation.
- $message_thread_id : int|null = null
-
Optional. Unique identifier for the target message thread
- $text : string|null = null
-
Optional. Text of the message to be sent, 0-4096 characters after entities parsing. Pass an empty text to show a "Thinking..." placeholder.
- $parse_mode : string|null = null
-
Optional. Mode for parsing entities in the message text. See formatting options for more details.
- $entities : array<int, MessageEntity|array<string|int, mixed>>|null = null
-
Optional. A JSON-serialized list of special entities that appear in message text, which can be specified instead of parse_mode
- $can_stop : bool|null = null
-
Optional. Pass True to show the user a button to stop further drafts. The bot will receive an Update "stopped_message_generation" if the user presses the button.
- $keep_on_stop : bool|null = null
-
Optional. Pass True to keep the draft in the chat when the button is pressed. The draft will still disappear after a short time or if the bot sends a message. To fully preserve the partial draft, the bot should send it as a new message.
Tags
Return values
PromiseInterface<string|int, bool>sendPaidMedia()
Use this method to send paid media. On success, the sent Message is returned.
public
sendPaidMedia(int|string $chat_id, int $star_count, array<int, InputPaidMedia|array<string|int, mixed>> $media[, string|null $business_connection_id = null ][, int|null $message_thread_id = null ][, int|null $direct_messages_topic_id = null ][, string|null $payload = null ][, string|null $caption = null ][, string|null $parse_mode = null ][, array<int, MessageEntity|array<string|int, mixed>>|null $caption_entities = null ][, bool|null $show_caption_above_media = null ][, bool|null $disable_notification = null ][, bool|null $protect_content = null ][, bool|null $allow_paid_broadcast = null ][, SuggestedPostParameters|array<string|int, mixed>|null $suggested_post_parameters = null ][, ReplyParameters|array<string|int, mixed>|null $reply_parameters = null ][, InlineKeyboardMarkup|array<string|int, mixed>|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply|null $reply_markup = null ]) : PromiseInterface<string|int, Message>
Parameters
- $chat_id : int|string
-
Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username. If the chat is a channel, all Telegram Star proceeds from this media will be credited to the chat's balance. Otherwise, they will be credited to the bot's balance.
- $star_count : int
-
The number of Telegram Stars that must be paid to buy access to the media; 1-25000
- $media : array<int, InputPaidMedia|array<string|int, mixed>>
-
A JSON-serialized Array describing the media to be sent; up to 10 items
- $business_connection_id : string|null = null
-
Optional. Unique identifier of the business connection on behalf of which the message will be sent
- $message_thread_id : int|null = null
-
Optional. Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
- $direct_messages_topic_id : int|null = null
-
Optional. Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
- $payload : string|null = null
-
Optional. Bot-defined paid media payload, 0-128 bytes. This will not be displayed to the user, use it for your internal processes.
- $caption : string|null = null
-
Optional. Media caption, 0-1024 characters after entities parsing
- $parse_mode : string|null = null
-
Optional. Mode for parsing entities in the media caption. See formatting options for more details.
- $caption_entities : array<int, MessageEntity|array<string|int, mixed>>|null = null
-
Optional. A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
- $show_caption_above_media : bool|null = null
-
Optional. Pass True if the caption must be shown above the message media
- $disable_notification : bool|null = null
-
Optional. Sends the message silently. Users will receive a notification with no sound.
- $protect_content : bool|null = null
-
Optional. Protects the contents of the sent message from forwarding and saving
- $allow_paid_broadcast : bool|null = null
-
Optional. Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance.
- $suggested_post_parameters : SuggestedPostParameters|array<string|int, mixed>|null = null
-
Optional. A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
- $reply_parameters : ReplyParameters|array<string|int, mixed>|null = null
-
Optional. Description of the message to reply to
- $reply_markup : InlineKeyboardMarkup|array<string|int, mixed>|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply|null = null
-
Optional. Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
Tags
Return values
PromiseInterface<string|int, Message>sendPhoto()
Use this method to send photos. On success, the sent Message is returned.
public
sendPhoto(int|string $chat_id, InputFile|string $photo[, string|null $business_connection_id = null ][, int|null $message_thread_id = null ][, int|null $direct_messages_topic_id = null ][, EphemeralMessageParameters|array<string|int, mixed>|null $ephemeral_message_parameters = null ][, string|null $caption = null ][, string|null $parse_mode = null ][, array<int, MessageEntity|array<string|int, mixed>>|null $caption_entities = null ][, bool|null $show_caption_above_media = null ][, bool|null $has_spoiler = null ][, bool|null $disable_notification = null ][, bool|null $protect_content = null ][, bool|null $allow_paid_broadcast = null ][, string|null $message_effect_id = null ][, SuggestedPostParameters|array<string|int, mixed>|null $suggested_post_parameters = null ][, ReplyParameters|array<string|int, mixed>|null $reply_parameters = null ][, InlineKeyboardMarkup|array<string|int, mixed>|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply|null $reply_markup = null ]) : PromiseInterface<string|int, Message>
Parameters
- $chat_id : int|string
-
Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username
- $photo : InputFile|string
-
Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20. More information on Sending Files: https://core.telegram.org/bots/api#sending-files
- $business_connection_id : string|null = null
-
Optional. Unique identifier of the business connection on behalf of which the message will be sent
- $message_thread_id : int|null = null
-
Optional. Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
- $direct_messages_topic_id : int|null = null
-
Optional. Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
- $ephemeral_message_parameters : EphemeralMessageParameters|array<string|int, mixed>|null = null
-
Optional. A JSON-serialized object containing the parameters of the ephemeral message to send
- $caption : string|null = null
-
Optional. Photo caption (may also be used when resending photos by file_id), 0-1024 characters after entities parsing
- $parse_mode : string|null = null
-
Optional. Mode for parsing entities in the photo caption. See formatting options for more details.
- $caption_entities : array<int, MessageEntity|array<string|int, mixed>>|null = null
-
Optional. A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
- $show_caption_above_media : bool|null = null
-
Optional. Pass True if the caption must be shown above the message media
- $has_spoiler : bool|null = null
-
Optional. Pass True if the photo needs to be covered with a spoiler animation
- $disable_notification : bool|null = null
-
Optional. Sends the message silently. Users will receive a notification with no sound.
- $protect_content : bool|null = null
-
Optional. Protects the contents of the sent message from forwarding and saving
- $allow_paid_broadcast : bool|null = null
-
Optional. Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance.
- $message_effect_id : string|null = null
-
Optional. Unique identifier of the message effect to be added to the message; for private chats only
- $suggested_post_parameters : SuggestedPostParameters|array<string|int, mixed>|null = null
-
Optional. A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
- $reply_parameters : ReplyParameters|array<string|int, mixed>|null = null
-
Optional. Description of the message to reply to
- $reply_markup : InlineKeyboardMarkup|array<string|int, mixed>|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply|null = null
-
Optional. Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
Tags
Return values
PromiseInterface<string|int, Message>sendPoll()
Use this method to send a native poll. On success, the sent Message is returned.
public
sendPoll(int|string $chat_id, string $question, array<int, InputPollOption|array<string|int, mixed>> $options[, string|null $business_connection_id = null ][, int|null $message_thread_id = null ][, string|null $question_parse_mode = null ][, array<int, MessageEntity|array<string|int, mixed>>|null $question_entities = null ][, bool|null $is_anonymous = null ][, string|null $type = null ][, bool|null $allows_multiple_answers = null ][, bool|null $allows_revoting = null ][, bool|null $shuffle_options = null ][, bool|null $allow_adding_options = null ][, bool|null $hide_results_until_closes = null ][, bool|null $members_only = null ][, array<int, string>|null $country_codes = null ][, array<int, int>|null $correct_option_ids = null ][, string|null $explanation = null ][, string|null $explanation_parse_mode = null ][, array<int, MessageEntity|array<string|int, mixed>>|null $explanation_entities = null ][, InputPollMedia|array<string|int, mixed>|null $explanation_media = null ][, int|null $open_period = null ][, int|null $close_date = null ][, bool|null $is_closed = null ][, string|null $description = null ][, string|null $description_parse_mode = null ][, array<int, MessageEntity|array<string|int, mixed>>|null $description_entities = null ][, InputPollMedia|array<string|int, mixed>|null $media = null ][, bool|null $disable_notification = null ][, bool|null $protect_content = null ][, bool|null $allow_paid_broadcast = null ][, string|null $message_effect_id = null ][, ReplyParameters|array<string|int, mixed>|null $reply_parameters = null ][, InlineKeyboardMarkup|array<string|int, mixed>|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply|null $reply_markup = null ]) : PromiseInterface<string|int, Message>
Parameters
- $chat_id : int|string
-
Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username. Polls can't be sent to channel direct messages chats.
- $question : string
-
Poll question, 1-300 characters
- $options : array<int, InputPollOption|array<string|int, mixed>>
-
A JSON-serialized list of 1-12 answer options
- $business_connection_id : string|null = null
-
Optional. Unique identifier of the business connection on behalf of which the message will be sent
- $message_thread_id : int|null = null
-
Optional. Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
- $question_parse_mode : string|null = null
-
Optional. Mode for parsing entities in the question. See formatting options for more details. Currently, only custom emoji entities are allowed.
- $question_entities : array<int, MessageEntity|array<string|int, mixed>>|null = null
-
Optional. A JSON-serialized list of special entities that appear in the poll question. It can be specified instead of question_parse_mode.
- $is_anonymous : bool|null = null
-
Optional. True, if the poll needs to be anonymous, defaults to True
- $type : string|null = null
-
Optional. Poll type, "quiz" or "regular", defaults to "regular"
- $allows_multiple_answers : bool|null = null
-
Optional. Pass True if the poll allows multiple answers, defaults to False
- $allows_revoting : bool|null = null
-
Optional. Pass True if the poll allows to change chosen answer options, defaults to False for quizzes and to True for regular polls
- $shuffle_options : bool|null = null
-
Optional. Pass True if the poll options must be shown in random order
- $allow_adding_options : bool|null = null
-
Optional. Pass True if answer options can be added to the poll after creation; not supported for anonymous polls and quizzes
- $hide_results_until_closes : bool|null = null
-
Optional. Pass True if poll results must be shown only after the poll closes
- $members_only : bool|null = null
-
Optional. Pass True if voting is limited to users who have been members of the chat where the poll is being sent for more than 24 hours; for channel chats only
- $country_codes : array<int, string>|null = null
-
Optional. A JSON-serialized list of 0-12 two-letter ISO 3166-1 alpha-2 country codes indicating the countries from which users can vote in the poll; for channel chats only. Use "FT" as a country code to allow users with anonymous numbers to vote. If omitted or empty, then users from any country can participate in the poll.
- $correct_option_ids : array<int, int>|null = null
-
Optional. A JSON-serialized list of monotonically increasing 0-based identifiers of the correct answer options, required for polls in quiz mode
- $explanation : string|null = null
-
Optional. Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters with at most 2 line feeds after entities parsing
- $explanation_parse_mode : string|null = null
-
Optional. Mode for parsing entities in the explanation. See formatting options for more details.
- $explanation_entities : array<int, MessageEntity|array<string|int, mixed>>|null = null
-
Optional. A JSON-serialized list of special entities that appear in the poll explanation. It can be specified instead of explanation_parse_mode.
- $explanation_media : InputPollMedia|array<string|int, mixed>|null = null
-
Optional. Media added to the quiz explanation
- $open_period : int|null = null
-
Optional. Amount of time in seconds the poll will be active after creation, 5-2628000. Can't be used together with close_date.
- $close_date : int|null = null
-
Optional. Point in time (Unix timestamp) when the poll will be automatically closed. Must be at least 5 and no more than 2628000 seconds in the future. Can't be used together with open_period.
- $is_closed : bool|null = null
-
Optional. Pass True if the poll needs to be immediately closed. This can be useful for poll preview.
- $description : string|null = null
-
Optional. Description of the poll to be sent, 0-1024 characters after entities parsing
- $description_parse_mode : string|null = null
-
Optional. Mode for parsing entities in the poll description. See formatting options for more details.
- $description_entities : array<int, MessageEntity|array<string|int, mixed>>|null = null
-
Optional. A JSON-serialized list of special entities that appear in the poll description, which can be specified instead of description_parse_mode
- $media : InputPollMedia|array<string|int, mixed>|null = null
-
Optional. Media added to the poll description
- $disable_notification : bool|null = null
-
Optional. Sends the message silently. Users will receive a notification with no sound.
- $protect_content : bool|null = null
-
Optional. Protects the contents of the sent message from forwarding and saving
- $allow_paid_broadcast : bool|null = null
-
Optional. Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance.
- $message_effect_id : string|null = null
-
Optional. Unique identifier of the message effect to be added to the message; for private chats only
- $reply_parameters : ReplyParameters|array<string|int, mixed>|null = null
-
Optional. Description of the message to reply to
- $reply_markup : InlineKeyboardMarkup|array<string|int, mixed>|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply|null = null
-
Optional. Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
Tags
Return values
PromiseInterface<string|int, Message>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.
public
sendRichMessage(int|string $chat_id, InputRichMessage|array<string|int, mixed> $rich_message[, string|null $business_connection_id = null ][, int|null $message_thread_id = null ][, int|null $direct_messages_topic_id = null ][, EphemeralMessageParameters|array<string|int, mixed>|null $ephemeral_message_parameters = null ][, bool|null $disable_notification = null ][, bool|null $protect_content = null ][, bool|null $allow_paid_broadcast = null ][, string|null $message_effect_id = null ][, SuggestedPostParameters|array<string|int, mixed>|null $suggested_post_parameters = null ][, ReplyParameters|array<string|int, mixed>|null $reply_parameters = null ][, InlineKeyboardMarkup|array<string|int, mixed>|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply|null $reply_markup = null ]) : PromiseInterface<string|int, Message>
Parameters
- $chat_id : int|string
-
Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username
- $rich_message : InputRichMessage|array<string|int, mixed>
-
The message to be sent
- $business_connection_id : string|null = null
-
Optional. Unique identifier of the business connection on behalf of which the message will be sent. Bot can send rich messages on behalf of a business account only if the corresponding user can send rich messages.
- $message_thread_id : int|null = null
-
Optional. Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
- $direct_messages_topic_id : int|null = null
-
Optional. Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
- $ephemeral_message_parameters : EphemeralMessageParameters|array<string|int, mixed>|null = null
-
Optional. A JSON-serialized object containing the parameters of the ephemeral message to send
- $disable_notification : bool|null = null
-
Optional. Sends the message silently. Users will receive a notification with no sound.
- $protect_content : bool|null = null
-
Optional. Protects the contents of the sent message from forwarding and saving
- $allow_paid_broadcast : bool|null = null
-
Optional. Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance.
- $message_effect_id : string|null = null
-
Optional. Unique identifier of the message effect to be added to the message; for private chats only
- $suggested_post_parameters : SuggestedPostParameters|array<string|int, mixed>|null = null
-
Optional. A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
- $reply_parameters : ReplyParameters|array<string|int, mixed>|null = null
-
Optional. Description of the message to reply to
- $reply_markup : InlineKeyboardMarkup|array<string|int, mixed>|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply|null = null
-
Optional. Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
Tags
Return values
PromiseInterface<string|int, Message>sendRichMessageDraft()
Use this method to stream a partial rich message to a user while the message is being generated.
public
sendRichMessageDraft(int $chat_id, int $draft_id, InputRichMessage|array<string|int, mixed> $rich_message[, int|null $message_thread_id = null ][, bool|null $can_stop = null ][, bool|null $keep_on_stop = null ]) : PromiseInterface<string|int, bool>
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.
Parameters
- $chat_id : int
-
Unique identifier for the target private chat
- $draft_id : int
-
Unique identifier of the message draft; must be non-zero. Changes to drafts with the same identifier are animated. Otherwise, the draft is replaced without animation.
- $rich_message : InputRichMessage|array<string|int, mixed>
-
The partial message to be streamed. Direct upload of new files and explicit upload of files by a URL isn't supported.
- $message_thread_id : int|null = null
-
Optional. Unique identifier for the target message thread
- $can_stop : bool|null = null
-
Optional. Pass True to show the user a button to stop further drafts. The bot will receive an Update "stopped_message_generation" if the user presses the button.
- $keep_on_stop : bool|null = null
-
Optional. Pass True to keep the draft in the chat when the button is pressed. The draft will still disappear after a short time or if the bot sends a message. To fully preserve the partial draft, the bot should send it as a new message.
Tags
Return values
PromiseInterface<string|int, bool>sendVenue()
Use this method to send information about a venue. On success, the sent Message is returned.
public
sendVenue(int|string $chat_id, float $latitude, float $longitude, string $title, string $address[, string|null $business_connection_id = null ][, int|null $message_thread_id = null ][, int|null $direct_messages_topic_id = null ][, EphemeralMessageParameters|array<string|int, mixed>|null $ephemeral_message_parameters = null ][, string|null $foursquare_id = null ][, string|null $foursquare_type = null ][, string|null $google_place_id = null ][, string|null $google_place_type = null ][, bool|null $disable_notification = null ][, bool|null $protect_content = null ][, bool|null $allow_paid_broadcast = null ][, string|null $message_effect_id = null ][, SuggestedPostParameters|array<string|int, mixed>|null $suggested_post_parameters = null ][, ReplyParameters|array<string|int, mixed>|null $reply_parameters = null ][, InlineKeyboardMarkup|array<string|int, mixed>|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply|null $reply_markup = null ]) : PromiseInterface<string|int, Message>
Parameters
- $chat_id : int|string
-
Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username
- $latitude : float
-
Latitude of the venue
- $longitude : float
-
Longitude of the venue
- $title : string
-
Name of the venue
- $address : string
-
Address of the venue
- $business_connection_id : string|null = null
-
Optional. Unique identifier of the business connection on behalf of which the message will be sent
- $message_thread_id : int|null = null
-
Optional. Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
- $direct_messages_topic_id : int|null = null
-
Optional. Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
- $ephemeral_message_parameters : EphemeralMessageParameters|array<string|int, mixed>|null = null
-
Optional. A JSON-serialized object containing the parameters of the ephemeral message to send
- $foursquare_id : string|null = null
-
Optional. Foursquare identifier of the venue
- $foursquare_type : string|null = null
-
Optional. Foursquare type of the venue, if known. (For example, "arts_entertainment/default", "arts_entertainment/aquarium" or "food/icecream".)
- $google_place_id : string|null = null
-
Optional. Google Places identifier of the venue
- $google_place_type : string|null = null
-
Optional. Google Places type of the venue. (See supported types.)
- $disable_notification : bool|null = null
-
Optional. Sends the message silently. Users will receive a notification with no sound.
- $protect_content : bool|null = null
-
Optional. Protects the contents of the sent message from forwarding and saving
- $allow_paid_broadcast : bool|null = null
-
Optional. Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance.
- $message_effect_id : string|null = null
-
Optional. Unique identifier of the message effect to be added to the message; for private chats only
- $suggested_post_parameters : SuggestedPostParameters|array<string|int, mixed>|null = null
-
Optional. A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
- $reply_parameters : ReplyParameters|array<string|int, mixed>|null = null
-
Optional. Description of the message to reply to
- $reply_markup : InlineKeyboardMarkup|array<string|int, mixed>|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply|null = null
-
Optional. Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
Tags
Return values
PromiseInterface<string|int, Message>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.
public
sendVideo(int|string $chat_id, InputFile|string $video[, string|null $business_connection_id = null ][, int|null $message_thread_id = null ][, int|null $direct_messages_topic_id = null ][, EphemeralMessageParameters|array<string|int, mixed>|null $ephemeral_message_parameters = null ][, int|null $duration = null ][, int|null $width = null ][, int|null $height = null ][, InputFile|string|null $thumbnail = null ][, InputFile|string|null $cover = null ][, int|null $start_timestamp = null ][, string|null $caption = null ][, string|null $parse_mode = null ][, array<int, MessageEntity|array<string|int, mixed>>|null $caption_entities = null ][, bool|null $show_caption_above_media = null ][, bool|null $has_spoiler = null ][, bool|null $supports_streaming = null ][, bool|null $disable_notification = null ][, bool|null $protect_content = null ][, bool|null $allow_paid_broadcast = null ][, string|null $message_effect_id = null ][, SuggestedPostParameters|array<string|int, mixed>|null $suggested_post_parameters = null ][, ReplyParameters|array<string|int, mixed>|null $reply_parameters = null ][, InlineKeyboardMarkup|array<string|int, mixed>|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply|null $reply_markup = null ]) : PromiseInterface<string|int, Message>
Parameters
- $chat_id : int|string
-
Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username
- $video : InputFile|string
-
Video to send. Pass a file_id as String to send a video that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data. More information on Sending Files: https://core.telegram.org/bots/api#sending-files
- $business_connection_id : string|null = null
-
Optional. Unique identifier of the business connection on behalf of which the message will be sent
- $message_thread_id : int|null = null
-
Optional. Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
- $direct_messages_topic_id : int|null = null
-
Optional. Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
- $ephemeral_message_parameters : EphemeralMessageParameters|array<string|int, mixed>|null = null
-
Optional. A JSON-serialized object containing the parameters of the ephemeral message to send
- $duration : int|null = null
-
Optional. Duration of sent video in seconds
- $width : int|null = null
-
Optional. Video width
- $height : int|null = null
-
Optional. Video height
- $thumbnail : InputFile|string|null = null
-
Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass "attach://<file_attach_name>" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files: https://core.telegram.org/bots/api#sending-files
- $cover : InputFile|string|null = null
-
Optional. Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass "attach://<file_attach_name>" to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files: https://core.telegram.org/bots/api#sending-files
- $start_timestamp : int|null = null
-
Optional. Start timestamp for the video in the message
- $caption : string|null = null
-
Optional. Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing
- $parse_mode : string|null = null
-
Optional. Mode for parsing entities in the video caption. See formatting options for more details.
- $caption_entities : array<int, MessageEntity|array<string|int, mixed>>|null = null
-
Optional. A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
- $show_caption_above_media : bool|null = null
-
Optional. Pass True if the caption must be shown above the message media
- $has_spoiler : bool|null = null
-
Optional. Pass True if the video needs to be covered with a spoiler animation
- $supports_streaming : bool|null = null
-
Optional. Pass True if the uploaded video is suitable for streaming
- $disable_notification : bool|null = null
-
Optional. Sends the message silently. Users will receive a notification with no sound.
- $protect_content : bool|null = null
-
Optional. Protects the contents of the sent message from forwarding and saving
- $allow_paid_broadcast : bool|null = null
-
Optional. Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance.
- $message_effect_id : string|null = null
-
Optional. Unique identifier of the message effect to be added to the message; for private chats only
- $suggested_post_parameters : SuggestedPostParameters|array<string|int, mixed>|null = null
-
Optional. A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
- $reply_parameters : ReplyParameters|array<string|int, mixed>|null = null
-
Optional. Description of the message to reply to
- $reply_markup : InlineKeyboardMarkup|array<string|int, mixed>|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply|null = null
-
Optional. Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
Tags
Return values
PromiseInterface<string|int, Message>sendVideoNote()
Use this method to send a rounded square MPEG4 video of up to 1 minute long. On success, the sent Message is returned.
public
sendVideoNote(int|string $chat_id, InputFile|string $video_note[, string|null $business_connection_id = null ][, int|null $message_thread_id = null ][, int|null $direct_messages_topic_id = null ][, EphemeralMessageParameters|array<string|int, mixed>|null $ephemeral_message_parameters = null ][, int|null $duration = null ][, int|null $length = null ][, InputFile|string|null $thumbnail = null ][, bool|null $disable_notification = null ][, bool|null $protect_content = null ][, bool|null $allow_paid_broadcast = null ][, string|null $message_effect_id = null ][, SuggestedPostParameters|array<string|int, mixed>|null $suggested_post_parameters = null ][, ReplyParameters|array<string|int, mixed>|null $reply_parameters = null ][, InlineKeyboardMarkup|array<string|int, mixed>|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply|null $reply_markup = null ]) : PromiseInterface<string|int, Message>
Parameters
- $chat_id : int|string
-
Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username
- $video_note : InputFile|string
-
Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files: https://core.telegram.org/bots/api#sending-files. Sending video notes by a URL is currently unsupported.
- $business_connection_id : string|null = null
-
Optional. Unique identifier of the business connection on behalf of which the message will be sent
- $message_thread_id : int|null = null
-
Optional. Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
- $direct_messages_topic_id : int|null = null
-
Optional. Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
- $ephemeral_message_parameters : EphemeralMessageParameters|array<string|int, mixed>|null = null
-
Optional. A JSON-serialized object containing the parameters of the ephemeral message to send
- $duration : int|null = null
-
Optional. Duration of sent video in seconds
- $length : int|null = null
-
Optional. Video width and height, i.e. diameter of the video message
- $thumbnail : InputFile|string|null = null
-
Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass "attach://<file_attach_name>" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files: https://core.telegram.org/bots/api#sending-files
- $disable_notification : bool|null = null
-
Optional. Sends the message silently. Users will receive a notification with no sound.
- $protect_content : bool|null = null
-
Optional. Protects the contents of the sent message from forwarding and saving
- $allow_paid_broadcast : bool|null = null
-
Optional. Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance.
- $message_effect_id : string|null = null
-
Optional. Unique identifier of the message effect to be added to the message; for private chats only
- $suggested_post_parameters : SuggestedPostParameters|array<string|int, mixed>|null = null
-
Optional. A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
- $reply_parameters : ReplyParameters|array<string|int, mixed>|null = null
-
Optional. Description of the message to reply to
- $reply_markup : InlineKeyboardMarkup|array<string|int, mixed>|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply|null = null
-
Optional. Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
Tags
Return values
PromiseInterface<string|int, Message>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.
public
sendVoice(int|string $chat_id, InputFile|string $voice[, string|null $business_connection_id = null ][, int|null $message_thread_id = null ][, int|null $direct_messages_topic_id = null ][, EphemeralMessageParameters|array<string|int, mixed>|null $ephemeral_message_parameters = null ][, string|null $caption = null ][, string|null $parse_mode = null ][, array<int, MessageEntity|array<string|int, mixed>>|null $caption_entities = null ][, int|null $duration = null ][, bool|null $disable_notification = null ][, bool|null $protect_content = null ][, bool|null $allow_paid_broadcast = null ][, string|null $message_effect_id = null ][, SuggestedPostParameters|array<string|int, mixed>|null $suggested_post_parameters = null ][, ReplyParameters|array<string|int, mixed>|null $reply_parameters = null ][, InlineKeyboardMarkup|array<string|int, mixed>|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply|null $reply_markup = null ]) : PromiseInterface<string|int, Message>
Parameters
- $chat_id : int|string
-
Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username
- $voice : InputFile|string
-
Audio file to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files: https://core.telegram.org/bots/api#sending-files
- $business_connection_id : string|null = null
-
Optional. Unique identifier of the business connection on behalf of which the message will be sent
- $message_thread_id : int|null = null
-
Optional. Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
- $direct_messages_topic_id : int|null = null
-
Optional. Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
- $ephemeral_message_parameters : EphemeralMessageParameters|array<string|int, mixed>|null = null
-
Optional. A JSON-serialized object containing the parameters of the ephemeral message to send
- $caption : string|null = null
-
Optional. Voice message caption, 0-1024 characters after entities parsing
- $parse_mode : string|null = null
-
Optional. Mode for parsing entities in the voice message caption. See formatting options for more details.
- $caption_entities : array<int, MessageEntity|array<string|int, mixed>>|null = null
-
Optional. A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
- $duration : int|null = null
-
Optional. Duration of the voice message in seconds
- $disable_notification : bool|null = null
-
Optional. Sends the message silently. Users will receive a notification with no sound.
- $protect_content : bool|null = null
-
Optional. Protects the contents of the sent message from forwarding and saving
- $allow_paid_broadcast : bool|null = null
-
Optional. Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance.
- $message_effect_id : string|null = null
-
Optional. Unique identifier of the message effect to be added to the message; for private chats only
- $suggested_post_parameters : SuggestedPostParameters|array<string|int, mixed>|null = null
-
Optional. A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
- $reply_parameters : ReplyParameters|array<string|int, mixed>|null = null
-
Optional. Description of the message to reply to
- $reply_markup : InlineKeyboardMarkup|array<string|int, mixed>|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply|null = null
-
Optional. Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
Tags
Return values
PromiseInterface<string|int, Message>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.
public
setMessageReaction(int|string $chat_id, int $message_id[, array<int, ReactionType|array<string|int, mixed>>|null $reaction = null ][, bool|null $is_big = null ]) : PromiseInterface<string|int, bool>
Returns True on success.
Parameters
- $chat_id : int|string
-
Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username
- $message_id : int
-
Identifier of the target message. If the message belongs to a media group, the reaction is set to the first non-deleted message in the group instead.
- $reaction : array<int, ReactionType|array<string|int, mixed>>|null = null
-
Optional. A JSON-serialized list of reaction types to set on the message. Currently, as non-premium users, bots can set up to one reaction per message. A custom emoji reaction can be used if it is either already present on the message or explicitly allowed by chat administrators. Paid reactions can't be used by bots.
- $is_big : bool|null = null
-
Optional. Pass True to set the reaction with a big animation
Tags
Return values
PromiseInterface<string|int, bool>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.
public
stopMessageLiveLocation([string|null $business_connection_id = null ][, int|string|null $chat_id = null ][, int|null $message_id = null ][, string|null $inline_message_id = null ][, InlineKeyboardMarkup|array<string|int, mixed>|null $reply_markup = null ]) : PromiseInterface<string|int, Message|bool>
Parameters
- $business_connection_id : string|null = null
-
Optional. Unique identifier of the business connection on behalf of which the message to be edited was sent
- $chat_id : int|string|null = null
-
Optional. Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username.
- $message_id : int|null = null
-
Optional. Required if inline_message_id is not specified. Identifier of the message with live location to stop.
- $inline_message_id : string|null = null
-
Optional. Required if chat_id and message_id are not specified. Identifier of the inline message.
- $reply_markup : InlineKeyboardMarkup|array<string|int, mixed>|null = null
-
Optional. A JSON-serialized object for a new inline keyboard
Tags
Return values
PromiseInterface<string|int, Message|bool>stopPoll()
Use this method to stop a poll which was sent by the bot. On success, the stopped Poll is returned.
public
stopPoll(int|string $chat_id, int $message_id[, string|null $business_connection_id = null ][, InlineKeyboardMarkup|array<string|int, mixed>|null $reply_markup = null ]) : PromiseInterface<string|int, Poll>
Parameters
- $chat_id : int|string
-
Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username
- $message_id : int
-
Identifier of the original message with the poll
- $business_connection_id : string|null = null
-
Optional. Unique identifier of the business connection on behalf of which the message to be edited was sent
- $reply_markup : InlineKeyboardMarkup|array<string|int, mixed>|null = null
-
Optional. A JSON-serialized object for a new message inline keyboard
Tags
Return values
PromiseInterface<string|int, Poll>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.
public
unpinAllChatMessages(int|string $chat_id) : PromiseInterface<string|int, bool>
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.
Parameters
- $chat_id : int|string
-
Unique identifier for the target chat or username of the target channel in the format @username
Tags
Return values
PromiseInterface<string|int, bool>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.
public
unpinChatMessage(int|string $chat_id[, string|null $business_connection_id = null ][, int|null $message_id = null ]) : PromiseInterface<string|int, bool>
Parameters
- $chat_id : int|string
-
Unique identifier for the target chat or username of the target channel in the format @username
- $business_connection_id : string|null = null
-
Optional. Unique identifier of the business connection on behalf of which the message will be unpinned
- $message_id : int|null = null
-
Optional. Identifier of the message to unpin. Required if business_connection_id is specified. If not specified, the most recent pinned message (by sending date) will be unpinned.