FILE / ScuroNeko/Laniakea
tgapi/messages_types.go
Исходный файл и его история в репозитории.
1291 lines
72 KiB
Go
1291 lines
72 KiB
Go
package tgapi
|
|
|
|
import (
|
|
"encoding/json"
|
|
|
|
"git.scuroneko.dev/scuroneko/extypes"
|
|
)
|
|
|
|
// MessageID represents a message identifier wrapper returned by some API methods.
|
|
// Since: Bot API 7.0
|
|
type MessageID struct {
|
|
// MessageID Unique message identifier. In specific instances (e.g., message containing a video sent to a
|
|
// big chat), the server might automatically schedule a message instead of sending it immediately. In such
|
|
// cases, this field will be 0 and the relevant message will be unusable until it is actually sent.
|
|
MessageID int `json:"message_id"`
|
|
}
|
|
|
|
// DirectMessageTopic represents a forum topic in a direct message.
|
|
// Since: Bot API 9.2
|
|
type DirectMessageTopic struct {
|
|
// TopicID Unique identifier of the topic. This number may have more than 32 significant bits and some
|
|
// programming languages may have difficulty/silent defects in interpreting it. But it has at most 52
|
|
// significant bits, so a 64-bit integer or double-precision float type are safe for storing this
|
|
// identifier.
|
|
TopicID int64 `json:"topic_id"`
|
|
// User is the user associated with the direct-message topic when available.
|
|
User *User `json:"user,omitempty"`
|
|
}
|
|
|
|
// MessageOriginType represents the type of a message origin.
|
|
type MessageOriginType string
|
|
|
|
const (
|
|
// MessageOriginUserType identifies a known user origin.
|
|
MessageOriginUserType = "user"
|
|
// MessageOriginHiddenUserType identifies a hidden user origin.
|
|
MessageOriginHiddenUserType = "hidden_user"
|
|
// MessageOriginChatType identifies a chat origin.
|
|
MessageOriginChatType = "chat"
|
|
// MessageOriginChannel identifies a channel origin.
|
|
MessageOriginChannel = "channel"
|
|
)
|
|
|
|
// MessageOrigin describes the origin of a message.
|
|
// Since: Bot API 7.0
|
|
type MessageOrigin struct {
|
|
// Type identifies the concrete message-origin variant.
|
|
Type MessageOriginType `json:"type"`
|
|
// Date Date the message was sent originally in Unix time
|
|
Date int64 `json:"date"`
|
|
|
|
// SenderUser User that sent the message originally
|
|
SenderUser *User `json:"sender_user,omitempty"`
|
|
|
|
// SenderUserName Name of the user that sent the message originally
|
|
SenderUserName string `json:"sender_user_name,omitempty"`
|
|
|
|
// SenderChat Chat that sent the message originally
|
|
SenderChat *Chat `json:"sender_chat,omitempty"`
|
|
|
|
// Chat Channel chat to which the message was originally sent
|
|
Chat *Chat `json:"chat,omitempty"`
|
|
// MessageID Unique message identifier inside the chat
|
|
MessageID int `json:"message_id"`
|
|
|
|
// AuthorSignature is the original author's signature for channel messages.
|
|
AuthorSignature string `json:"author_signature,omitempty"`
|
|
}
|
|
|
|
// ExternalReplyInfo contains information about a message that is being replied to.
|
|
// Since: Bot API 7.0
|
|
type ExternalReplyInfo struct {
|
|
// Origin Origin of the message replied to by the given message
|
|
Origin MessageOrigin `json:"origin"`
|
|
// Chat Optional. Chat the original message belongs to. Available only if the chat is a supergroup or a
|
|
// channel.
|
|
Chat *Chat `json:"chat,omitempty"`
|
|
// MessageID Optional. Unique message identifier inside the original chat. Available only if the original
|
|
// chat is a supergroup or a channel.
|
|
MessageID int `json:"message_id,omitempty"`
|
|
// LinkPreviewOptions Optional. Options used for link preview generation for the original message, if it is
|
|
// a text message
|
|
LinkPreviewOptions *LinkPreviewOptions `json:"link_preview_options,omitempty"`
|
|
// Animation Optional. Message is an animation, information about the animation
|
|
Animation *Animation `json:"animation,omitempty"`
|
|
// Audio Optional. Message is an audio file, information about the file
|
|
Audio *Audio `json:"audio,omitempty"`
|
|
// Document Optional. Message is a general file, information about the file
|
|
Document *Document `json:"document,omitempty"`
|
|
// PaidMedia Optional. Message contains paid media; information about the paid media
|
|
PaidMedia *PaidMediaInfo `json:"paid_media,omitempty"` // Since: Bot API 7.6
|
|
// Photo Optional. Message is a photo, available sizes of the photo
|
|
Photo []PhotoSize `json:"photo,omitempty"`
|
|
// LivePhoto Optional. Message is a live photo, information about the live photo
|
|
LivePhoto *LivePhoto `json:"live_photo,omitempty"` // Since: Bot API 10.0
|
|
// Sticker Optional. Message is a sticker, information about the sticker
|
|
Sticker *Sticker `json:"sticker,omitempty"`
|
|
// Story Optional. Message is a forwarded story
|
|
Story *Story `json:"story,omitempty"`
|
|
// Video Optional. Message is a video, information about the video
|
|
Video *Video `json:"video,omitempty"`
|
|
// VideoNote Optional. Message is a video note, information about the video message
|
|
VideoNote *VideoNote `json:"video_note,omitempty"`
|
|
// Voice Optional. Message is a voice message, information about the file
|
|
Voice *Voice `json:"voice,omitempty"`
|
|
// HasMediaSpoiler Optional. True, if the message media is covered by a spoiler animation
|
|
HasMediaSpoiler bool `json:"has_media_spoiler,omitempty"`
|
|
// Checklist Optional. Message is a checklist
|
|
Checklist *Checklist `json:"checklist,omitempty"` // Since: Bot API 9.1
|
|
// Contact Optional. Message is a shared contact, information about the contact
|
|
Contact *Contact `json:"contact,omitempty"`
|
|
// Dice Optional. Message is a dice with random value
|
|
Dice *Dice `json:"dice,omitempty"`
|
|
// Game Optional. Message is a game, information about the game. More about games »
|
|
Game *Game `json:"game,omitempty"`
|
|
// Giveaway Optional. Message is a scheduled giveaway, information about the giveaway
|
|
Giveaway *Giveaway `json:"giveaway,omitempty"`
|
|
// GiveawayWinners Optional. A giveaway with public winners was completed
|
|
GiveawayWinners *GiveawayWinners `json:"giveaway_winners,omitempty"`
|
|
// Invoice Optional. Message is an invoice for a payment, information about the invoice. More about payments
|
|
// »
|
|
Invoice *Invoice `json:"invoice,omitempty"`
|
|
// Location Optional. Message is a shared location, information about the location
|
|
Location *Location `json:"location,omitempty"`
|
|
// Poll Optional. Message is a native poll, information about the poll
|
|
Poll *Poll `json:"poll,omitempty"`
|
|
// Venue Optional. Message is a venue, information about the venue
|
|
Venue *Venue `json:"venue,omitempty"`
|
|
}
|
|
|
|
// TextQuote contains information about the quoted part of a message.
|
|
// Since: Bot API 7.0
|
|
type TextQuote struct {
|
|
// Text Text of the quoted part of a message that is replied to by the given message
|
|
Text string `json:"text"`
|
|
// Entities Optional. Special entities that appear in the quote. Currently, only bold, italic, underline,
|
|
// strikethrough, spoiler, custom_emoji, and date_time entities are kept in quotes.
|
|
Entities []MessageEntity `json:"entities"`
|
|
// Position Approximate quote position in the original message in UTF-16 code units as specified by the
|
|
// sender
|
|
Position int `json:"position"`
|
|
// IsManual Optional. True, if the quote was chosen manually by the message sender. Otherwise, the quote was
|
|
// added automatically by the server.
|
|
IsManual bool `json:"is_manual,omitempty"`
|
|
}
|
|
|
|
// MessageAutoDeleteTimerChanged represents a service message about a change in auto-delete timer settings.
|
|
// Since: Bot API 5.1
|
|
type MessageAutoDeleteTimerChanged struct {
|
|
// MessageAutoDeleteTime New auto-delete time for messages in the chat; in seconds
|
|
MessageAutoDeleteTime int `json:"message_auto_delete_time"`
|
|
}
|
|
|
|
// DirectMessagePriceChanged represents a service message about a change in the price of direct messages.
|
|
// Since: Bot API 9.1
|
|
type DirectMessagePriceChanged struct {
|
|
// AreDirectMessagesEnabled True, if direct messages are enabled for the channel chat; False otherwise
|
|
AreDirectMessagesEnabled bool `json:"are_direct_messages_enabled"`
|
|
// DirectMessageStarCount Optional. The new number of Telegram Stars that must be paid by users for each
|
|
// direct message sent to the channel. Does not apply to users who have been exempted by administrators.
|
|
// Defaults to 0.
|
|
DirectMessageStarCount int `json:"direct_message_star_count,omitempty"`
|
|
}
|
|
|
|
// PaidMessagePriceChanged represents a service message about a change in the price of paid messages.
|
|
// Since: Bot API 9.x
|
|
type PaidMessagePriceChanged struct {
|
|
// PaidMessageStarCount The new number of Telegram Stars that must be paid by non-administrator users of the
|
|
// supergroup chat for each sent message
|
|
PaidMessageStarCount int `json:"paid_message_star_count"`
|
|
}
|
|
|
|
// Message represents a Telegram message.
|
|
// Since: Bot API 1.0
|
|
// See https://core.telegram.org/bots/api#message
|
|
type Message struct {
|
|
// MessageID Unique message identifier inside this chat; 0 for ephemeral messages. In specific instances
|
|
// (e.g., a message containing a video sent to a big chat), the server might automatically schedule a
|
|
// message instead of sending it immediately. In such cases, this field will be 0 and the relevant message
|
|
// will be unusable until it is actually sent.
|
|
MessageID int `json:"message_id"`
|
|
// MessageThreadID Optional. Unique identifier of a message thread or forum topic to which the message
|
|
// belongs; for supergroups and private chats only
|
|
MessageThreadID int `json:"message_thread_id,omitempty"` // Since: Bot API 6.3
|
|
// DirectMessageTopic contains the direct-message topic associated with the message.
|
|
DirectMessageTopic *DirectMessageTopic `json:"direct_message_topic,omitempty"` // Since: Bot API 9.2
|
|
// From Optional. Sender of the message; may be empty for messages sent to channels. For backward
|
|
// compatibility, if the message was sent on behalf of a chat, the field contains a fake sender user in
|
|
// non-channel chats.
|
|
From *User `json:"from,omitempty"`
|
|
|
|
// SenderChat Optional. Sender of the message when sent on behalf of a chat. For example, the supergroup
|
|
// itself for messages sent by its anonymous administrators or a linked channel for messages automatically
|
|
// forwarded to the channel's discussion group. For backward compatibility, if the message was sent on
|
|
// behalf of a chat, the field from contains a fake sender user in non-channel chats.
|
|
SenderChat *Chat `json:"sender_chat,omitempty"` // Since: Bot API 5.0
|
|
// SenderBoostCount Optional. If the sender of the message boosted the chat, the number of boosts added by
|
|
// the user
|
|
SenderBoostCount int `json:"sender_boost_count,omitempty"` // Since: Bot API 7.1
|
|
// SenderBusinessBot Optional. The bot that actually sent the message on behalf of the business account.
|
|
// Available only for outgoing messages sent on behalf of the connected business account.
|
|
SenderBusinessBot *User `json:"sender_business_bot,omitempty"` // Since: Bot API 7.2
|
|
// SenderTag Optional. Tag or custom title of the sender of the message; for supergroups only
|
|
SenderTag string `json:"sender_tag,omitempty"` // Since: Bot API 9.5
|
|
// ReceiverUser identifies the user who can see the ephemeral message.
|
|
ReceiverUser *User `json:"receiver_user,omitempty"` // Since: Bot API 10.2
|
|
// EphemeralMessageID identifies the ephemeral message.
|
|
EphemeralMessageID int64 `json:"ephemeral_message_id,omitempty"` // Since: Bot API 10.2
|
|
// Date Date the message was sent in Unix time. It is always a positive number, representing a valid date.
|
|
Date int `json:"date"`
|
|
// GuestQueryID Optional. The unique identifier for the guest query. Use this identifier with the method
|
|
// answerGuestQuery to send a response message. If non-empty, the message belongs to the chat where the
|
|
// guest bot was summoned, which may not coincide with other existing bot chats sharing the same identifier.
|
|
GuestQueryID string `json:"guest_query_id,omitempty"` // Since: Bot API 10.0
|
|
// BusinessConnectionID Optional. Unique identifier of the business connection from which the message was
|
|
// received. If non-empty, the message belongs to a chat of the corresponding business account that is
|
|
// independent from any potential bot chat which might share the same identifier.
|
|
BusinessConnectionID string `json:"business_connection_id,omitempty"` // Since: Bot API 7.2
|
|
// Chat Chat the message belongs to
|
|
Chat *Chat `json:"chat,omitempty"`
|
|
// ForwardOrigin Optional. Information about the original message for forwarded messages
|
|
ForwardOrigin *MessageOrigin `json:"forward_origin,omitempty"` // Since: Bot API 7.0
|
|
|
|
// IsTopicMessage Optional. True, if the message is sent to a topic in a forum supergroup or a private chat
|
|
// with the bot
|
|
IsTopicMessage bool `json:"is_topic_message,omitempty"` // Since: Bot API 6.3
|
|
// IsAutomaticForward Optional. True, if the message is a channel post that was automatically forwarded to
|
|
// the connected discussion group
|
|
IsAutomaticForward bool `json:"is_automatic_forward,omitempty"` // Since: Bot API 5.5
|
|
// ReplyToMessage Optional. For replies in the same chat and message thread, the original message. Note that
|
|
// the Message object in this field will not contain further reply_to_message fields even if it itself is a
|
|
// reply. If the message is a reply to an ephemeral message, then this field may be omitted.
|
|
ReplyToMessage *Message `json:"reply_to_message,omitempty"`
|
|
// ExternalReply Optional. Information about the message that is being replied to, which may come from
|
|
// another chat or forum topic
|
|
ExternalReply *ExternalReplyInfo `json:"external_reply,omitempty"` // Since: Bot API 7.0
|
|
// Quote Optional. For replies that quote part of the original message, the quoted part of the message
|
|
Quote *TextQuote `json:"quote,omitempty"` // Since: Bot API 7.0
|
|
|
|
// ReplyToStory Optional. For replies to a story, the original story
|
|
ReplyToStory *Story `json:"reply_to_story,omitempty"` // Since: Bot API 7.1
|
|
// ReplyToChecklistTaskID Optional. Identifier of the specific checklist task that is being replied to
|
|
ReplyToChecklistTaskID int `json:"reply_to_checklist_task_id,omitempty"` // Since: Bot API 9.1
|
|
// ReplyToPollOptionID Optional. Persistent identifier of the specific poll option that is being replied to
|
|
ReplyToPollOptionID string `json:"reply_to_poll_option_id,omitempty"` // Since: Bot API 9.6
|
|
// ViaBot Optional. Bot through which the message was sent
|
|
ViaBot *User `json:"via_bot,omitempty"`
|
|
// GuestBotCallerUser Optional. For a message sent by a guest bot, this is the user whose original message
|
|
// triggered the bot's response
|
|
GuestBotCallerUser *User `json:"guest_bot_caller_user,omitempty"` // Since: Bot API 10.0
|
|
// GuestBotCallerChat Optional. For a message sent by a guest bot, this is the chat whose original message
|
|
// triggered the bot's response
|
|
GuestBotCallerChat *Chat `json:"guest_bot_caller_chat,omitempty"` // Since: Bot API 10.0
|
|
// EditDate Optional. Date the message was last edited in Unix time
|
|
EditDate int `json:"edit_date,omitempty"` // Since: Bot API 2.1
|
|
// HasProtectedContent Optional. True, if the message can't be forwarded
|
|
HasProtectedContent bool `json:"has_protected_content,omitempty"` // Since: Bot API 5.5
|
|
// IsFromOffline Optional. True, if the message was sent by an implicit action, for example, as an away or a
|
|
// greeting business message, or as a scheduled message
|
|
IsFromOffline bool `json:"is_from_offline,omitempty"` // Since: Bot API 7.2
|
|
// IsPaidPost Optional. True, if the message is a paid post. Note that such posts must not be deleted for 24
|
|
// hours to receive the payment and can't be edited.
|
|
IsPaidPost bool `json:"is_paid_post,omitempty"` // Since: Bot API 9.1
|
|
// MediaGroupID Optional. The unique identifier inside this chat of a media message group this message
|
|
// belongs to
|
|
MediaGroupID string `json:"media_group_id,omitempty"` // Since: Bot API 3.5
|
|
// AuthorSignature Optional. Signature of the post author for messages in channels, or the custom title of
|
|
// an anonymous group administrator
|
|
AuthorSignature string `json:"author_signature,omitempty"`
|
|
// PaidStarCount Optional. The number of Telegram Stars that were paid by the sender of the message to send
|
|
// it
|
|
PaidStarCount int `json:"paid_star_count,omitempty"` // Since: Bot API 8.3
|
|
|
|
// Text Optional. For text messages, the actual UTF-8 text of the message
|
|
Text string `json:"text"`
|
|
// Entities Optional. For text messages, special entities like usernames, URLs, bot commands, etc. that
|
|
// appear in the text
|
|
Entities []MessageEntity `json:"entities,omitempty"`
|
|
// LinkPreviewOptions Optional. Options used for link preview generation for the message, if it is a text
|
|
// message and link preview options were changed
|
|
LinkPreviewOptions *LinkPreviewOptions `json:"link_preview_options,omitempty"`
|
|
// SuggestedPostInfo Optional. Information about suggested post parameters if the message is a suggested
|
|
// post in a channel direct messages chat. If the message is an approved or declined suggested post, then it
|
|
// can't be edited.
|
|
SuggestedPostInfo *SuggestedPostInfo `json:"suggested_post_info,omitempty"` // Since: Bot API 9.1
|
|
// EffectID Optional. Unique identifier of the message effect added to the message
|
|
EffectID string `json:"effect_id,omitempty"` // Since: Bot API 7.4
|
|
|
|
// RichMessage contains structured rich-message content.
|
|
RichMessage *RichMessage `json:"rich_message,omitempty"` // Since: Bot API 10.1
|
|
// Animation Optional. Message is an animation, information about the animation. For backward compatibility,
|
|
// when this field is set, the document field will also be set.
|
|
Animation *Animation `json:"animation,omitempty"` // Since: Bot API 4.0
|
|
// Audio Optional. Message is an audio file, information about the file
|
|
Audio *Audio `json:"audio,omitempty"`
|
|
// Document Optional. Message is a general file, information about the file
|
|
Document *Document `json:"document,omitempty"`
|
|
// PaidMedia Optional. Message contains paid media; information about the paid media
|
|
PaidMedia *PaidMediaInfo `json:"paid_media,omitempty"` // Since: Bot API 7.6
|
|
// Photo Optional. Message is a photo, available sizes of the photo
|
|
Photo extypes.Slice[PhotoSize] `json:"photo,omitempty"`
|
|
// LivePhoto Optional. Message is a live photo, information about the live photo. For backward
|
|
// compatibility, when this field is set, the photo field will also be set.
|
|
LivePhoto *LivePhoto `json:"live_photo,omitempty"` // Since: Bot API 10.0
|
|
// Sticker Optional. Message is a sticker, information about the sticker
|
|
Sticker *Sticker `json:"sticker,omitempty"`
|
|
// Story Optional. Message is a forwarded story
|
|
Story *Story `json:"story,omitempty"`
|
|
// Video Optional. Message is a video, information about the video
|
|
Video *Video `json:"video,omitempty"`
|
|
// VideoNote Optional. Message is a video note, information about the video message
|
|
VideoNote *VideoNote `json:"video_note,omitempty"` // Since: Bot API 3.0
|
|
// Voice Optional. Message is a voice message, information about the file
|
|
Voice *Voice `json:"voice,omitempty"` // Since: Bot API 1.2
|
|
// Caption Optional. Caption for the animation, audio, document, paid media, photo, video or voice
|
|
Caption string `json:"caption,omitempty"` // Since: Bot API 3.4
|
|
// CaptionEntities Optional. For messages with a caption, special entities like usernames, URLs, bot
|
|
// commands, etc. that appear in the caption
|
|
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` // Since: Bot API 3.4
|
|
// ShowCaptionAboveMedia Optional. True, if the caption must be shown above the message media
|
|
ShowCaptionAboveMedia bool `json:"show_caption_above_media,omitempty"` // Since: Bot API 7.4
|
|
// HasMediaSpoiler Optional. True, if the message media is covered by a spoiler animation
|
|
HasMediaSpoiler bool `json:"has_media_spoiler,omitempty"` // Since: Bot API 6.4
|
|
// Checklist Optional. Message is a checklist
|
|
Checklist *Checklist `json:"checklist,omitempty"` // Since: Bot API 9.1
|
|
// Contact Optional. Message is a shared contact, information about the contact
|
|
Contact *Contact `json:"contact,omitempty"`
|
|
// Dice Optional. Message is a dice with random value
|
|
Dice *Dice `json:"dice,omitempty"`
|
|
// Game Optional. Message is a game, information about the game. More about games »
|
|
Game *Game `json:"game,omitempty"`
|
|
// Poll Optional. Message is a native poll, information about the poll
|
|
Poll *Poll `json:"poll,omitempty"`
|
|
// Venue Optional. Message is a venue, information about the venue. For backward compatibility, when this
|
|
// field is set, the location field will also be set.
|
|
Venue *Venue `json:"venue,omitempty"`
|
|
// Location Optional. Message is a shared location, information about the location
|
|
Location *Location `json:"location,omitempty"`
|
|
|
|
// NewChatMembers Optional. New members that were added to the group or supergroup and information about
|
|
// them (the bot itself may be one of these members)
|
|
NewChatMembers []User `json:"new_chat_members,omitempty"`
|
|
// LeftChatMember Optional. A member was removed from the group, information about them (this member may be
|
|
// the bot itself)
|
|
LeftChatMember *User `json:"left_chat_member,omitempty"`
|
|
// ChatOwnerLeft Optional. Service message: chat owner has left
|
|
ChatOwnerLeft *ChatOwnerLeft `json:"chat_owner_left,omitempty"`
|
|
// ChatOwnerChanged Optional. Service message: chat owner has changed
|
|
ChatOwnerChanged *ChatOwnerChanged `json:"chat_owner_changed,omitempty"`
|
|
// NewChatTitle Optional. A chat title was changed to this value
|
|
NewChatTitle string `json:"new_chat_title,omitempty"`
|
|
// NewChatPhoto Optional. A chat photo was change to this value
|
|
NewChatPhoto []PhotoSize `json:"new_chat_photo,omitempty"`
|
|
// DeleteChatPhoto Optional. Service message: the chat photo was deleted
|
|
DeleteChatPhoto bool `json:"delete_chat_photo,omitempty"`
|
|
// GroupChatCreated Optional. Service message: the group has been created
|
|
GroupChatCreated bool `json:"group_chat_created,omitempty"`
|
|
// SupergroupChatCreated Optional. Service message: the supergroup has been created. This field can't be
|
|
// received in a message coming through updates, because bot can't be a member of a supergroup when it is
|
|
// created. It can only be found in reply_to_message if someone replies to a very first message in a
|
|
// directly created supergroup.
|
|
SupergroupChatCreated bool `json:"supergroup_chat_created,omitempty"`
|
|
// ChannelChatCreated Optional. Service message: the channel has been created. This field can't be received
|
|
// in a message coming through updates, because bot can't be a member of a channel when it is created. It
|
|
// can only be found in reply_to_message if someone replies to a very first message in a channel.
|
|
ChannelChatCreated bool `json:"channel_chat_created,omitempty"`
|
|
// MessageAutoDeleteTimerChanged Optional. Service message: auto-delete timer settings changed in the chat
|
|
MessageAutoDeleteTimerChanged *MessageAutoDeleteTimerChanged `json:"message_auto_delete_timer_changed,omitempty"` // Since: Bot API 5.1
|
|
// MigrateToChatID Optional. The group has been migrated to a supergroup with the specified identifier. This
|
|
// number may have more than 32 significant bits and some programming languages may have difficulty/silent
|
|
// defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or
|
|
// double-precision float type are safe for storing this identifier.
|
|
MigrateToChatID int64 `json:"migrate_to_chat_id,omitempty"`
|
|
// MigrateFromChatID Optional. The supergroup has been migrated from a group with the specified identifier.
|
|
// This number may have more than 32 significant bits and some programming languages may have
|
|
// difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit
|
|
// integer or double-precision float type are safe for storing this identifier.
|
|
MigrateFromChatID int64 `json:"migrate_from_chat_id,omitempty"`
|
|
// PinnedMessage Optional. Specified message was pinned. Note that the Message object in this field will not
|
|
// contain further reply_to_message fields even if it itself is a reply.
|
|
PinnedMessage *MaybeInaccessibleMessage `json:"pinned_message,omitempty"`
|
|
|
|
// Invoice Optional. Message is an invoice for a payment, information about the invoice. More about payments
|
|
// »
|
|
Invoice *Invoice `json:"invoice,omitempty"` // Since: Bot API 3.0
|
|
// SuccessfulPayment Optional. Message is a service message about a successful payment, information about
|
|
// the payment. More about payments »
|
|
SuccessfulPayment *SuccessfulPayment `json:"successful_payment,omitempty"` // Since: Bot API 3.0
|
|
// RefundedPayment Optional. Message is a service message about a refunded payment, information about the
|
|
// payment. More about payments »
|
|
RefundedPayment *RefundedPayment `json:"refunded_payment,omitempty"` // Since: Bot API 7.7
|
|
// UsersShared Optional. Service message: users were shared with the bot
|
|
UsersShared *UsersShared `json:"users_shared,omitempty"` // Since: Bot API 6.5
|
|
// ChatShared Optional. Service message: a chat was shared with the bot
|
|
ChatShared *ChatShared `json:"chat_shared,omitempty"` // Since: Bot API 6.5
|
|
// Gift Optional. Service message: a regular gift was sent or received
|
|
Gift *GiftInfo `json:"gift,omitempty"` // Since: Bot API 9.0
|
|
// UniqueGift Optional. Service message: a unique gift was sent or received
|
|
UniqueGift *UniqueGiftInfo `json:"unique_gift,omitempty"` // Since: Bot API 9.0
|
|
// GiftUpgradeSent Optional. Service message: upgrade of a gift was purchased after the gift was sent
|
|
GiftUpgradeSent *GiftInfo `json:"gift_upgrade_sent,omitempty"` // Since: Bot API 9.3
|
|
|
|
// ConnectedWebsite Optional. The domain name of the website on which the user has logged in. More about
|
|
// Telegram Login »
|
|
ConnectedWebsite string `json:"connected_website,omitempty"`
|
|
// WriteAccessAllowed Optional. Service message: the user allowed the bot to write messages after adding it
|
|
// to the attachment or side menu, launching a Web App from a link, or accepting an explicit request from a
|
|
// Web App sent by the method requestWriteAccess
|
|
WriteAccessAllowed *WriteAccessAllowed `json:"write_access_allowed,omitempty"` // Since: Bot API 6.4
|
|
// PassportData Optional. Telegram Passport data
|
|
PassportData *PassportData `json:"passport_data,omitempty"`
|
|
// ProximityAlertTriggered Optional. Service message: a user in the chat triggered another user's proximity
|
|
// alert while sharing Live Location
|
|
ProximityAlertTriggered *ProximityAlertTriggered `json:"proximity_alert_triggered,omitempty"` // Since: Bot API 5.0
|
|
// BoostAdded Optional. Service message: user boosted the chat
|
|
BoostAdded *ChatBoostAdded `json:"boost_added,omitempty"` // Since: Bot API 7.1
|
|
// ChatBackgroundSet Optional. Service message: chat background set
|
|
ChatBackgroundSet *ChatBackground `json:"chat_background_set,omitempty"` // Since: Bot API 7.5
|
|
|
|
// ChecklistTaskDone contains checklist task completion data for the service message.
|
|
ChecklistTaskDone *ChecklistTaskDone `json:"checklist_task_done,omitempty"` // Since: Bot API 9.1
|
|
// ChecklistTasksAdded Optional. Service message: tasks were added to a checklist
|
|
ChecklistTasksAdded *ChecklistTasksAdded `json:"checklist_tasks_added,omitempty"` // Since: Bot API 9.1
|
|
// CommunityChatAdded describes a community chat addition service message.
|
|
CommunityChatAdded *CommunityChatAdded `json:"community_chat_added,omitempty"` // Since: Bot API 10.2
|
|
// CommunityChatRemoved describes a community chat removal service message.
|
|
CommunityChatRemoved *CommunityChatRemoved `json:"community_chat_removed,omitempty"` // Since: Bot API 10.2
|
|
// DirectMessagePriceChanged Optional. Service message: the price for paid messages in the corresponding
|
|
// direct messages chat of a channel has changed
|
|
DirectMessagePriceChanged *DirectMessagePriceChanged `json:"direct_message_price_changed,omitempty"` // Since: Bot API 9.1
|
|
// PaidMessagePriceChanged Optional. Service message: the price for paid messages has changed in the chat
|
|
PaidMessagePriceChanged *PaidMessagePriceChanged `json:"paid_message_price_changed,omitempty"` // Since: Bot API 9.x
|
|
// ForumTopicCreated Optional. Service message: forum topic created
|
|
ForumTopicCreated *ForumTopicCreated `json:"forum_topic_created,omitempty"` // Since: Bot API 6.3
|
|
// ForumTopicEdited Optional. Service message: forum topic edited
|
|
ForumTopicEdited *ForumTopicEdited `json:"forum_topic_edited,omitempty"` // Since: Bot API 6.4
|
|
// ForumTopicClosed Optional. Service message: forum topic closed
|
|
ForumTopicClosed *ForumTopicClosed `json:"forum_topic_closed,omitempty"` // Since: Bot API 6.3
|
|
// ForumTopicReopened Optional. Service message: forum topic reopened
|
|
ForumTopicReopened *ForumTopicReopened `json:"forum_topic_reopened,omitempty"` // Since: Bot API 6.3
|
|
// GeneralForumTopicHidden Optional. Service message: the 'General' forum topic hidden
|
|
GeneralForumTopicHidden *GeneralForumTopicHidden `json:"general_forum_topic_hidden,omitempty"` // Since: Bot API 6.4
|
|
// GeneralForumTopicUnhidden Optional. Service message: the 'General' forum topic unhidden
|
|
GeneralForumTopicUnhidden *GeneralForumTopicUnhidden `json:"general_forum_topic_unhidden,omitempty"` // Since: Bot API 6.4
|
|
|
|
// GiveawayCreated Optional. Service message: a scheduled giveaway was created
|
|
GiveawayCreated *GiveawayCreated `json:"giveaway_created,omitempty"` // Since: Bot API 7.0
|
|
// Giveaway Optional. The message is a scheduled giveaway message
|
|
Giveaway *Giveaway `json:"giveaway,omitempty"` // Since: Bot API 7.0
|
|
// GiveawayWinners Optional. A giveaway with public winners was completed
|
|
GiveawayWinners *GiveawayWinners `json:"giveaway_winners,omitempty"` // Since: Bot API 7.0
|
|
// GiveawayCompleted Optional. Service message: a giveaway without public winners was completed
|
|
GiveawayCompleted *GiveawayCompleted `json:"giveaway_completed,omitempty"` // Since: Bot API 7.0
|
|
|
|
// ManagedBotCreated Optional. Service message: user created a bot that will be managed by the current bot
|
|
ManagedBotCreated *ManagedBotCreated `json:"managed_bot_created,omitempty"` // Since: Bot API 9.6
|
|
// PollOptionAdded Optional. Service message: answer option was added to a poll
|
|
PollOptionAdded *PollOptionAdded `json:"poll_option_added,omitempty"` // Since: Bot API 9.6
|
|
// PollOptionDeleted Optional. Service message: answer option was deleted from a poll
|
|
PollOptionDeleted *PollOptionDeleted `json:"poll_option_deleted,omitempty"` // Since: Bot API 9.6
|
|
|
|
// SuggestedPostApproved Optional. Service message: a suggested post was approved
|
|
SuggestedPostApproved *SuggestedPostApproved `json:"suggested_post_approved,omitempty"` // Since: Bot API 9.1
|
|
// SuggestedPostApprovalFailed Optional. Service message: approval of a suggested post has failed
|
|
SuggestedPostApprovalFailed *SuggestedPostApprovalFailed `json:"suggested_post_approval_failed,omitempty"` // Since: Bot API 9.1
|
|
// SuggestedPostDeclined Optional. Service message: a suggested post was declined
|
|
SuggestedPostDeclined *SuggestedPostDeclined `json:"suggested_post_declined,omitempty"` // Since: Bot API 9.1
|
|
// SuggestedPostPaid Optional. Service message: payment for a suggested post was received
|
|
SuggestedPostPaid *SuggestedPostPaid `json:"suggested_post_paid,omitempty"` // Since: Bot API 9.1
|
|
// SuggestedPostRefunded Optional. Service message: payment for a suggested post was refunded
|
|
SuggestedPostRefunded *SuggestedPostRefunded `json:"suggested_post_refunded,omitempty"` // Since: Bot API 9.1
|
|
|
|
// VideoChatScheduled Optional. Service message: video chat scheduled
|
|
VideoChatScheduled *VideoChatScheduled `json:"video_chat_scheduled,omitempty"` // Since: Bot API 6.0
|
|
// VideoChatStarted Optional. Service message: video chat started
|
|
VideoChatStarted *VideoChatStarted `json:"video_chat_started,omitempty"` // Since: Bot API 5.1
|
|
// VideoChatEnded Optional. Service message: video chat ended
|
|
VideoChatEnded *VideoChatEnded `json:"video_chat_ended,omitempty"` // Since: Bot API 5.1
|
|
// VideoChatParticipantsInvited Optional. Service message: new participants invited to a video chat
|
|
VideoChatParticipantsInvited *VideoChatParticipantsInvited `json:"video_chat_participants_invited,omitempty"` // Since: Bot API 5.1
|
|
|
|
// WebAppData Optional. Service message: data sent by a Web App
|
|
WebAppData *WebAppData `json:"web_app_data,omitempty"` // Since: Bot API 6.0
|
|
// ReplyMarkup Optional. Inline keyboard attached to the message. login_url buttons are represented as
|
|
// ordinary url buttons.
|
|
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Since: Bot API 4.3
|
|
}
|
|
|
|
// InaccessibleMessage describes a message that was deleted or is otherwise inaccessible.
|
|
// Since: Bot API 7.0
|
|
// See https://core.telegram.org/bots/api#inaccessiblemessage
|
|
type InaccessibleMessage struct {
|
|
// Chat Chat the message belonged to
|
|
Chat Chat `json:"chat"`
|
|
// MessageID Unique message identifier inside the chat
|
|
MessageID int `json:"message_id"`
|
|
// Date Always 0. The field can be used to differentiate regular and inaccessible messages.
|
|
Date int `json:"date"`
|
|
}
|
|
|
|
// MaybeInaccessibleMessage is a union type that can be either Message or InaccessibleMessage.
|
|
// Since: Bot API 7.0
|
|
// See https://core.telegram.org/bots/api#maybeinaccessiblemessage
|
|
type MaybeInaccessibleMessage struct {
|
|
msg *Message
|
|
ina *InaccessibleMessage
|
|
}
|
|
|
|
// UnmarshalJSON decodes either an accessible Message or an InaccessibleMessage.
|
|
func (m *MaybeInaccessibleMessage) UnmarshalJSON(data []byte) error {
|
|
tmp := struct {
|
|
Date int `json:"date"`
|
|
}{}
|
|
if err := json.Unmarshal(data, &tmp); err != nil {
|
|
return err
|
|
}
|
|
var err error
|
|
if tmp.Date > 0 {
|
|
err = json.Unmarshal(data, &m.msg)
|
|
} else {
|
|
err = json.Unmarshal(data, &m.ina)
|
|
}
|
|
if err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON encodes the populated accessible or inaccessible message payload.
|
|
func (m *MaybeInaccessibleMessage) MarshalJSON() ([]byte, error) {
|
|
if m.msg != nil {
|
|
return json.Marshal(m.msg)
|
|
} else if m.ina != nil {
|
|
return json.Marshal(m.ina)
|
|
}
|
|
return json.Marshal(nil)
|
|
}
|
|
|
|
// Message returns the accessible message payload when present.
|
|
func (m *MaybeInaccessibleMessage) Message() *Message {
|
|
return m.msg
|
|
}
|
|
|
|
// InaccessibleMessage returns the inaccessible message payload when present.
|
|
func (m *MaybeInaccessibleMessage) InaccessibleMessage() *InaccessibleMessage {
|
|
return m.ina
|
|
}
|
|
|
|
// IsAccessible reports whether the payload is an accessible message.
|
|
func (m *MaybeInaccessibleMessage) IsAccessible() bool {
|
|
return m.msg != nil
|
|
}
|
|
|
|
// IsInaccessible reports whether the payload is an inaccessible message.
|
|
func (m *MaybeInaccessibleMessage) IsInaccessible() bool {
|
|
return m.ina != nil
|
|
}
|
|
|
|
// MessageID returns the message identifier from either payload form.
|
|
func (m *MaybeInaccessibleMessage) MessageID() int {
|
|
if m.IsAccessible() {
|
|
return m.msg.MessageID
|
|
} else if m.IsInaccessible() {
|
|
return m.ina.MessageID
|
|
}
|
|
return 0
|
|
}
|
|
|
|
// Chat returns the chat from either payload form.
|
|
func (m *MaybeInaccessibleMessage) Chat() *Chat {
|
|
if m.IsAccessible() {
|
|
return m.msg.Chat
|
|
} else if m.IsInaccessible() {
|
|
return &m.ina.Chat
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// MessageEntityType represents the type of a message entity.
|
|
type MessageEntityType string
|
|
|
|
const (
|
|
// MessageEntityMention identifies an @mention entity.
|
|
MessageEntityMention MessageEntityType = "mention"
|
|
// MessageEntityHashtag identifies a hashtag entity.
|
|
MessageEntityHashtag MessageEntityType = "hashtag"
|
|
// MessageEntityCashtag identifies a cashtag entity.
|
|
MessageEntityCashtag MessageEntityType = "cashtag"
|
|
// MessageEntityBotCommand identifies a bot command entity.
|
|
MessageEntityBotCommand MessageEntityType = "bot_command"
|
|
// MessageEntityURL identifies a URL entity.
|
|
MessageEntityURL MessageEntityType = "url"
|
|
// MessageEntityEmail identifies an email entity.
|
|
MessageEntityEmail MessageEntityType = "email"
|
|
// MessageEntityPhoneNumber identifies a phone number entity.
|
|
MessageEntityPhoneNumber MessageEntityType = "phone_number"
|
|
// MessageEntityBold identifies bold text.
|
|
MessageEntityBold MessageEntityType = "bold"
|
|
// MessageEntityItalic identifies italic text.
|
|
MessageEntityItalic MessageEntityType = "italic"
|
|
// MessageEntityUnderline identifies underlined text.
|
|
MessageEntityUnderline MessageEntityType = "underline"
|
|
// MessageEntityStrike identifies strikethrough text.
|
|
MessageEntityStrike MessageEntityType = "strikethrough"
|
|
// MessageEntitySpoiler identifies spoiler text.
|
|
MessageEntitySpoiler MessageEntityType = "spoiler" // Since: Bot API 5.6
|
|
// MessageEntityBlockquote identifies a blockquote entity.
|
|
MessageEntityBlockquote MessageEntityType = "blockquote"
|
|
// MessageEntityExpandableBlockquote identifies an expandable blockquote entity.
|
|
MessageEntityExpandableBlockquote MessageEntityType = "expandable_blockquote" // Since: Bot API 7.5
|
|
// MessageEntityCode identifies inline code.
|
|
MessageEntityCode MessageEntityType = "code"
|
|
// MessageEntityPre identifies a preformatted block.
|
|
MessageEntityPre MessageEntityType = "pre"
|
|
// MessageEntityTextLink identifies linked text.
|
|
MessageEntityTextLink MessageEntityType = "text_link"
|
|
// MessageEntityTextMention identifies a text mention.
|
|
MessageEntityTextMention MessageEntityType = "text_mention"
|
|
// MessageEntityCustomEmoji identifies a custom emoji entity.
|
|
MessageEntityCustomEmoji MessageEntityType = "custom_emoji" // Since: Bot API 6.2
|
|
// MessageEntityDateTime identifies a date-time entity.
|
|
MessageEntityDateTime MessageEntityType = "date_time" // Since: Bot API 9.5
|
|
)
|
|
|
|
// MessageEntity represents one special entity in a text message.
|
|
// Since: Bot API 2.0
|
|
// See https://core.telegram.org/bots/api#messageentity
|
|
type MessageEntity struct {
|
|
// Type Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag or
|
|
// #hashtag@chatusername), “cashtag” ($USD or $USD@chatusername), “bot_command” (/start@jobs_bot),
|
|
// “url” (https://telegram.org), “email” (do-not-reply@telegram.org), “phone_number”
|
|
// (+1-212-555-0123), “bold” (bold text), “italic” (italic text), “underline” (underlined text),
|
|
// “strikethrough” (strikethrough text), “spoiler” (spoiler message), “blockquote” (block
|
|
// quotation), “expandable_blockquote” (collapsed-by-default block quotation), “code” (monowidth
|
|
// string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for
|
|
// users without usernames), “custom_emoji” (for inline custom emoji stickers), or “date_time” (for
|
|
// formatted date and time).
|
|
Type MessageEntityType `json:"type"`
|
|
|
|
// Offset Offset in UTF-16 code units to the start of the entity
|
|
Offset int `json:"offset"`
|
|
// Length Length of the entity in UTF-16 code units
|
|
Length int `json:"length"`
|
|
// URL Optional. For “text_link” only, URL that will be opened after user taps on the text
|
|
URL string `json:"url,omitempty"`
|
|
// User Optional. For “text_mention” only, the mentioned user
|
|
User *User `json:"user,omitempty"`
|
|
// Language Optional. For “pre” only, the programming language of the entity text
|
|
Language string `json:"language,omitempty"`
|
|
// CustomEmojiID Optional. For “custom_emoji” only, unique identifier of the custom emoji. Use
|
|
// getCustomEmojiStickers to get full information about the sticker.
|
|
CustomEmojiID string `json:"custom_emoji_id,omitempty"` // Since: Bot API 6.2
|
|
|
|
// UnixTime Optional. For “date_time” only, the Unix time associated with the entity
|
|
UnixTime int64 `json:"unix_time,omitempty"`
|
|
// DateTimeFormat Optional. For “date_time” only, the string that defines the formatting of the date and
|
|
// time. See date-time entity formatting for more details.
|
|
DateTimeFormat string `json:"date_time_format,omitempty"` // Since: Bot API 9.5
|
|
}
|
|
|
|
// ReplyParameters describes the parameters to use when replying to a message.
|
|
// Since: Bot API 7.0
|
|
// See https://core.telegram.org/bots/api#replyparameters
|
|
type ReplyParameters struct {
|
|
// MessageID Optional. Identifier of the message that will be replied to in the current chat, or in the chat
|
|
// chat_id if it is specified. Required if ephemeral_message_id isn't specified.
|
|
MessageID int `json:"message_id,omitempty"`
|
|
// ChatID Optional. If the message to be replied to is from a different chat, unique identifier for the chat
|
|
// or username of the bot, supergroup or channel in the format @username. Not supported for messages sent on
|
|
// behalf of a business account, messages from channel direct messages chats and ephemeral messages.
|
|
ChatID int64 `json:"chat_id,omitempty"`
|
|
// EphemeralMessageID identifies the ephemeral message.
|
|
EphemeralMessageID int64 `json:"ephemeral_message_id,omitempty"` // Since: Bot API 10.2
|
|
|
|
// AllowSendingWithoutReply Optional. Pass True if the message should be sent even if the specified message
|
|
// to be replied to is not found. Always False for replies in another chat or forum topic, and sent
|
|
// ephemeral messages. Always True for messages sent on behalf of a business account.
|
|
AllowSendingWithoutReply bool `json:"allow_sending_without_reply,omitempty"`
|
|
// Quote Optional. Quoted part of the message to be replied to; 0-1024 characters after entities parsing.
|
|
// The quote must be an exact substring of the message to be replied to, including bold, italic, underline,
|
|
// strikethrough, spoiler, custom_emoji, and date_time entities. The message will fail to send if the quote
|
|
// isn't found in the original message. Ignored for ephemeral messages.
|
|
Quote string `json:"quote,omitempty"`
|
|
// QuoteParsingMode Optional. Mode for parsing entities in the quote. See formatting options for more
|
|
// details.
|
|
// Subject to change in v2: the Go field name may be corrected to QuoteParseMode.
|
|
QuoteParsingMode string `json:"quote_parse_mode,omitempty"`
|
|
// QuoteEntities Optional. A JSON-serialized list of special entities that appear in the quote. It can be
|
|
// specified instead of quote_parse_mode.
|
|
QuoteEntities []MessageEntity `json:"quote_entities,omitempty"`
|
|
// QuotePosition Optional. Position of the quote in the original message in UTF-16 code units
|
|
QuotePosition int `json:"quote_position,omitempty"`
|
|
// ChecklistTaskID Optional. Identifier of the specific checklist task to be replied to
|
|
ChecklistTaskID int `json:"checklist_task_id,omitempty"`
|
|
// PollOptionID Optional. Persistent identifier of the specific poll option to be replied to
|
|
PollOptionID string `json:"poll_option_id,omitempty"`
|
|
}
|
|
|
|
// LinkPreviewOptions describes the options used for link preview generation.
|
|
// Since: Bot API 7.0
|
|
// See https://core.telegram.org/bots/api#linkpreviewoptions
|
|
type LinkPreviewOptions struct {
|
|
// IsDisabled Optional. True, if the link preview is disabled
|
|
IsDisabled bool `json:"is_disabled,omitempty"`
|
|
// URL Optional. URL to use for the link preview. If empty, then the first URL found in the message text
|
|
// will be used.
|
|
URL string `json:"url,omitempty"`
|
|
// PreferSmallMedia Optional. True, if the media in the link preview is supposed to be shrunk; ignored if
|
|
// the URL isn't explicitly specified or media size change isn't supported for the preview
|
|
PreferSmallMedia bool `json:"prefer_small_media,omitempty"`
|
|
// PreferLargeMedia Optional. True, if the media in the link preview is supposed to be enlarged; ignored if
|
|
// the URL isn't explicitly specified or media size change isn't supported for the preview
|
|
PreferLargeMedia bool `json:"prefer_large_media,omitempty"`
|
|
// ShowAboveText Optional. True, if the link preview must be shown above the message text; otherwise, the
|
|
// link preview will be shown below the message text
|
|
ShowAboveText bool `json:"show_above_text,omitempty"`
|
|
}
|
|
|
|
// ReplyMarkup represents a custom keyboard or inline keyboard.
|
|
// Since: Bot API 1.0
|
|
// See https://core.telegram.org/bots/api#replymarkup
|
|
type ReplyMarkup struct {
|
|
// InlineKeyboard Array of button rows, each represented by an Array of InlineKeyboardButton objects
|
|
InlineKeyboard [][]InlineKeyboardButton `json:"inline_keyboard,omitempty"`
|
|
|
|
// Keyboard Array of button rows, each represented by an Array of KeyboardButton objects
|
|
Keyboard [][]KeyboardButton `json:"keyboard,omitempty"`
|
|
// IsPersistent Optional. Requests clients to always show the keyboard when the regular keyboard is hidden.
|
|
// Defaults to False, in which case the custom keyboard can be hidden and opened with a keyboard icon.
|
|
IsPersistent bool `json:"is_persistent,omitempty"`
|
|
// ResizeKeyboard Optional. Requests clients to resize the keyboard vertically for optimal fit (e.g., make
|
|
// the keyboard smaller if there are just two rows of buttons). Defaults to False, in which case the custom
|
|
// keyboard is always of the same height as the app's standard keyboard.
|
|
ResizeKeyboard bool `json:"resize_keyboard,omitempty"`
|
|
// OneTimeKeyboard Optional. Requests clients to hide the keyboard as soon as it's been used. The keyboard
|
|
// will still be available, but clients will automatically display the usual letter-keyboard in the chat -
|
|
// the user can press a special button in the input field to see the custom keyboard again. Defaults to
|
|
// False.
|
|
OneTimeKeyboard bool `json:"one_time_keyboard,omitempty"`
|
|
// InputFieldPlaceholder is the placeholder shown in the input field while the keyboard is active.
|
|
InputFieldPlaceholder string `json:"input_field_placeholder,omitempty"`
|
|
// Selective limits the keyboard or reply interface to the targeted users.
|
|
Selective bool `json:"selective,omitempty"`
|
|
|
|
// RemoveKeyboard Requests clients to remove the custom keyboard (user will not be able to summon this
|
|
// keyboard; if you want to hide the keyboard from sight but keep it accessible, use one_time_keyboard in
|
|
// ReplyKeyboardMarkup)
|
|
RemoveKeyboard bool `json:"remove_keyboard,omitempty"`
|
|
|
|
// ForceReply Shows reply interface to the user, as if they manually selected the bot's message and tapped
|
|
// 'Reply'
|
|
ForceReply bool `json:"force_reply,omitempty"`
|
|
}
|
|
|
|
// InlineKeyboardMarkup represents an inline keyboard that appears right next to the message it belongs to.
|
|
// Since: Bot API 2.0
|
|
// See https://core.telegram.org/bots/api#inlinekeyboardmarkup
|
|
type InlineKeyboardMarkup struct {
|
|
// InlineKeyboard Array of button rows, each represented by an Array of InlineKeyboardButton objects
|
|
InlineKeyboard [][]InlineKeyboardButton `json:"inline_keyboard,omitempty"`
|
|
}
|
|
|
|
// KeyboardButtonStyle represents the style of a keyboard button.
|
|
type KeyboardButtonStyle string
|
|
|
|
const (
|
|
// KeyboardButtonStyleDanger marks a destructive keyboard button.
|
|
KeyboardButtonStyleDanger KeyboardButtonStyle = "danger"
|
|
// KeyboardButtonStyleSuccess marks a confirmatory keyboard button.
|
|
KeyboardButtonStyleSuccess KeyboardButtonStyle = "success"
|
|
// KeyboardButtonStylePrimary marks a primary keyboard button.
|
|
KeyboardButtonStylePrimary KeyboardButtonStyle = "primary"
|
|
)
|
|
|
|
// KeyboardButton represents one button of the reply keyboard.
|
|
// Since: Bot API 2.0
|
|
// See https://core.telegram.org/bots/api#keyboardbutton
|
|
type KeyboardButton struct {
|
|
// Text Text of the button. If none of the fields other than text, icon_custom_emoji_id, and style are used,
|
|
// it will be sent as a message when the button is pressed.
|
|
Text string `json:"text"`
|
|
// IconCustomEmojiID Optional. Unique identifier of the custom emoji shown before the text of the button.
|
|
// Can only be used by bots that purchased additional usernames on Fragment or in the messages directly sent
|
|
// by the bot to private, group and supergroup chats if the owner of the bot has a Telegram Premium
|
|
// subscription.
|
|
IconCustomEmojiID string `json:"icon_custom_emoji_id,omitempty"` // Since: Bot API 9.4
|
|
// Style Optional. Style of the button. Must be one of “danger” (red), “success” (green) or
|
|
// “primary” (blue). If omitted, then an app-specific style is used.
|
|
Style KeyboardButtonStyle `json:"style,omitempty"` // Since: Bot API 9.4
|
|
// RequestUsers Optional. If specified, pressing the button will open a list of suitable users. Identifiers
|
|
// of selected users will be sent to the bot in a “users_shared” service message. Available in private
|
|
// chats only.
|
|
RequestUsers *KeyboardButtonRequestUsers `json:"request_users,omitempty"` // Since: Bot API 7.0
|
|
// RequestChat Optional. If specified, pressing the button will open a list of suitable chats. Tapping on a
|
|
// chat will send its identifier to the bot in a “chat_shared” service message. Available in private
|
|
// chats only.
|
|
RequestChat *KeyboardButtonRequestChat `json:"request_chat,omitempty"` // Since: Bot API 6.5
|
|
// RequestManagedBot Optional. If specified, pressing the button will ask the user to create and share a bot
|
|
// that will be managed by the current bot. Available for bots that enabled management of other bots in the
|
|
// @BotFather Mini App. Available in private chats only.
|
|
RequestManagedBot *KeyboardButtonRequestManagedBot `json:"request_managed_bot,omitempty"` // Since: Bot API 9.6
|
|
// RequestContact Optional. If True, the user's phone number will be sent as a contact when the button is
|
|
// pressed. Available in private chats only.
|
|
RequestContact bool `json:"request_contact,omitempty"`
|
|
// RequestLocation Optional. If True, the user's current location will be sent when the button is pressed.
|
|
// Available in private chats only.
|
|
RequestLocation bool `json:"request_location,omitempty"`
|
|
// RequestPoll Optional. If specified, the user will be asked to create a poll and send it to the bot when
|
|
// the button is pressed. Available in private chats only.
|
|
RequestPoll *KeyboardButtonPollType `json:"request_poll,omitempty"` // Since: Bot API 4.6
|
|
// WebApp Optional. If specified, the described Web App will be launched when the button is pressed. The Web
|
|
// App will be able to send a “web_app_data” service message. Available in private chats only.
|
|
WebApp *WebAppInfo `json:"web_app,omitempty"` // Since: Bot API 6.0
|
|
}
|
|
|
|
// KeyboardButtonRequestUsers defines criteria used to request suitable users.
|
|
// Since: Bot API 7.0
|
|
// See https://core.telegram.org/bots/api#keyboardbuttonrequestusers
|
|
type KeyboardButtonRequestUsers struct {
|
|
// RequestID Signed 32-bit identifier of the request that will be received back in the UsersShared object.
|
|
// Must be unique within the message.
|
|
RequestID int `json:"request_id"`
|
|
// UserIsBot Optional. Pass True to request bots, pass False to request regular users. If not specified, no
|
|
// additional restrictions are applied.
|
|
UserIsBot *bool `json:"user_is_bot,omitempty"`
|
|
// UserIsPremium Optional. Pass True to request premium users, pass False to request non-premium users. If
|
|
// not specified, no additional restrictions are applied.
|
|
UserIsPremium *bool `json:"user_is_premium,omitempty"`
|
|
// MaxQuantity Optional. The maximum number of users to be selected; 1-10. Defaults to 1.
|
|
MaxQuantity int `json:"max_quantity,omitempty"`
|
|
// RequestName Optional. Pass True to request the users' first and last names
|
|
RequestName bool `json:"request_name,omitempty"`
|
|
// RequestUsername Optional. Pass True to request the users' usernames
|
|
RequestUsername bool `json:"request_username,omitempty"`
|
|
// RequestPhoto Optional. Pass True to request the users' photos
|
|
RequestPhoto bool `json:"request_photo,omitempty"`
|
|
}
|
|
|
|
// KeyboardButtonRequestChat defines criteria used to request a suitable chat.
|
|
// Since: Bot API 6.5
|
|
// See https://core.telegram.org/bots/api#keyboardbuttonrequestchat
|
|
type KeyboardButtonRequestChat struct {
|
|
// RequestID Signed 32-bit identifier of the request, which will be received back in the ChatShared object.
|
|
// Must be unique within the message.
|
|
RequestID int `json:"request_id"`
|
|
// ChatIsChannel Pass True to request a channel chat, pass False to request a group or a supergroup chat
|
|
ChatIsChannel bool `json:"chat_is_channel"`
|
|
// ChatIsForum Optional. Pass True to request a forum supergroup, pass False to request a non-forum chat. If
|
|
// not specified, no additional restrictions are applied.
|
|
ChatIsForum *bool `json:"chat_is_forum,omitempty"`
|
|
// ChatHasUsername Optional. Pass True to request a supergroup or a channel with a username, pass False to
|
|
// request a chat without a username. If not specified, no additional restrictions are applied.
|
|
ChatHasUsername *bool `json:"chat_has_username,omitempty"`
|
|
// ChatIsCreated Optional. Pass True to request a chat owned by the user. Otherwise, no additional
|
|
// restrictions are applied.
|
|
ChatIsCreated *bool `json:"chat_is_created,omitempty"`
|
|
// UserAdministratorRights Optional. A JSON-serialized object listing the required administrator rights of
|
|
// the user in the chat. The rights must be a superset of bot_administrator_rights. If not specified, no
|
|
// additional restrictions are applied.
|
|
UserAdministratorRights *ChatAdministratorRights `json:"user_administrator_rights,omitempty"`
|
|
// BotAdministratorRights Optional. A JSON-serialized object listing the required administrator rights of
|
|
// the bot in the chat. The rights must be a subset of user_administrator_rights. If not specified, no
|
|
// additional restrictions are applied.
|
|
BotAdministratorRights *ChatAdministratorRights `json:"bot_administrator_rights,omitempty"`
|
|
// BotIsMember Optional. Pass True to request a chat with the bot as a member. Otherwise, no additional
|
|
// restrictions are applied.
|
|
BotIsMember bool `json:"bot_is_member,omitempty"`
|
|
// RequestTitle Optional. Pass True to request the chat's title
|
|
RequestTitle bool `json:"request_title,omitempty"`
|
|
// RequestUsername Optional. Pass True to request the chat's username
|
|
RequestUsername bool `json:"request_username,omitempty"`
|
|
// RequestPhoto Optional. Pass True to request the chat's photo
|
|
RequestPhoto bool `json:"request_photo,omitempty"`
|
|
}
|
|
|
|
// KeyboardButtonRequestManagedBot defines criteria used to request a managed bot.
|
|
// Since: Bot API 9.6
|
|
// See https://core.telegram.org/bots/api#keyboardbuttonrequestmanagedbot
|
|
type KeyboardButtonRequestManagedBot struct {
|
|
// RequestID Signed 32-bit identifier of the request. Must be unique within the message.
|
|
RequestID int32 `json:"request_id"`
|
|
// SuggestedName Optional. Suggested name for the bot
|
|
SuggestedName string `json:"suggested_name,omitempty"`
|
|
// SuggestedUsername Optional. Suggested username for the bot
|
|
SuggestedUsername string `json:"suggested_username,omitempty"`
|
|
}
|
|
|
|
// KeyboardButtonPollType represents the type of a poll that may be created from a keyboard button.
|
|
// Since: Bot API 4.6
|
|
// See https://core.telegram.org/bots/api#keyboardbuttonpolltype
|
|
type KeyboardButtonPollType struct {
|
|
// Type Optional. If quiz is passed, the user will be allowed to create only polls in the quiz mode. If
|
|
// regular is passed, only regular polls will be allowed. Otherwise, the user will be allowed to create a
|
|
// poll of any type.
|
|
Type PollType `json:"type,omitempty"`
|
|
}
|
|
|
|
// InlineKeyboardButton represents one button of an inline keyboard.
|
|
// Since: Bot API 2.0
|
|
// See https://core.telegram.org/bots/api#inlinekeyboardbutton
|
|
type InlineKeyboardButton struct {
|
|
// Text Label text on the button
|
|
Text string `json:"text"`
|
|
// URL Optional. HTTP or tg:// URL to be opened when the button is pressed. Links tg://user?id=<user_id> can
|
|
// be used to mention a user by their identifier without using a username, if this is allowed by their
|
|
// privacy settings.
|
|
URL string `json:"url,omitempty"`
|
|
// CallbackData Optional. Data to be sent in a callback query to the bot when the button is pressed, 1-64
|
|
// bytes
|
|
CallbackData string `json:"callback_data,omitempty"`
|
|
// Style Optional. Style of the button. Must be one of “danger” (red), “success” (green) or
|
|
// “primary” (blue). If omitted, then an app-specific style is used.
|
|
Style KeyboardButtonStyle `json:"style,omitempty"` // Since: Bot API 9.4
|
|
// IconCustomEmojiID Optional. Unique identifier of the custom emoji shown before the text of the button.
|
|
// Can only be used by bots that purchased additional usernames on Fragment or in the messages directly sent
|
|
// by the bot to private, group and supergroup chats if the owner of the bot has a Telegram Premium
|
|
// subscription.
|
|
IconCustomEmojiID string `json:"icon_custom_emoji_id,omitempty"` // Since: Bot API 9.4
|
|
}
|
|
|
|
// ReplyKeyboardMarkup represents a custom keyboard with reply options.
|
|
// Since: Bot API 1.0
|
|
// See https://core.telegram.org/bots/api#replykeyboardmarkup
|
|
type ReplyKeyboardMarkup struct {
|
|
// Keyboard Array of button rows, each represented by an Array of KeyboardButton objects
|
|
Keyboard [][]KeyboardButton `json:"keyboard"`
|
|
// IsPersistent Optional. Requests clients to always show the keyboard when the regular keyboard is hidden.
|
|
// Defaults to False, in which case the custom keyboard can be hidden and opened with a keyboard icon.
|
|
IsPersistent bool `json:"is_persistent,omitempty"`
|
|
// ResizeKeyboard Optional. Requests clients to resize the keyboard vertically for optimal fit (e.g., make
|
|
// the keyboard smaller if there are just two rows of buttons). Defaults to False, in which case the custom
|
|
// keyboard is always of the same height as the app's standard keyboard.
|
|
ResizeKeyboard bool `json:"resize_keyboard,omitempty"`
|
|
// OneTimeKeyboard Optional. Requests clients to hide the keyboard as soon as it's been used. The keyboard
|
|
// will still be available, but clients will automatically display the usual letter-keyboard in the chat -
|
|
// the user can press a special button in the input field to see the custom keyboard again. Defaults to
|
|
// False.
|
|
OneTimeKeyboard bool `json:"one_time_keyboard,omitempty"`
|
|
// InputFieldPlaceholder Optional. The placeholder to be shown in the input field when the keyboard is
|
|
// active; 1-64 characters
|
|
InputFieldPlaceholder string `json:"input_field_placeholder,omitempty"`
|
|
// Selective Optional. Use this parameter if you want to show the keyboard to specific users only. Targets:
|
|
// 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply to a
|
|
// message in the same chat and forum topic, sender of the original message. Example: A user requests to
|
|
// change the bot's language, bot replies to the request with a keyboard to select the new language. Other
|
|
// users in the group don't see the keyboard.
|
|
Selective bool `json:"selective,omitempty"`
|
|
}
|
|
|
|
// CallbackQuery represents an incoming callback query from a callback button in an inline keyboard.
|
|
// Since: Bot API 2.0
|
|
// See https://core.telegram.org/bots/api#callbackquery
|
|
type CallbackQuery struct {
|
|
// ID Unique identifier for this query
|
|
ID string `json:"id"`
|
|
// From Sender
|
|
From User `json:"from"`
|
|
// Message Optional. Message sent by the bot with the callback button that originated the query
|
|
Message *Message `json:"message,omitempty"`
|
|
// InlineMessageID Optional. Identifier of the message sent via the bot in inline mode, that originated the
|
|
// query
|
|
InlineMessageID *string `json:"inline_message_id,omitempty"`
|
|
// ChatInstance Global identifier, uniquely corresponding to the chat to which the message with the callback
|
|
// button was sent. Useful for high scores in games.
|
|
ChatInstance string `json:"chat_instance,omitempty"`
|
|
// Data Optional. Data associated with the callback button. Be aware that the message originated the query
|
|
// can contain no callback buttons with this data.
|
|
Data string `json:"data,omitempty"`
|
|
// GameShortName Optional. Short name of a Game to be returned, serves as the unique identifier for the game
|
|
GameShortName string `json:"game_short_name,omitempty"`
|
|
}
|
|
|
|
// ChatActionType represents the type of chat action.
|
|
type ChatActionType string
|
|
|
|
const (
|
|
// ChatActionTyping tells Telegram the bot is typing.
|
|
ChatActionTyping ChatActionType = "typing"
|
|
// ChatActionUploadPhoto tells Telegram the bot is uploading a photo.
|
|
ChatActionUploadPhoto ChatActionType = "upload_photo"
|
|
// ChatActionUploadVideo tells Telegram the bot is uploading a video.
|
|
ChatActionUploadVideo ChatActionType = "upload_video"
|
|
// ChatActionUploadVoice tells Telegram the bot is uploading a voice message.
|
|
ChatActionUploadVoice ChatActionType = "upload_voice"
|
|
// ChatActionUploadDocument tells Telegram the bot is uploading a document.
|
|
ChatActionUploadDocument ChatActionType = "upload_document"
|
|
// ChatActionChooseSticker tells Telegram the bot is choosing a sticker.
|
|
ChatActionChooseSticker ChatActionType = "choose_sticker"
|
|
// ChatActionFindLocation tells Telegram the bot is finding a location.
|
|
ChatActionFindLocation ChatActionType = "find_location"
|
|
// ChatActionUploadVideoNote tells Telegram the bot is uploading a video note.
|
|
ChatActionUploadVideoNote ChatActionType = "upload_video_note"
|
|
// ChatActionUploadVideoNone is a deprecated alias for ChatActionUploadVideoNote.
|
|
ChatActionUploadVideoNone = ChatActionUploadVideoNote
|
|
)
|
|
|
|
// MessageReactionUpdated represents a change of a reaction on a message.
|
|
// Since: Bot API 7.0
|
|
// See https://core.telegram.org/bots/api#messagereactionupdated
|
|
type MessageReactionUpdated struct {
|
|
// Chat The chat containing the message the user reacted to
|
|
Chat *Chat `json:"chat"`
|
|
// MessageID Unique identifier of the message inside the chat
|
|
MessageID int `json:"message_id"`
|
|
// User Optional. The user that changed the reaction, if the user isn't anonymous
|
|
User *User `json:"user,omitempty"`
|
|
// ActorChat Optional. The chat on behalf of which the reaction was changed, if the user is anonymous
|
|
ActorChat *Chat `json:"actor_chat"`
|
|
// Date Date of the change in Unix time
|
|
Date int `json:"date"`
|
|
// OldReaction Previous list of reaction types that were set by the user
|
|
OldReaction []ReactionType `json:"old_reaction"`
|
|
// NewReaction New list of reaction types that have been set by the user
|
|
NewReaction []ReactionType `json:"new_reaction"`
|
|
}
|
|
|
|
// MessageReactionCountUpdated represents a change in the count of reactions on a message.
|
|
// Since: Bot API 7.0
|
|
// See https://core.telegram.org/bots/api#messagereactioncountupdated
|
|
type MessageReactionCountUpdated struct {
|
|
// Chat The chat containing the message
|
|
Chat *Chat `json:"chat"`
|
|
// MessageID Unique message identifier inside the chat
|
|
MessageID int `json:"message_id"`
|
|
// Date Date of the change in Unix time
|
|
Date int `json:"date"`
|
|
// Reactions List of reactions that are present on the message
|
|
Reactions []*ReactionCount `json:"reactions"`
|
|
}
|
|
|
|
// ReactionType describes the type of a reaction.
|
|
// Since: Bot API 7.0
|
|
// See https://core.telegram.org/bots/api#reactiontype
|
|
type ReactionType struct {
|
|
// Type identifies the emoji, custom_emoji, or paid reaction variant.
|
|
Type string `json:"type"`
|
|
// Emoji Reaction emoji. Currently, it can be one of "", "", "", "", "", "", "", "", "", "", "", "", "", "",
|
|
// "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
|
|
// "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
|
|
// "", "", "", "", "", "", "".
|
|
// ReactionTypeEmoji
|
|
Emoji *string `json:"emoji,omitempty"`
|
|
// CustomEmojiID Custom emoji identifier
|
|
// ReactionTypeCustomEmoji
|
|
CustomEmojiID *string `json:"custom_emoji_id,omitempty"`
|
|
}
|
|
|
|
// ReactionCount represents a reaction added to a message along with the number of times it was added.
|
|
// Since: Bot API 7.0
|
|
// See https://core.telegram.org/bots/api#reactioncount
|
|
type ReactionCount struct {
|
|
// Type Type of the reaction
|
|
Type ReactionType `json:"type"`
|
|
// TotalCount Number of times the reaction was added
|
|
TotalCount int `json:"total_count"`
|
|
}
|
|
|
|
// SuggestedPostPrice represents the price of a suggested post.
|
|
// Since: Bot API 9.1
|
|
type SuggestedPostPrice struct {
|
|
// Currency Currency in which the post will be paid. Currently, must be one of “XTR” for Telegram Stars
|
|
// or “TON” for TON grams.
|
|
Currency string `json:"currency"`
|
|
// Amount The amount of the currency that will be paid for the post in the smallest units of the currency,
|
|
// i.e. Telegram Stars or nanograms. Currently, price in Telegram Stars must be between 5 and 100000, and
|
|
// price in nanograms must be between 10000000 and 10000000000000.
|
|
Amount int `json:"amount"`
|
|
}
|
|
|
|
// SuggestedPostInfo contains information about a suggested post.
|
|
// Since: Bot API 9.1
|
|
// See https://core.telegram.org/bots/api#suggestedpostinfo
|
|
type SuggestedPostInfo struct {
|
|
// State State of the suggested post. Currently, it can be one of “pending”, “approved”,
|
|
// “declined”.
|
|
State string `json:"state"` // "pending", "approved", or "declined"
|
|
// Price Optional. Proposed price of the post. If the field is omitted, then the post is unpaid.
|
|
Price SuggestedPostPrice `json:"price"`
|
|
// SendDate Optional. Proposed send date of the post. If the field is omitted, then the post can be
|
|
// published at any time within 30 days at the sole discretion of the user or administrator who approves it.
|
|
SendDate int `json:"send_date"`
|
|
}
|
|
|
|
// SuggestedPostParameters holds parameters for suggesting a post.
|
|
// Since: Bot API 9.2
|
|
type SuggestedPostParameters struct {
|
|
// Price Optional. Proposed price for the post. If the field is omitted, then the post is unpaid.
|
|
Price SuggestedPostPrice `json:"price"`
|
|
// SendDate Optional. Proposed send date of the post. If specified, then the date must be between 300 second
|
|
// and 2678400 seconds (30 days) in the future. If the field is omitted, then the post can be published at
|
|
// any time within 30 days at the sole discretion of the user who approves it.
|
|
SendDate int `json:"send_date"`
|
|
}
|
|
|
|
// ManagedBotCreated describes a service message about a newly created managed bot.
|
|
// Since: Bot API 9.6
|
|
// See https://core.telegram.org/bots/api#managedbotcreated
|
|
type ManagedBotCreated struct {
|
|
// Bot Information about the bot. The bot's token can be fetched using the method getManagedBotToken.
|
|
Bot User `json:"bot"`
|
|
}
|
|
|
|
// ManagedBotUpdated describes an update about a managed bot and its manager.
|
|
// Since: Bot API 9.6
|
|
// See https://core.telegram.org/bots/api#managedbotupdated
|
|
type ManagedBotUpdated struct {
|
|
// User User that created the bot
|
|
User User `json:"user"`
|
|
// Bot Information about the bot. Token of the bot can be fetched using the method getManagedBotToken.
|
|
Bot User `json:"bot"`
|
|
}
|
|
|
|
// SharedUser represents a user shared via a KeyboardButtonRequestUsers button.
|
|
// Since: Bot API 7.2
|
|
type SharedUser struct {
|
|
// UserID Identifier of the shared user. This number may have more than 32 significant bits and some
|
|
// programming languages may have difficulty/silent defects in interpreting it. But it has at most 52
|
|
// significant bits, so 64-bit integers or double-precision float types are safe for storing these
|
|
// identifiers. The bot may not have access to the user and could be unable to use this identifier, unless
|
|
// the user is already known to the bot by some other means.
|
|
UserID int64 `json:"user_id"`
|
|
// FirstName Optional. First name of the user, if the name was requested by the bot
|
|
FirstName string `json:"first_name,omitempty"`
|
|
// LastName Optional. Last name of the user, if the name was requested by the bot
|
|
LastName string `json:"last_name,omitempty"`
|
|
// Username Optional. Username of the user, if the username was requested by the bot
|
|
Username string `json:"username,omitempty"`
|
|
// Photo Optional. Available sizes of the chat photo, if the photo was requested by the bot
|
|
Photo []PhotoSize `json:"photo,omitempty"`
|
|
}
|
|
|
|
// UsersShared represents a service message about users shared via a KeyboardButtonRequestUsers button.
|
|
// Since: Bot API 6.5
|
|
type UsersShared struct {
|
|
// RequestID Identifier of the request
|
|
RequestID int `json:"request_id"`
|
|
// Users Information about users shared with the bot
|
|
Users []SharedUser `json:"users"`
|
|
}
|
|
|
|
// ChatShared represents a service message about a chat shared via a KeyboardButtonRequestChat button.
|
|
// Since: Bot API 6.5
|
|
type ChatShared struct {
|
|
// RequestID Identifier of the request
|
|
RequestID int `json:"request_id"`
|
|
// ChatID Identifier of the shared chat. This number may have more than 32 significant bits and some
|
|
// programming languages may have difficulty/silent defects in interpreting it. But it has at most 52
|
|
// significant bits, so a 64-bit integer or double-precision float type are safe for storing this
|
|
// identifier. The bot may not have access to the chat and could be unable to use this identifier, unless
|
|
// the chat is already known to the bot by some other means.
|
|
ChatID int64 `json:"chat_id"`
|
|
// Title Optional. Title of the chat, if the title was requested by the bot
|
|
Title string `json:"title,omitempty"`
|
|
// Username Optional. Username of the chat, if the username was requested by the bot and available
|
|
Username string `json:"username,omitempty"`
|
|
// Photo Optional. Available sizes of the chat photo, if the photo was requested by the bot
|
|
Photo []PhotoSize `json:"photo,omitempty"`
|
|
}
|
|
|
|
// SuggestedPostApproved is a service message about an approved suggested post.
|
|
// Since: Bot API 9.1
|
|
type SuggestedPostApproved struct {
|
|
// SuggestedPostMessage Optional. Message containing the suggested post. Note that the Message object in
|
|
// this field will not contain the reply_to_message field even if it itself is a reply.
|
|
SuggestedPostMessage *Message `json:"suggested_post_message,omitempty"`
|
|
// Price Optional. Amount paid for the post
|
|
Price SuggestedPostPrice `json:"price"`
|
|
// SendDate Date when the post will be published
|
|
SendDate int `json:"send_date"`
|
|
}
|
|
|
|
// SuggestedPostApprovalFailed is a service message about a failed suggested post approval.
|
|
// Since: Bot API 9.1
|
|
type SuggestedPostApprovalFailed struct {
|
|
// SuggestedPostMessage Optional. Message containing the suggested post whose approval has failed. Note that
|
|
// the Message object in this field will not contain the reply_to_message field even if it itself is a
|
|
// reply.
|
|
SuggestedPostMessage *Message `json:"suggested_post_message,omitempty"`
|
|
// Price Expected price of the post
|
|
Price SuggestedPostPrice `json:"price"`
|
|
}
|
|
|
|
// SuggestedPostDeclined is a service message about a declined suggested post.
|
|
// Since: Bot API 9.1
|
|
type SuggestedPostDeclined struct {
|
|
// SuggestedPostMessage Optional. Message containing the suggested post. Note that the Message object in
|
|
// this field will not contain the reply_to_message field even if it itself is a reply.
|
|
SuggestedPostMessage *Message `json:"suggested_post_message,omitempty"`
|
|
// Comment Optional. Comment with which the post was declined
|
|
Comment string `json:"comment,omitempty"`
|
|
}
|
|
|
|
// SuggestedPostPaid is a service message about a paid suggested post.
|
|
// Since: Bot API 9.1
|
|
type SuggestedPostPaid struct {
|
|
// SuggestedPostMessage Optional. Message containing the suggested post. Note that the Message object in
|
|
// this field will not contain the reply_to_message field even if it itself is a reply.
|
|
SuggestedPostMessage *Message `json:"suggested_post_message,omitempty"`
|
|
// Currency Currency in which the payment was made. Currently, one of “XTR” for Telegram Stars or
|
|
// “TON” for TON grams.
|
|
Currency string `json:"currency"`
|
|
// Amount Optional. The amount of the currency that was received by the channel in nanograms; for payments
|
|
// in TON grams only
|
|
Amount int `json:"amount"`
|
|
// StarAmount Optional. The amount of Telegram Stars that was received by the channel; for payments in
|
|
// Telegram Stars only
|
|
StarAmount *StarAmount `json:"star_amount,omitempty"`
|
|
}
|
|
|
|
// SuggestedPostRefunded is a service message about a refunded suggested post.
|
|
// Since: Bot API 9.1
|
|
type SuggestedPostRefunded struct {
|
|
// SuggestedPostMessage Optional. Message containing the suggested post. Note that the Message object in
|
|
// this field will not contain the reply_to_message field even if it itself is a reply.
|
|
SuggestedPostMessage *Message `json:"suggested_post_message,omitempty"`
|
|
// Reason Reason for the refund. Currently, one of “post_deleted” if the post was deleted within 24
|
|
// hours of being posted or removed from scheduled messages without being posted, or “payment_refunded”
|
|
// if the payer refunded their payment.
|
|
Reason string `json:"reason,omitempty"`
|
|
}
|
|
|
|
// VideoChatScheduled represents a service message about a video chat scheduled in the chat.
|
|
// Since: Bot API 6.0
|
|
type VideoChatScheduled struct {
|
|
// StartDate Point in time (Unix timestamp) when the video chat is supposed to be started by a chat
|
|
// administrator
|
|
StartDate int64 `json:"start_date"`
|
|
}
|
|
|
|
// VideoChatStarted represents a service message about a video chat started in the chat.
|
|
// Since: Bot API 5.1
|
|
type VideoChatStarted struct{}
|
|
|
|
// VideoChatEnded represents a service message about a video chat ended in the chat.
|
|
// Since: Bot API 5.1
|
|
type VideoChatEnded struct {
|
|
// Duration Video chat duration in seconds
|
|
Duration int64 `json:"duration"`
|
|
}
|
|
|
|
// VideoChatParticipantsInvited represents a service message about new members invited to a video chat.
|
|
// Since: Bot API 5.1
|
|
type VideoChatParticipantsInvited struct {
|
|
// Users New members that were invited to the video chat
|
|
Users []User `json:"users"`
|
|
}
|
|
|
|
// SentGuestMessage describes an inline message sent by a guest bot.
|
|
// Since: Bot API 10.0
|
|
type SentGuestMessage struct {
|
|
// InlineMessageID Identifier of the sent inline message
|
|
InlineMessageID string `json:"inline_message_id"`
|
|
}
|
|
|
|
// RichMessage represents a received rich-formatted message.
|
|
// Since: Bot API 10.1
|
|
type RichMessage struct {
|
|
// Blocks contains the nested rich-message blocks.
|
|
Blocks []RichBlock `json:"blocks"`
|
|
// IsRTL requests right-to-left rich-message layout.
|
|
IsRTL bool `json:"is_rtl,omitempty"`
|
|
}
|
|
|
|
// InputRichMessageMedia describes media embedded in outgoing rich-message HTML or Markdown.
|
|
//
|
|
// Since: Bot API 10.2
|
|
type InputRichMessageMedia struct {
|
|
// ID uniquely identifies the value within its containing object.
|
|
ID string `json:"id"`
|
|
// Media contains or identifies media associated with the value.
|
|
Media InputMedia `json:"media"`
|
|
}
|
|
|
|
// InputRichMessage describes a rich message to be sent. Exactly one of HTML, Markdown, or Blocks must be used.
|
|
//
|
|
// Since: Bot API 10.1
|
|
type InputRichMessage struct {
|
|
// Blocks contains the nested rich-message blocks.
|
|
Blocks []InputRichBlock `json:"blocks,omitempty"` // Since: Bot API 10.2
|
|
// HTML contains rich-message content in Telegram HTML syntax.
|
|
HTML string `json:"html,omitempty"`
|
|
// Markdown contains rich-message content in Telegram Markdown syntax.
|
|
Markdown string `json:"markdown,omitempty"`
|
|
// Media contains or identifies media associated with the value.
|
|
Media []InputRichMessageMedia `json:"media,omitempty"` // Since: Bot API 10.2
|
|
// IsRTL requests right-to-left rich-message layout.
|
|
IsRTL bool `json:"is_rtl,omitempty"`
|
|
// SkipEntityDetection disables automatic detection of links, mentions, hashtags, commands, phone numbers, and bank cards.
|
|
SkipEntityDetection bool `json:"skip_entity_detection,omitempty"`
|
|
}
|