FILE / ScuroNeko/Laniakea
tgapi/inline_types.go
Исходный файл и его история в репозитории.
66 lines
3.0 KiB
Go
66 lines
3.0 KiB
Go
package tgapi
|
|
|
|
// InlineQueryResult is a JSON-serializable inline query result object.
|
|
// Since: Bot API 1.7
|
|
// See https://core.telegram.org/bots/api#inlinequeryresult
|
|
type InlineQueryResult map[string]any
|
|
|
|
// InlineQueryResultsButton represents a button shown above inline query results.
|
|
// Since: Bot API 6.3
|
|
// See https://core.telegram.org/bots/api#inlinequeryresultsbutton
|
|
type InlineQueryResultsButton struct {
|
|
// Text Label text on the button
|
|
Text string `json:"text"`
|
|
// WebApp Optional. Description of the Web App that will be launched when the user presses the button. The
|
|
// Web App will be able to switch back to the inline mode using the method switchInlineQuery inside the Web
|
|
// App.
|
|
WebApp *WebAppInfo `json:"web_app,omitempty"`
|
|
// StartParameter Optional. Deep-linking parameter for the /start message sent to the bot when a user
|
|
// presses the button. 1-64 characters, only A-Z, a-z, 0-9, _ and - are allowed. Example: An inline bot that
|
|
// sends YouTube videos can ask the user to connect the bot to their YouTube account to adapt search results
|
|
// accordingly. To do this, it displays a 'Connect your YouTube account' button above the results, or even
|
|
// before showing any. The user presses the button, switches to a private chat with the bot and, in doing
|
|
// so, passes a start parameter that instructs the bot to return an OAuth link. Once done, the bot can offer
|
|
// a switch_inline button so that the user can easily return to the chat where they wanted to use the bot's
|
|
// inline capabilities.
|
|
StartParameter string `json:"start_parameter,omitempty"`
|
|
}
|
|
|
|
// InputRichMessageContent represents the content of a rich message to be
|
|
// sent as the result of an inline query. Use it as the input_message_content
|
|
// value of an InlineQueryResult.
|
|
// Since: Bot API 10.1
|
|
// See https://core.telegram.org/bots/api#inputrichmessagecontent
|
|
type InputRichMessageContent struct {
|
|
// RichMessage contains structured rich-message content.
|
|
RichMessage InputRichMessage `json:"rich_message"`
|
|
}
|
|
|
|
// SentWebAppMessage describes an inline message sent by a Web App on behalf of a user.
|
|
// Since: Bot API 8.0
|
|
// See https://core.telegram.org/bots/api#sentwebappmessage
|
|
type SentWebAppMessage struct {
|
|
// InlineMessageID Optional. Identifier of the sent inline message. Available only if there is an inline
|
|
// keyboard attached to the message.
|
|
InlineMessageID string `json:"inline_message_id,omitempty"`
|
|
}
|
|
|
|
// PreparedInlineMessage describes a prepared inline message.
|
|
// Since: Bot API 8.0
|
|
// See https://core.telegram.org/bots/api#preparedinlinemessage
|
|
type PreparedInlineMessage struct {
|
|
// ID Unique identifier of the prepared message
|
|
ID string `json:"id"`
|
|
// ExpirationDate Expiration date of the prepared message, in Unix time. Expired prepared messages can no
|
|
// longer be used.
|
|
ExpirationDate int `json:"expiration_date"`
|
|
}
|
|
|
|
// PreparedKeyboardButton describes a prepared keyboard button.
|
|
// Since: Bot API 8.0
|
|
// See https://core.telegram.org/bots/api#preparedkeyboardbutton
|
|
type PreparedKeyboardButton struct {
|
|
// ID Unique identifier of the keyboard button
|
|
ID string `json:"id"`
|
|
}
|