Skip to main content

messages.sendInlineBotResult

Send a result obtained using messages.getInlineBotResults.

func (c *Client) MessagesSendInlineBotResult(ctx context.Context, request *MessagesSendInlineBotResultRequest) (UpdatesClass, error)

Calling this method

client.Run(ctx, func(ctx context.Context) error {
api := client.API()

res, err := api.MessagesSendInlineBotResult(ctx, &tg.MessagesSendInlineBotResultRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // UpdatesClass
return nil
})

Parameters

NameTypeRequiredDescription
SilentboolWhether to send the message silently (no notification will be triggered on the other client)
BackgroundboolWhether to send the message in background
ClearDraftboolWhether to clear the draft
HideViaboolWhether to hide the via @botname in the resulting message (only for bot usernames encountered in the config)
PeerInputPeerClassyesDestination
ReplyToInputReplyToClassIf set, indicates that the message should be sent in reply to the specified message or story.
RandomIDint64yesRandom ID to avoid resending the same query
QueryIDint64yesQuery ID from messages.getInlineBotResults
IDstringyesResult ID from messages.getInlineBotResults
ScheduleDateintScheduled message date for scheduled messages
SendAsInputPeerClassSend this message as the specified peer
QuickReplyShortcutInputQuickReplyShortcutClassAdd the message to the specified quick reply shortcut », instead.
AllowPaidStarsint64For paid messages », specifies the amount of Telegram Stars the user has agreed to pay in order to send the message.

Returns

UpdatesClass

Possible errors

CodeTypeDescription
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.
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.

References