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
| Name | Type | Required | Description |
|---|---|---|---|
Result | InputBotInlineResultClass | yes | The message |
UserID | InputUserClass | yes | The user to whom the web_app_send_prepared_message event event will be sent |
PeerTypes | []InlineQueryPeerTypeClass | — | Types of chats where this message can be sent |
Returns
*MessagesBotPreparedInlineMessage
Possible errors
| Code | Type | Description |
|---|---|---|
| 400 | RESULT_ID_INVALID | One of the specified result IDs is invalid. |
| 400 | SEND_MESSAGE_GAME_INVALID | An inputBotInlineMessageGame can only be contained in an inputBotInlineResultGame, not in an inputBotInlineResult/inputBotInlineResultPhoto/etc. |
| 400 | USER_BOT_REQUIRED | This method can only be called by a bot. |
| 400 | USER_ID_INVALID | The provided user ID is invalid. |
References
- Official documentation
- Generated Go reference
- TL definition:
messages.savePreparedInlineMessage#f21f7f2f