Skip to main content

messages.savePreparedInlineMessage

Save a prepared inline message, to be shared by the user of the mini app using a web_app_send_prepared_message event

func (c *Client) MessagesSavePreparedInlineMessage(ctx context.Context, request *MessagesSavePreparedInlineMessageRequest) (*MessagesBotPreparedInlineMessage, error)

Calling this method

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

res, err := api.MessagesSavePreparedInlineMessage(ctx, &tg.MessagesSavePreparedInlineMessageRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // *MessagesBotPreparedInlineMessage
return nil
})

Parameters

NameTypeRequiredDescription
ResultInputBotInlineResultClassyesThe message
UserIDInputUserClassyesThe user to whom the web_app_send_prepared_message event event will be sent
PeerTypes[]InlineQueryPeerTypeClassTypes of chats where this message can be sent

Returns

*MessagesBotPreparedInlineMessage

Possible errors

CodeTypeDescription
400RESULT_ID_INVALIDOne of the specified result IDs is invalid.
400SEND_MESSAGE_GAME_INVALIDAn inputBotInlineMessageGame can only be contained in an inputBotInlineResultGame, not in an inputBotInlineResult/inputBotInlineResultPhoto/etc.
400USER_BOT_REQUIREDThis method can only be called by a bot.
400USER_ID_INVALIDThe provided user ID is invalid.

References