messages.sendInlineBotResult #

Send a result obtained using messages.getInlineBotResults.

Layer 223

updatesTooLong#e317af7e = Updates;
updateShortMessage#313bc7f8 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int user_id:long message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long reply_to:flags.3?MessageReplyHeader entities:flags.7?Vector<MessageEntity> ttl_period:flags.25?int = Updates;
updateShortChatMessage#4d6deea5 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int from_id:long chat_id:long message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long reply_to:flags.3?MessageReplyHeader entities:flags.7?Vector<MessageEntity> ttl_period:flags.25?int = Updates;
updateShort#78d4dec1 update:Update date:int = Updates;
updatesCombined#725b04c3 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq_start:int seq:int = Updates;
updates#74ae4240 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq:int = Updates;
updateShortSentMessage#9015e101 flags:# out:flags.1?true id:int pts:int pts_count:int date:int media:flags.9?MessageMedia entities:flags.7?Vector<MessageEntity> ttl_period:flags.25?int = Updates;
---functions---
messages.sendInlineBotResult#c0cf7646 flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true hide_via:flags.11?true peer:InputPeer reply_to:flags.0?InputReplyTo random_id:long query_id:long id:string schedule_date:flags.10?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut allow_paid_stars:flags.21?long = Updates;

Parameters #

NameTypeDescription
flags#Flags, see TL conditional fields
silentflags.5?trueWhether to send the message silently (no notification will be triggered on the other client)
backgroundflags.6?trueWhether to send the message in background
clear_draftflags.7?trueWhether to clear the draft
hide_viaflags.11?trueWhether to hide the via @botname in the resulting message (only for bot usernames encountered in the config)
peerInputPeerDestination
reply_toflags.0?InputReplyToIf set, indicates that the message should be sent in reply to the specified message or story.
random_idlongRandom ID to avoid resending the same query. See here » for more info on random ID deduplication and updateMessageID mapping.
query_idlongQuery ID from messages.getInlineBotResults
idstringResult ID from messages.getInlineBotResults
schedule_dateflags.10?intScheduled message date for scheduled messages
send_asflags.13?InputPeerSend this message as the specified peer
quick_reply_shortcutflags.17?InputQuickReplyShortcutAdd the message to the specified quick reply shortcut », instead.
allow_paid_starsflags.21?longFor paid messages », specifies the amount of Telegram Stars the user has agreed to pay in order to send the message.

Result #

Updates

Only users can use this method #

Possible errors #

CodeTypeDescription
403ALLOW_PAYMENT_REQUIRED_%dThis peer charges %d Telegram Stars per message, but the allow_paid_stars was not set or its value is smaller than %d.
400CHANNEL_INVALIDThe provided channel is invalid.
400CHANNEL_PRIVATEYou haven't joined this channel/supergroup.
400CHAT_ADMIN_REQUIREDYou must be an admin in this chat to do this.
403CHAT_GUEST_SEND_FORBIDDENYou join the discussion group before commenting, see here » for more info.
400CHAT_RESTRICTEDYou can't send messages in this chat, you were restricted.
403CHAT_SEND_AUDIOS_FORBIDDENYou can't send audio messages in this chat.
403CHAT_SEND_GAME_FORBIDDENYou can't send a game to this chat.
403CHAT_SEND_GIFS_FORBIDDENYou can't send gifs in this chat.
403CHAT_SEND_INLINE_FORBIDDENYou can't send inline messages in this group.
403CHAT_SEND_MEDIA_FORBIDDENYou can't send media in this chat.
403CHAT_SEND_PHOTOS_FORBIDDENYou can't send photos in this chat.
403CHAT_SEND_PLAIN_FORBIDDENYou can't send non-media (text) messages in this chat.
403CHAT_SEND_STICKERS_FORBIDDENYou can't send stickers in this chat.
403CHAT_SEND_VOICES_FORBIDDENYou can't send voice recordings in this chat.
403CHAT_WRITE_FORBIDDENYou can't write in this chat.
400ENTITY_BOUNDS_INVALIDA specified entity offset or length is invalid, see here » for info on how to properly compute the entity offset/length.
400INLINE_RESULT_EXPIREDThe inline query expired.
400INPUT_USER_DEACTIVATEDThe specified user was deleted.
400MEDIA_EMPTYThe provided media object is invalid.
400MSG_ID_INVALIDInvalid message ID provided.
400PEER_ID_INVALIDThe provided peer id is invalid.
403PRIVACY_PREMIUM_REQUIREDYou need a Telegram Premium subscription to send a message to this user.
400QUERY_ID_EMPTYThe query ID is empty.
400QUICK_REPLIES_TOO_MUCHA maximum of appConfig.quick_replies_limit shortcuts may be created, the limit was reached.
500RANDOM_ID_DUPLICATEYou provided a random ID that was already used.
400REPLY_MESSAGES_TOO_MUCHEach shortcut can contain a maximum of appConfig.quick_reply_messages_limit messages, the limit was reached.
400RESULT_ID_EMPTYResult ID empty.
400RESULT_ID_INVALIDOne of the specified result IDs is invalid.
400SCHEDULE_DATE_TOO_LATEYou can't schedule a message this far in the future.
400SCHEDULE_TOO_MUCHThere are too many scheduled messages.
400SEND_AS_PEER_INVALIDYou can't send messages as the specified peer.
500SEND_MEDIA_INVALIDThe specified media is invalid.
420SLOWMODE_WAIT_%dSlowmode is enabled in this chat: wait %d seconds before sending another message to this chat.
400TOPIC_DELETEDThe specified topic was deleted.
400USER_BANNED_IN_CHANNELYou're banned from sending messages in supergroups/channels.
400VOICE_MESSAGES_FORBIDDENThis user's privacy settings forbid you from sending voice messages.
400WEBPAGE_CURL_FAILEDFailure while fetching the webpage with cURL.
400WEBPAGE_MEDIA_EMPTYWebpage media empty.
400YOU_BLOCKED_USERYou blocked this user.

Message drafts #

How to handle message drafts

config #

Current configuration

Working with Updates #

How to subscribe to updates and handle them properly.

messages.getInlineBotResults #

Query an inline bot

Telegram Business #

Users can turn their Telegram account into a business account, gaining access to business features such as opening hours, location, quick replies, automated messages, custom start pages, chatbot support, and more.

Telegram Stars can be used to pay for sending messages to users, supergroups and channels that have configured paid messages, requiring a payment for every message sent to them.

Telegram Stars #

Telegram Stars are virtual items that allow users to purchase digital goods and services from bots and mini apps inside the Telegram ecosystem, send gifts to content creators on the Telegram platform, and more.

Discussion groups #

Groups can be associated to a channel as a discussion group, to allow users to discuss about posts.

Styled text with message entities #

How to create styled text with message entities

Telegram Premium #

Telegram Premium is an optional subscription service that unlocks additional exclusive client-side and API-side features, while helping support the development of the app.

Client configuration #

The MTProto API has multiple configuration parameters that can be fetched with the appropriate methods.