Telegram

package
v0.0.0-...-3e87f45 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 17, 2022 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Overview

* @Author: McPlus * @Date: 2022-03-14 17:16:14 * @LastEditTime: 2022-03-14 17:16:16 * @LastEdit: McPlus * @Description: Animation结构体 * @FilePath: \Momizi\Internal\MessageSend\ChatSoftwareAPI\Telegram\Animation.go

* @Author: McPlus * @Date: 2022-03-14 17:18:09 * @LastEditTime: 2022-03-14 17:18:10 * @LastEdit: McPlus * @Description: Audio结构体 * @FilePath: \Momizi\Internal\MessageSend\ChatSoftwareAPI\Telegram\Audio.go

* @Author: McPlus * @Date: 2022-03-19 17:22:42 * @LastEditTime: 2022-03-19 18:10:07 * @LastEdit: McPlus * @Description: 基础返回结构 * @FilePath: \Momizi\Internal\MessageSend\ChatSoftwareAPI\Telegram\BasicReturn.go

* @Author: McPlus * @Date: 2022-03-14 17:57:27 * @LastEditTime: 2022-03-14 17:57:28 * @LastEdit: McPlus * @Description: CallbackGame结构体 * @FilePath: \Momizi\Internal\MessageSend\ChatSoftwareAPI\Telegram\CallbackGame.go

* @Author: McPlus * @Date: 2022-03-14 16:11:54 * @LastEditTime: 2022-04-02 09:24:40 * @LastEdit: McPlus * @Description: Chat功能 * @FilePath: \Momizi\Internal\MessageSend\ChatSoftwareAPI\Telegram\Chat.go

* @Author: McPlus * @Date: 2022-03-14 17:10:03 * @LastEditTime: 2022-03-14 17:10:04 * @LastEdit: McPlus * @Description: * @FilePath: \Momizi\Internal\MessageSend\ChatSoftwareAPI\Telegram\ChatLocation.go

* @Author: McPlus * @Date: 2022-03-14 16:43:36 * @LastEditTime: 2022-03-14 16:43:37 * @LastEdit: McPlus * @Description: ChatMembet结构体 * @FilePath: \Momizi\Internal\MessageSend\ChatSoftwareAPI\Telegram\ChatMember.go

* @Author: McPlus * @Date: 2022-03-14 16:44:18 * @LastEditTime: 2022-03-14 16:46:27 * @LastEdit: McPlus * @Description: ChatPhoto结构体 * @FilePath: \Momizi\Internal\MessageSend\ChatSoftwareAPI\Telegram\ChatPhoto.go

* @Author: McPlus * @Date: 2022-03-14 17:24:22 * @LastEditTime: 2022-03-14 17:24:24 * @LastEdit: McPlus * @Description: Dice结构体 * @FilePath: \Momizi\Internal\MessageSend\ChatSoftwareAPI\Telegram\Dice.go

* @Author: McPlus * @Date: 2022-03-14 17:18:41 * @LastEditTime: 2022-03-14 17:18:43 * @LastEdit: McPlus * @Description: Document结构体 * @FilePath: \Momizi\Internal\MessageSend\ChatSoftwareAPI\Telegram\Document.go

* @Author: McPlus * @Date: 2022-03-14 17:36:28 * @LastEditTime: 2022-03-14 17:36:29 * @LastEdit: McPlus * @Description: EncryptedCredentials结构体 * @FilePath: \Momizi\Internal\MessageSend\ChatSoftwareAPI\Telegram\Passport\EncryptedCredentials.go

* @Author: McPlus * @Date: 2022-03-14 17:35:20 * @LastEditTime: 2022-03-14 17:35:21 * @LastEdit: McPlus * @Description: EncryptedPassportElement结构体 * @FilePath: \Momizi\Internal\MessageSend\ChatSoftwareAPI\Telegram\Passport\EncryptedPassportElement.go

* @Author: McPlus * @Date: 2022-03-09 13:11:32 * @LastEditTime: 2022-03-19 18:08:15 * @LastEdit: McPlus * @Description: * @FilePath: \Momizi\Internal\MessageSend\ChatSoftwareAPI\Telegram\File.go

* @Author: McPlus * @Date: 2022-03-14 17:24:58 * @LastEditTime: 2022-03-14 17:49:39 * @LastEdit: McPlus * @Description: Game结构体 * @FilePath: \Momizi\Internal\MessageSend\ChatSoftwareAPI\Telegram\Game.go

* @Author: McPlus * @Date: 2022-03-14 17:54:54 * @LastEditTime: 2022-03-14 17:56:28 * @LastEdit: McPlus * @Description: InlineKeyboardButton * @FilePath: \Momizi\Internal\MessageSend\ChatSoftwareAPI\Telegram\InlineKeyboardButton.go

* @Author: McPlus * @Date: 2022-03-14 17:54:19 * @LastEditTime: 2022-03-14 17:54:20 * @LastEdit: McPlus * @Description:InlineKeyboardMarkup * @FilePath: \Momizi\Internal\MessageSend\ChatSoftwareAPI\Telegram\InlineKeyboardMarkup.go

* @Author: McPlus * @Date: 2022-03-14 17:30:14 * @LastEditTime: 2022-03-14 17:32:04 * @LastEdit: McPlus * @Description: Invoice结构体 * @FilePath: \Momizi\Internal\MessageSend\ChatSoftwareAPI\Telegram\Invoice.go

* @Author: McPlus * @Date: 2022-03-14 17:10:43 * @LastEditTime: 2022-03-14 17:12:14 * @LastEdit: McPlus * @Description: * @FilePath: \Momizi\Internal\MessageSend\ChatSoftwareAPI\Telegram\Location.go

* @Author: McPlus * @Date: 2022-03-14 17:56:48 * @LastEditTime: 2022-03-14 17:56:50 * @LastEdit: McPlus * @Description: LoginUrl结构体 * @FilePath: \Momizi\Internal\MessageSend\ChatSoftwareAPI\Telegram\LoginUrl.go

* @Author: McPlus * @Date: 2022-03-14 17:20:40 * @LastEditTime: 2022-03-14 17:49:30 * @LastEdit: McPlus * @Description: MaskPosition结构体 * @FilePath: \Momizi\Internal\MessageSend\ChatSoftwareAPI\Telegram\MaskPosition.go

* @Author: McPlus * @Date: 2022-03-14 16:46:55 * @LastEditTime: 2022-03-17 23:54:17 * @LastEdit: McPlus * @Description: Message结构体 * @FilePath: \Momizi\Internal\MessageSend\ChatSoftwareAPI\Telegram\Message.go

* @Author: McPlus * @Date: 2022-03-14 17:28:01 * @LastEditTime: 2022-03-14 17:28:02 * @LastEdit: McPlus * @Description: MessageAutoDeleteTimerChanged结构体 * @FilePath: \Momizi\Internal\MessageSend\ChatSoftwareAPI\Telegram\MessageAutoDeleteTimerChanged.go

* @Author: McPlus * @Date: 2022-03-14 17:15:24 * @LastEditTime: 2022-03-14 17:15:25 * @LastEdit: McPlus * @Description: MessageEntity结构体 * @FilePath: \Momizi\Internal\MessageSend\ChatSoftwareAPI\Telegram\MessageEntity.go

* @Author: McPlus * @Date: 2022-03-14 17:33:03 * @LastEditTime: 2022-03-14 17:33:04 * @LastEdit: McPlus * @Description: OrderInfo结构体 * @FilePath: \Momizi\Internal\MessageSend\ChatSoftwareAPI\Telegram\OrderInfo.go

* @Author: McPlus * @Date: 2022-03-14 17:34:18 * @LastEditTime: 2022-03-14 17:34:19 * @LastEdit: McPlus * @Description: PassportData结构体 * @FilePath: \Momizi\Internal\MessageSend\ChatSoftwareAPI\Telegram\PassportData.go

* @Author: McPlus * @Date: 2022-03-14 17:35:57 * @LastEditTime: 2022-03-14 17:35:58 * @LastEdit: McPlus * @Description: PassportFile结构体 * @FilePath: \Momizi\Internal\MessageSend\ChatSoftwareAPI\Telegram\Passport\PassportFile.go

* @Author: McPlus * @Date: 2022-03-14 17:16:57 * @LastEditTime: 2022-03-14 17:16:58 * @LastEdit: McPlus * @Description: PhotoSize结构体 * @FilePath: \Momizi\Internal\MessageSend\ChatSoftwareAPI\Telegram\PhotoSize.go

* @Author: McPlus * @Date: 2022-03-14 17:25:38 * @LastEditTime: 2022-03-14 17:26:40 * @LastEdit: McPlus * @Description: Poll结构体 * @FilePath: \Momizi\Internal\MessageSend\ChatSoftwareAPI\Telegram\Poll.go

* @Author: McPlus * @Date: 2022-03-14 17:26:48 * @LastEditTime: 2022-03-14 17:26:49 * @LastEdit: McPlus * @Description: PollOption结构体 * @FilePath: \Momizi\Internal\MessageSend\ChatSoftwareAPI\Telegram\PollOption.go

* @Author: McPlus * @Date: 2022-03-14 17:49:56 * @LastEditTime: 2022-03-14 17:49:58 * @LastEdit: McPlus * @Description: ProximityAlertTriggered结构体 * @FilePath: \Momizi\Internal\MessageSend\ChatSoftwareAPI\Telegram\ProximityAlertTriggered.go

* @Author: McPlus * @Date: 2022-03-14 17:33:36 * @LastEditTime: 2022-03-14 17:33:38 * @LastEdit: McPlus * @Description: ShippingAddress结构体 * @FilePath: \Momizi\Internal\MessageSend\ChatSoftwareAPI\Telegram\ShippingAddress.go

* @Author: McPlus * @Date: 2022-03-14 17:19:24 * @LastEditTime: 2022-03-14 17:47:35 * @LastEdit: McPlus * @Description: Sticker结构体 * @FilePath: \Momizi\Internal\MessageSend\ChatSoftwareAPI\Telegram\Sticker.go

* @Author: McPlus * @Date: 2022-03-14 17:32:16 * @LastEditTime: 2022-03-14 17:32:18 * @LastEdit: McPlus * @Description: SuccessfulPayment结构体 * @FilePath: \Momizi\Internal\MessageSend\ChatSoftwareAPI\Telegram\SuccessfulPayment.go

* @Author: McPlus * @Date: 2022-03-14 16:25:27 * @LastEditTime: 2022-03-14 16:34:11 * @LastEdit: McPlus * @Description: * @FilePath: \Momizi\Internal\MessageSend\ChatSoftwareAPI\Telegram\User.go

* @Author: McPlus * @Date: 2022-03-14 17:27:25 * @LastEditTime: 2022-03-14 17:27:26 * @LastEdit: McPlus * @Description: Venue结构体 * @FilePath: \Momizi\Internal\MessageSend\ChatSoftwareAPI\Telegram\Venue.go

* @Author: McPlus * @Date: 2022-03-14 17:22:03 * @LastEditTime: 2022-03-14 17:22:04 * @LastEdit: McPlus * @Description:Video结构体 * @FilePath: \Momizi\Internal\MessageSend\ChatSoftwareAPI\Telegram\Video.go

* @Author: McPlus * @Date: 2022-03-14 17:22:28 * @LastEditTime: 2022-03-14 17:22:29 * @LastEdit: McPlus * @Description: VideoNote结构体 * @FilePath: \Momizi\Internal\MessageSend\ChatSoftwareAPI\Telegram\VideoNote.go

* @Author: McPlus * @Date: 2022-03-14 17:23:06 * @LastEditTime: 2022-03-14 17:23:07 * @LastEdit: McPlus * @Description: Voice结构体 * @FilePath: \Momizi\Internal\MessageSend\ChatSoftwareAPI\Telegram\Voice.go

* @Author: McPlus * @Date: 2022-03-14 17:52:14 * @LastEditTime: 2022-03-14 17:52:15 * @LastEdit: McPlus * @Description: VoiceChatEnded * @FilePath: \Momizi\Internal\MessageSend\ChatSoftwareAPI\Telegram\VoiceChatEnded.go

* @Author: McPlus * @Date: 2022-03-14 17:53:27 * @LastEditTime: 2022-03-14 17:53:29 * @LastEdit: McPlus * @Description: VoiceChatParticipantsInvited * @FilePath: \Momizi\Internal\MessageSend\ChatSoftwareAPI\Telegram\VoiceChatParticipantsInvited.go

* @Author: McPlus * @Date: 2022-03-14 17:50:40 * @LastEditTime: 2022-03-14 17:50:42 * @LastEdit: McPlus * @Description: VoiceChatScheduled结构体 * @FilePath: \Momizi\Internal\MessageSend\ChatSoftwareAPI\Telegram\VoiceChatScheduled.go

* @Author: McPlus * @Date: 2022-03-14 17:51:25 * @LastEditTime: 2022-03-14 17:53:05 * @LastEdit: McPlus * @Description: VoiceChatStarted结构体 * @FilePath: \Momizi\Internal\MessageSend\ChatSoftwareAPI\Telegram\VoiceChatStarted.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Animation

type Animation struct {
	FileID       string    `json:"file_id"`        // Identifier for this file, which can be used to download or reuse the file
	FileUniqueID string    `json:"file_unique_id"` // Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
	Width        int       `json:"width"`          // Video width as defined by sender
	Height       int       `json:"height"`         // Video height as defined by sender
	Duration     int       `json:"duration"`       // Duration of the video in seconds as defined by sender
	Thumb        PhotoSize `json:"thumb"`          // Optional. Animation thumbnail as defined by sender
	FileName     string    `json:"file_name"`      // Optional. Original animation filename as defined by sender
	MimeType     string    `json:"mime_type"`      // Optional. MIME type of the file as defined by sender
	FileSize     int       `json:"file_size"`      // Optional. File size in bytes
}

type Audio

type Audio struct {
	FileID       string    `json:"file_id"`        // Identifier for this file, which can be used to download or reuse the file
	FileUniqueID string    `json:"file_unique_id"` // Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
	Duration     int       `json:"duration"`       // Duration of the audio in seconds as defined by sender
	Performer    string    `json:"performer"`      // Optional. Performer of the audio as defined by sender or by audio tags
	Title        string    `json:"title"`          // Optional. Title of the audio as defined by sender or by audio tags
	FileName     string    `json:"file_name"`      // Optional. Original filename as defined by sender
	MimeType     string    `json:"mime_type"`      // Optional. MIME type of the file as defined by sender
	FileSize     int       `json:"file_size"`      // Optional. File size in bytes
	Thumb        PhotoSize `json:"thumb"`          // Optional. Thumbnail of the album cover to which the music file belongs
}

type BasicReturn

type BasicReturn struct {
	Success     bool   `json:"ok"`
	ErrorCode   int    `json:"error_code"`
	Description string `json:"description"`
}

type CallbackGame

type CallbackGame struct {
}

type Chat

type Chat struct {
	ID                    string          `json:"id"`                       // Unique identifier for this 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 signed 64-bit integer or double-precision float type are safe for storing this identifier.
	Type                  string          `json:"type"`                     // Type of chat, can be either "private", "group", "supergroup" or "channel"
	Title                 string          `json:"title"`                    // 	Optional. Title, for supergroups, channels and group chats
	UserName              string          `json:"username"`                 // Optional. Username, for private chats, supergroups and channels if available
	FirstName             string          `json:"first_name"`               // Optional. First name of the other party in a private chat
	LastName              string          `json:"last_name"`                // 	Optional. Last name of the other party in a private chat
	Photo                 ChatPhoto       `json:"photo"`                    // Optional. Chat photo. Returned only in getChat.
	Bio                   string          `json:"bio"`                      // Optional. Bio of the other party in a private chat. Returned only in getChat.
	HasPrivateForwards    bool            `json:"has_private_forwards"`     // Optional. True, if privacy settings of the other party in the private chat allows to use tg://user?id=<user_id> links only in chats with the user. Returned only in getChat.
	Description           string          `json:"description"`              // Optional. Description, for groups, supergroups and channel chats. Returned only in getChat.
	InviteLink            string          `json:"invite_link"`              // Optional. Primary invite link, for groups, supergroups and channel chats. Returned only in getChat.
	Permissions           ChatPermissions `json:"permissions"`              // Optional. Default chat member permissions, for groups and supergroups. Returned only in getChat.
	SlowModeDelay         int             `json:"slow_mode_delay"`          // 	Optional. For supergroups, the minimum allowed delay between consecutive messages sent by each unpriviledged user; in seconds. Returned only in getChat.
	MessageAutoDeleteTime int             `json:"message_auto_delete_time"` // Optional. The time after which all messages sent to the chat will be automatically deleted; in seconds. Returned only in getChat.
	HasProtectedContent   bool            `json:"has_protected_content"`    // Optional. True, if messages from the chat can't be forwarded to other chats. Returned only in getChat.
	StickerSetName        string          `json:"sticker_set_name"`         // Optional. For supergroups, name of group sticker set. Returned only in getChat.
	CanSetStickerSet      bool            `json:"can_set_sticker_set"`      // Optional. True, if the bot can change the group sticker set. Returned only in getChat.
	LinkedChatID          int             `json:"linked_chat_id"`           // Optional. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier. Returned only in getChat.
	Location              ChatLocation    `json:"location"`                 // 	Optional. For supergroups, the location to which the supergroup is connected. Returned only in getChat.
	PinnedMessage         PinnedMessage   `json:"pinned_message"`           // Optional. The most recent pinned message (by sending date). Returned only in getChat.
}

func NewChat

func NewChat(ID int) *Chat

*

  • @description: 构建Chat
  • @param {int} ID ChatID
  • @return {*Chat}

func (Chat) GetAdministrators

func (Chat Chat) GetAdministrators() ([]ChatMemberAdministrator, error)

*

  • @description: 获取管理员列表
  • @param {*}
  • @return {[]ChatMemberAdministrator, error}

func (Chat) SendAudio

func (Chat Chat) SendAudio(Audio string, Caption string, ParseMode string, CaptionEntities []MessageEntity, Duration int,
	Performer string, Title string, DisableNotification bool, ProtectContent bool, ReplyToMessageID int,
	AllowSendingWithoutReply bool) (Message, error)

*

  • @description: 发送音频消息
  • @param {string} Audio 音频文件路径
  • @param {string} Caption *可选 -- Audio caption, 0-1024 characters after entities parsing
  • @param {string} ParseMode *可选 MarkdownV2/HTML/Markdown -- Mode for parsing entities in the audio caption. See formatting options for more details.
  • @param {[]MessageEntity} CaptionEntities *可选 -- A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
  • @param {int} Duration *可选 -- Duration of the audio in seconds
  • @param {string} Performer *可选 -- Performer
  • @param {string} Title *可选 -- Track name
  • @param {bool} DisableNotification *可选 -- Sends the message silently. Users will receive a notification with no sound.
  • @param {bool} ProtectContent *可选 -- Protects the contents of the sent message from forwarding and saving
  • @param {int} ReplyToMessageID *可选 -- If the message is a reply, ID of the original message
  • @param {bool} AllowSendingWithoutReply *可选 -- Pass True, if the message should be sent even if the specified replied-to message is not found
  • @return {*}

func (Chat) SendDocument

func (Chat Chat) SendDocument(Document string, Caption string, ParseMode string, CaptionEntities []MessageEntity,
	DisableContentTypeDetection bool, DisableNotification bool, ProtectContent bool, ReplyToMessageID int,
	AllowSendingWithoutReply bool) (Message, error)

*

  • @description: 发送文件消息
  • @param {string} Document 文件路径
  • @param {string} Caption *可选 -- Document caption (may also be used when resending documents by file_id), 0-1024 characters after entities parsing
  • @param {string} ParseMode *可选 MarkdownV2/HTML/Markdown -- Mode for parsing entities in the document caption.
  • @param {[]MessageEntity} CaptionEntities *可选 -- A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
  • @param {bool} DisableContentTypeDetection *可选 -- Disables automatic server-side content type detection for files uploaded using multipart/form-data
  • @param {bool} DisableNotification *可选 -- Sends the message silently. Users will receive a notification with no sound.
  • @param {bool} ProtectContent *可选 -- Protects the contents of the sent message from forwarding and saving
  • @param {int} ReplyToMessageID *可选 -- If the message is a reply, ID of the original message
  • @param {bool} AllowSendingWithoutReply *可选 -- Pass True, if the message should be sent even if the specified replied-to message is not found
  • @return {*}

func (Chat) SendMessage

func (Chat Chat) SendMessage(Text string, ParseMode string, Entities []MessageEntity, DisableWebPagePreview bool,
	DisableNotification bool, ProtectContent bool, ReplyToMessageID int, AllowSendingWithoutReply bool) (Message, error)

*

  • @description:
  • @param {string} Text
  • @param {string} ParseMode *可选 MarkdownV2/HTML/Markdown -- Mode for parsing entities in the message text
  • @param {[]MessageEntity} Entities *可选 -- A JSON-serialized list of special entities that appear in message text, which can be specified instead of parse_mode
  • @param {bool} DisableWebPagePreview *可选 -- Disables link previews for links in this message
  • @param {bool} DisableNotification *可选 -- Sends the message silently. Users will receive a notification with no sound.
  • @param {bool} ProtectContent *可选 -- Protects the contents of the sent message from forwarding and saving
  • @param {int} ReplyToMessaggeID *可选 -- If the message is a reply, ID of the original message
  • @param {bool} AllowSendingWithoutReply *可选 -- Pass True, if the message should be sent even if the specified replied-to message is not found
  • @return {*}

func (Chat) SendPhoto

func (Chat Chat) SendPhoto(Photo string, Caption string, ParseMode string, CaptionEntities []MessageEntity, DisableNotification bool,
	ProtectContent bool, ReplyToMessageID int, AllowSendingWithoutReply bool) (Message, error)

*

  • @description: 发送图片消息
  • @param {string} Photo 图片路径
  • @param {string} Caption *可选 -- Photo caption (may also be used when resending photos by file_id), 0-1024 characters after entities parsing
  • @param {string} ParseMode *可选 MarkdownV2/HTML/Markdown -- Mode for parsing entities in the photo caption
  • @param {[]MessageEntity} CaptionEntities *可选 -- A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
  • @param {bool} DisableNotification *可选 -- Sends the message silently. Users will receive a notification with no sound.
  • @param {bool} ProtectContent *可选 -- Protects the contents of the sent message from forwarding and saving
  • @param {int} ReplyToMessageID *可选 -- If the message is a reply, ID of the original message
  • @param {bool} AllowSendingWithoutReply *可选 -- Pass True, if the message should be sent even if the specified replied-to message is not found
  • @return {*}

type ChatLocation

type ChatLocation struct {
	Location Location `json:"location"` // The location to which the supergroup is connected. Can't be a live location.
	Address  string   `json:"address"`  // Location address; 1-64 characters, as defined by the chat owner
}

type ChatMemberAdministrator

type ChatMemberAdministrator struct {
	Status              string `json:"status"`                 // The member's status in the chat, always "administrator"
	User                User   `json:"user"`                   // Information about the user
	CanBeEdited         bool   `json:"can_be_edited"`          // True, if the bot is allowed to edit administrator privileges of that user
	IsAnonymous         bool   `json:"is_anonymous"`           // True, if the user's presence in the chat is hidden
	CanManageChat       bool   `json:"can_manage_chat"`        // True, if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege
	CanDeleteMessages   bool   `json:"can_delete_messages"`    // True, if the administrator can delete messages of other users
	CanManageVoiceChats bool   `json:"can_manage_voice_chats"` //True, if the administrator can manage voice chats
	CanRestrictMembers  bool   `json:"can_restrict_members"`   // True, if the administrator can restrict, ban or unban chat members
	CanPromoteMembers   bool   `json:"can_promote_members"`    // True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user)
	CanChangeInfo       bool   `json:"can_change_info"`        // True, if the user is allowed to change the chat title, photo and other settings
	CanInviteUsers      bool   `json:"can_invite_users"`       // True, if the user is allowed to invite new users to the chat
	CanPostMessage      bool   `json:"can_post_messages"`      // Optional. True, if the administrator can post in the channel; channels only
	CanEditMessage      bool   `json:"can_edit_messages"`      // Optional. True, if the administrator can edit messages of other users and can pin messages; channels only
	CanPinMessages      bool   `json:"can_pin_messages"`       // Optional. True, if the user is allowed to pin messages; groups and supergroups only
	CustomTitle         string `json:"custom_title"`           // Optional. Custom title for this user
}

type ChatPermissions

type ChatPermissions struct {
	CanSendMessages       bool `json:"can_send_messages"`         // Optional. True, if the user is allowed to send text messages, contacts, locations and venues
	CanSendMediaMessages  bool `json:"can_send_media_messages"`   // Optional. True, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes, implies can_send_messages
	CanSendPolls          bool `json:"can_send_polls"`            // Optional. True, if the user is allowed to send polls, implies can_send_messages
	CanSendOtherMessages  bool `json:"can_send_other_messages"`   // Optional. True, if the user is allowed to send animations, games, stickers and use inline bots, implies can_send_media_messages
	CanAddWebPagePreviews bool `json:"can_add_web_page_previews"` // Optional. True, if the user is allowed to add web page previews to their messages, implies can_send_media_messages
	CanChangeInfo         bool `json:"can_change_info"`           // Optional. True, if the user is allowed to change the chat title, photo and other settings. Ignored in public supergroups
	CanInviteUsers        bool `json:"can_invite_users"`          // Optional. True, if the user is allowed to invite new users to the chat
	CanPinMessages        bool `json:"can_pin_messages"`          // Optional. True, if the user is allowed to pin messages. Ignored in public supergroups
}

type ChatPhoto

type ChatPhoto struct {
	SmallFileID       string `json:"small_file_id"`        // File identifier of small (160x160) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed.
	SmallFileUniqueID string `json:"small_file_unique_id"` // Unique file identifier of small (160x160) chat photo, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
	BigFileID         string `json:"big_file_id"`          // File identifier of big (640x640) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed.
	BigFileUniqueID   string `json:"big_file_unique_id"`   // Unique file identifier of big (640x640) chat photo, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
}

type Contact

type Contact struct {
	PhoneNumber string `json:"phone_number"` // Contact's phone number
	FirstName   string `json:"first_name"`   // Contact's first name
	LastName    string `json:"last_name"`    // Optional. Contact's last name
	UserID      int    `json:"user_id"`      // Optional. Contact's user identifier in Telegram. 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.
	VCard       string `json:"vcard"`        // Optional. Additional data about the contact in the form of a vCard
}

type Dice

type Dice struct {
	Emoji string `json:"emoji"` // Emoji on which the dice throw animation is based
	Value int    `json:"value"` // Value of the dice, 1-6 for "🎲", "🎯" and "🎳" base emoji, 1-5 for "🏀" and "⚽" base emoji, 1-64 for "🎰" base emoji
}

type Document

type Document struct {
	FileID       string    `json:"file_id"`        // Identifier for this file, which can be used to download or reuse the file
	FileUniqueID string    `json:"file_unique_id"` // Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
	Thumb        PhotoSize `json:"thumb"`          // Optional. Document thumbnail as defined by sender
	FileName     string    `json:"file_name"`      // Optional. Original filename as defined by sender
	MimeType     string    `json:"mime_type"`      // Optional. MIME type of the file as defined by sender
	FileSize     int       `json:"file_size"`      // Optional. File size in bytes
}

type EncryptedCredentials

type EncryptedCredentials struct {
	Data   string `json:"data"`   // Base64-encoded encrypted JSON-serialized data with unique user's payload, data hashes and secrets required for EncryptedPassportElement decryption and authentication
	Hash   string `json:"hash"`   // Base64-encoded data hash for data authentication
	Secret string `json:"secret"` // Base64-encoded secret, encrypted with the bot's public RSA key, required for data decryption
}

type EncryptedPassportElement

type EncryptedPassportElement struct {
	Type        string         `json:"type"`         // Element type. One of "personal_details", "passport", "driver_license", "identity_card", "internal_passport", "address", "utility_bill", "bank_statement", "rental_agreement", "passport_registration", "temporary_registration", "phone_number", "email".
	Data        string         `json:"data"`         // Optional. Base64-encoded encrypted Telegram Passport element data provided by the user, available for "personal_details", "passport", "driver_license", "identity_card", "internal_passport" and "address" types. Can be decrypted and verified using the accompanying EncryptedCredentials.
	PhoneNumber string         `json:"phone_number"` // Optional. User's verified phone number, available only for "phone_number" type
	Email       string         `json:"email"`        // Optional. User's verified email address, available only for "email" type
	Files       []PassportFile `json:"files"`        // Optional. Array of encrypted files with documents provided by the user, available for "utility_bill", "bank_statement", "rental_agreement", "passport_registration" and "temporary_registration" types. Files can be decrypted and verified using the accompanying EncryptedCredentials.
	FrontSide   PassportFile   `json:"front_side"`   // Optional. Encrypted file with the front side of the document, provided by the user. Available for "passport", "driver_license", "identity_card" and "internal_passport". The file can be decrypted and verified using the accompanying EncryptedCredentials.
	ReverseSide PassportFile   `json:"reverse_side"` // Optional. Encrypted file with the reverse side of the document, provided by the user. Available for "driver_license" and "identity_card". The file can be decrypted and verified using the accompanying EncryptedCredentials.
	Selfie      PassportFile   `json:"selfie"`       // Optional. Encrypted file with the selfie of the user holding a document, provided by the user; available for "passport", "driver_license", "identity_card" and "internal_passport". The file can be decrypted and verified using the accompanying EncryptedCredentials.
	Translation []PassportFile `json:"translation"`  // Optional. Array of encrypted files with translated versions of documents provided by the user. Available if requested for "passport", "driver_license", "identity_card", "internal_passport", "utility_bill", "bank_statement", "rental_agreement", "passport_registration" and "temporary_registration" types. Files can be decrypted and verified using the accompanying EncryptedCredentials.
	Hash        string         `json:"hash"`         // Base64-encoded element hash for using in PassportElementErrorUnspecified
}

type File

type File struct {
	ID       string `json:"file_id"`
	UniqueID string `json:"file_unique_id"`
	Size     int64  `json:"file_size"`
	Path     string `json:"file_path"`
}

func NewFile

func NewFile(ID string) (*File, error)

type Game

type Game struct {
	Title        string          `json:"title"`         // Title of the game
	Description  string          `json:"description"`   // Description of the game
	Photo        []PhotoSize     `json:"photo"`         // Photo that will be displayed in the game message in chats.
	Text         string          `json:"text"`          // Optional. Brief description of the game or high scores included in the game message. Can be automatically edited to include current high scores for the game when the bot calls setGameScore, or manually edited using editMessageText. 0-4096 characters.
	TextEntities []MessageEntity `json:"text_entities"` // Optional. Special entities that appear in text, such as usernames, URLs, bot commands, etc.
	Animation    Animation       `json:"animation"`     // Optional. Animation that will be displayed in the game message in chats. Upload via BotFather
}

type GetAdministratorsReturn

type GetAdministratorsReturn struct {
	BasicReturn

	Administrators []ChatMemberAdministrator `json:"result"`
}

type GetChatReturn

type GetChatReturn struct {
	BasicReturn

	Chat *Chat `json:"result"`
}

type GetFileReturn

type GetFileReturn struct {
	BasicReturn

	File *File `json:"result"`
}

type InlineKeyboardButton

type InlineKeyboardButton struct {
	Text                         string       `json:"text"`                             // Label text on the button
	Url                          string       `json:"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 ID without using a username, if this is allowed by their privacy settings.
	LoginUrl                     LoginUrl     `json:"login_url"`                        // Optional. An HTTP URL used to automatically authorize the user. Can be used as a replacement for the Telegram Login Widget.
	CallbackData                 string       `json:"callback_data"`                    // Optional. Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes
	SwitchInlineQuery            string       `json:"switch_inline_query"`              // Optional. If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. Can be empty, in which case just the bot's username will be inserted.
	SwitchInlineQueryCurrentChat string       `json:"switch_inline_query_current_chat"` // Optional. If set, pressing the button will insert the bot's username and the specified inline query in the current chat's input field. Can be empty, in which case only the bot's username will be inserted.This offers a quick way for the user to open your bot in inline mode in the same chat – good for selecting something from multiple options.
	CallbackGame                 CallbackGame `json:"callback_game"`                    // Optional. Description of the game that will be launched when the user presses the button.
	Pay                          bool         `json:"pay"`                              // Optional. Specify True, to send a Pay button.
}

type InlineKeyboardMarkup

type InlineKeyboardMarkup struct {
	InlineKeyboard []InlineKeyboardButton `json:"inline_keyboard"` // Array of button rows, each represented by an Array of InlineKeyboardButton objects
}

type Invoice

type Invoice struct {
	Title          string `json:"title"`           // Product name
	Description    string `json:"description"`     // Product description
	StartParameter string `json:"start_parameter"` // Unique bot deep-linking parameter that can be used to generate this invoice
	Currency       string `json:"currency"`        // Three-letter ISO 4217 currency code
	TotalAmount    int    `json:"total_amount"`    // Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).
}

type Location

type Location struct {
	Longitude            float64 `json:"longitude"`              // Longitude as defined by sender
	Latitude             float64 `json:"latitude"`               // Latitude as defined by sender
	HorizontalAccuracy   float64 `json:"horizontal_accuracy"`    // Optional. The radius of uncertainty for the location, measured in meters; 0-1500
	LivePeriod           int     `json:"live_period"`            // Optional. Time relative to the message sending date, during which the location can be updated; in seconds. For active live locations only.
	Heading              int     `json:"heading"`                // Optional. The direction in which user is moving, in degrees; 1-360. For active live locations only.
	ProximityAlertRadius int     `json:"proximity_alert_radius"` // Optional. Maximum distance for proximity alerts about approaching another chat member, in meters. For sent live locations only.
}

type LoginUrl

type LoginUrl struct {
	Url                string `json:"url"`                  // An HTTP URL to be opened with user authorization data added to the query string when the button is pressed. If the user refuses to provide authorization data, the original URL without information about the user will be opened. The data added is the same as described in Receiving authorization data.
	ForwardText        string `json:"forward_text"`         // Optional. New text of the button in forwarded messages.
	BotUsername        string `json:"bot_username"`         // Optional. Username of a bot, which will be used for user authorization. See Setting up a bot for more details. If not specified, the current bot's username will be assumed. The url's domain must be the same as the domain linked with the bot. See Linking your domain to the bot for more details.
	RequestWriteAccess bool   `json:"request_write_access"` // Optional. Pass True to request the permission for your bot to send messages to the user.
}

type MaskPosition

type MaskPosition struct {
	Point  string  `json:"point"`   // The part of the face relative to which the mask should be placed. One of "forehead", "eyes", "mouth", or "chin".
	XShift float64 `json:"x_shift"` // Shift by X-axis measured in widths of the mask scaled to the face size, from left to right. For example, choosing -1.0 will place mask just to the left of the default mask position.
	YShift float64 `json:"y_shift"` // Shift by Y-axis measured in heights of the mask scaled to the face size, from top to bottom. For example, 1.0 will place the mask just below the default mask position.
	Scale  float64 `json:"scale"`   // Mask scaling coefficient. For example, 2.0 means double size.
}

type Message

type Message struct {
	MessageID                     int                           `json:"message_id"`                        // Unique message identifier inside this chat
	From                          User                          `json:"from"`                              // Optional. Sender of the message; empty for messages sent to channels. For backward compatibility, the field contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat.
	SenderChat                    Chat                          `json:"sender_chat"`                       // Optional. Sender of the message, sent on behalf of a chat. For example, the channel itself for channel posts, the supergroup itself for messages from anonymous group administrators, the linked channel for messages automatically forwarded to the discussion group. For backward compatibility, the field from contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat.
	Date                          int                           `json:"date"`                              // Date the message was sent in Unix time
	Chat                          Chat                          `json:"chat"`                              // Conversation the message belongs to
	ForwardFrom                   User                          `json:"forward_from"`                      // Optional. For forwarded messages, sender of the original message
	ForwardFromChat               Chat                          `json:"forward_from_chat"`                 // Optional. For messages forwarded from channels or from anonymous administrators, information about the original sender chat
	ForwardFromMessageID          int                           `json:"forward_from_message_id"`           // Optional. For messages forwarded from channels, identifier of the original message in the channel
	ForwardSignature              string                        `json:"forward_signature"`                 // Optional. For forwarded messages that were originally sent in channels or by an anonymous chat administrator, signature of the message sender if present
	ForwardSenderName             string                        `json:"forward_sender_name"`               // Optional. Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages
	ForwardDate                   int                           `json:"forward_date"`                      // Optional. For forwarded messages, date the original message was sent in Unix time
	IsAutomaticForward            bool                          `json:"is_automatic_forward"`              // Optional. True, if the message is a channel post that was automatically forwarded to the connected discussion group
	ViaBot                        User                          `json:"via_bot"`                           // Optional. Bot through which the message was sent
	EditDate                      int                           `json:"edit_date"`                         // Optional. Date the message was last edited in Unix time
	HasProtectedContent           bool                          `json:"has_protected_content"`             // Optional. True, if the message can't be forwarded
	MediaGroupID                  string                        `json:"media_group_id"`                    // Optional. The unique identifier of a media message group this message belongs to
	AuthorSignature               string                        `json:"author_signature"`                  // Optional. Signature of the post author for messages in channels, or the custom title of an anonymous group administrator
	Text                          string                        `json:"text"`                              // Optional. For text messages, the actual UTF-8 text of the message, 0-4096 characters
	Entities                      []MessageEntity               `json:"entities"`                          // Optional. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text
	Animation                     Animation                     `json:"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
	Audio                         Audio                         `json:"audio"`                             // Optional. Message is an audio file, information about the file
	Document                      Document                      `json:"document"`                          // Optional. Message is a general file, information about the file
	Photo                         []PhotoSize                   `json:"photo"`                             // Optional. Message is a photo, available sizes of the photo
	Sticker                       Sticker                       `json:"sticker"`                           // Optional. Message is a sticker, information about the sticker
	Video                         Video                         `json:"video"`                             // Optional. Message is a video, information about the video
	VideoNote                     VideoNote                     `json:"video_note"`                        // Optional. Message is a video note, information about the video message
	Voice                         Voice                         `json:"voice"`                             // Optional. Message is a voice message, information about the file
	Caption                       string                        `json:"caption"`                           // Optional. Caption for the animation, audio, document, photo, video or voice, 0-1024 characters
	CaptionEntities               []MessageEntity               `json:"caption_entities"`                  // Optional. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption
	Contact                       Contact                       `json:"contact"`                           // Optional. Message is a shared contact, information about the contact
	Dice                          Dice                          `json:"dice"`                              // Optional. Message is a dice with random value
	Game                          Game                          `json:"game"`                              // Optional. Message is a game, information about the game. More about games »
	Poll                          Poll                          `json:"poll"`                              // Optional. Message is a native poll, information about the poll
	Venue                         Venue                         `json:"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
	Location                      Location                      `json:"location"`                          // Optional. Message is a shared location, information about the location
	NewChatMembers                []User                        `json:"new_chat_members"`                  // Optional. New members that were added to the group or supergroup and information about them (the bot itself may be one of these members)
	LeftChatMember                User                          `json:"left_chat_member"`                  // Optional. A member was removed from the group, information about them (this member may be the bot itself)
	NewChatTitle                  string                        `json:"new_chat_title"`                    // Optional. A chat title was changed to this value
	NewChatPhoto                  []PhotoSize                   `json:"new_chat_photo"`                    // Optional. A chat photo was change to this value
	DeleteChatPhoto               bool                          `json:"delete_chat_photo"`                 // Optional. Service message: the chat photo was deleted
	GroupChatCreated              bool                          `json:"group_chat_created"`                // Optional. Service message: the group has been created
	SupergroupChatCreated         bool                          `json:"supergroup_chat_created"`           // 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.
	ChannelChatCreated            bool                          `json:"channel_chat_created"`              // 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.
	MessageAutoDeleteTimerChanged MessageAutoDeleteTimerChanged `json:"message_auto_delete_timer_changed"` // Optional. Service message: auto-delete timer settings changed in the chat
	MigrateToChatID               int                           `json:"migrate_to_chat_id"`                // 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.
	MigrateFromChatID             int                           `json:"migrate_from_chat_id"`              // 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.
	Invoice                       Invoice                       `json:"invoice"`                           // Optional. Message is an invoice for a payment, information about the invoice. More about payments »
	SuccessfulPayment             SuccessfulPayment             `json:"successful_payment"`                // Optional. Message is a service message about a successful payment, information about the payment. More about payments »
	ConnectedWebsite              string                        `json:"connected_website"`                 // Optional. The domain name of the website on which the user has logged in. More about Telegram Login »
	PassportData                  PassportData                  `json:"passport_data"`                     // Optional. Telegram Passport data
	ProximityAlertTriggered       ProximityAlertTriggered       `json:"proximity_alert_triggered"`         // Optional. Service message. A user in the chat triggered another user's proximity alert while sharing Live Location.
	VoiceChatScheduled            VoiceChatScheduled            `json:"voice_chat_scheduled"`              // Optional. Service message: voice chat scheduled
	VoiceChatStarted              VoiceChatStarted              `json:"voice_chat_started"`                // Optional. Service message: voice chat started
	VoiceChatEnded                VoiceChatEnded                `json:"voice_chat_ended"`                  // Optional. Service message: voice chat ended
	VoiceChatParticipantsInvited  VoiceChatParticipantsInvited  `json:"voice_chat_participants_invited"`   // Optional. Service message: new participants invited to a voice chat
	ReplyMarkup                   InlineKeyboardMarkup          `json:"reply_markup"`                      // Optional. Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons.
	PinnedMessage                 PinnedMessage                 `json:"pinned_message"`                    // Optional. Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it is itself a reply.

}

type MessageAutoDeleteTimerChanged

type MessageAutoDeleteTimerChanged struct {
	MessageAutoDeleteTime int `json:"message_auto_delete_time"` // New auto-delete time for messages in the chat; in seconds
}

type MessageEntity

type MessageEntity struct {
	Type     string `json:"type"`     // Type of the entity. Currently, can be "mention" (@username), "hashtag" (#hashtag), "cashtag" ($USD), "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), "code" (monowidth string), "pre" (monowidth block), "text_link" (for clickable text URLs), "text_mention" (for users without usernames)
	Offset   int    `json:"offset"`   // Offset in UTF-16 code units to the start of the entity
	Length   int    `json:"length"`   // Length of the entity in UTF-16 code units
	Url      string `json:"url"`      // Optional. For "text_link" only, url that will be opened after user taps on the text
	User     User   `json:"user"`     // Optional. For "text_mention" only, the mentioned user
	Language string `json:"language"` // Optional. For "pre" only, the programming language of the entity text
}

type OrderInfo

type OrderInfo struct {
	Name            string          `json:"name"`             // Optional. User name
	PhoneNumber     string          `json:"phone_number"`     // Optional. User's phone number
	Email           string          `json:"email"`            // Optional. User email
	ShippingAddress ShippingAddress `json:"shipping_address"` // Optional. User shipping address
}

type PassportData

type PassportData struct {
	Data        []EncryptedPassportElement `json:"data"`        // Array with information about documents and other Telegram Passport elements that was shared with the bot
	Credentials EncryptedCredentials       `json:"credentials"` // Encrypted credentials required to decrypt the data
}

type PassportFile

type PassportFile struct {
	FileID       string `json:"file_id"`        // Identifier for this file, which can be used to download or reuse the file
	FileUniqueID string `json:"file_unique_id"` // Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
	FileSize     int    `json:"file_size"`      // File size in bytes
	FileDate     int    `json:"file_date"`      // Unix time when the file was uploaded
}

type PhotoSize

type PhotoSize struct {
	FileID       string `json:"file_id"`        // Identifier for this file, which can be used to download or reuse the file
	FileUniqueID string `json:"file_unique_id"` // Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
	Width        int    `json:"width"`          // Photo width
	Height       int    `json:"height"`         // Photo height
	FileSize     int    `json:"file_size"`      // Optional. File size in bytes
}

type PinnedMessage

type PinnedMessage struct {
	Id            int    `json:"id"`
	FirstName     string `json:"first_name"`
	LastName      string `json:"last_name"`
	Username      string `json:"username"`
	Type          string `json:"type"`
	PinnedMessage struct {
		MessageId int  `json:"message_id"`
		From      User `json:"from"`
		Chat      struct {
			Id           int    `json:"id"`
			IsBot        bool   `json:"is_bot"`
			FirstName    string `json:"first_name"`
			LastName     string `json:"last_name"`
			Username     string `json:"username"`
			LanguageCode string `json:"language_code"`
		} `json:"chat"`
		Date int    `json:"date"`
		Text string `json:"text"`
	} `json:"pinned_message"`
}

type Poll

type Poll struct {
	ID                    string          `json:"id"`                      // Unique poll identifier
	Question              string          `json:"question"`                // Poll question, 1-300 characters
	Options               []PollOption    `json:"options"`                 // List of poll options
	TotalVoterCount       int             `json:"total_voter_count"`       // Total number of users that voted in the poll
	IsClosed              bool            `json:"is_closed"`               // True, if the poll is closed
	IsAnonymous           bool            `json:"is_anonymous"`            // True, if the poll is anonymous
	Type                  string          `json:"type"`                    // Poll type, currently can be "regular" or "quiz"
	AllowsMultipleAnswers bool            `json:"allows_multiple_answers"` // True, if the poll allows multiple answers
	CorrectOptionID       int             `json:"correct_option_id"`       // Optional. 0-based identifier of the correct answer option. Available only for polls in the quiz mode, which are closed, or was sent (not forwarded) by the bot or to the private chat with the bot.
	Explanation           string          `json:"explanation"`             // Optional. Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters
	ExplanationEntities   []MessageEntity `json:"explanation_entities"`    // Optional. Special entities like usernames, URLs, bot commands, etc. that appear in the explanation
	OpenPeriod            int             `json:"open_period"`             // Optional. Amount of time in seconds the poll will be active after creation
	CloseDate             int             `json:"close_date"`              // Optional. Point in time (Unix timestamp) when the poll will be automatically closed
}

type PollOption

type PollOption struct {
	Text       string `json:"text"`        // Option text, 1-100 characters
	VoterCount int    `json:"voter_count"` // Number of users that voted for this option
}

type ProximityAlertTriggered

type ProximityAlertTriggered struct {
	Traveler User `json:"traveler"` // User that triggered the alert
	Watcher  User `json:"watcher"`  // User that set the alert
	Distance int  `json:"distance"` // The distance between the users
}

type SendMessageReturn

type SendMessageReturn struct {
	BasicReturn

	Message Message `json:"result"`
}

type ShippingAddress

type ShippingAddress struct {
	CountryCode string `json:"country_code"` // ISO 3166-1 alpha-2 country code
	State       string `json:"state"`        // State, if applicable
	City        string `json:"city"`         // City
	StreetLine1 string `json:"street_line1"` // First line for the address
	StreetLine2 string `json:"street_line2"` // Second line for the address
	PostCode    string `json:"post_code"`    // Address post code
}

type Sticker

type Sticker struct {
	FileID       string       `json:"file_id"`        // Identifier for this file, which can be used to download or reuse the file
	FileUniqueID string       `json:"file_unique_id"` // Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
	Width        int          `json:"width"`          // Sticker width
	Height       int          `json:"height"`         // Sticker height
	IsAnimated   bool         `json:"is_animated"`    // True, if the sticker is animated
	IsVideo      bool         `json:"is_video"`       // True, if the sticker is a video sticker
	Thumb        PhotoSize    `json:"thumb"`          // Optional. Sticker thumbnail in the .WEBP or .JPG format
	Emoji        string       `json:"emoji"`          // Optional. Emoji associated with the sticker
	SetName      string       `json:"set_name"`       // Optional. Name of the sticker set to which the sticker belongs
	MaskPosition MaskPosition `json:"mask_position"`  // Optional. For mask stickers, the position where the mask should be placed
	FileSize     int          `json:"file_size"`      // Optional. File size in bytes
}

type SuccessfulPayment

type SuccessfulPayment struct {
	Currency                string    `json:"currency"`                   // Three-letter ISO 4217 currency code
	TotalAmount             int       `json:"total_amount"`               // Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).
	InvoicePayload          string    `json:"invoice_payload"`            // Bot specified invoice payload
	ShippingOptionID        string    `json:"shipping_option_id"`         // Optional. Identifier of the shipping option chosen by the user
	OrderInfo               OrderInfo `json:"order_info"`                 // Optional. Order info provided by the user
	TelegramPaymentChargeID string    `json:"telegram_payment_charge_id"` // Telegram payment identifier
	ProviderPaymentChargeID string    `json:"provider_payment_charge_id"` // Provider payment identifier
}

type User

type User struct {
	ID                      int    `json:"id"`                          // Unique identifier for this user or bot. 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.
	IsBot                   bool   `json:"is_bot"`                      // True, if this user is a bot
	FirstName               string `json:"first_name"`                  // User's or bot's first name
	LastName                string `json:"last_name"`                   // User's or bot's first name
	UserName                string `json:"user_name"`                   // Optional. User's or bot's username
	LanguageCOde            string `json:"language_code"`               // Optional. IETF language tag of the user's language
	CanJoinGroups           bool   `json:"can_join_groups"`             // Optional. True, if the bot can be invited to groups. Returned only in getMe.
	CanReadAllGroupMessages bool   `json:"can_read_all_group_messages"` // Optional. True, if privacy mode is disabled for the bot. Returned only in getMe.
	SupportsInlineQueries   bool   `json:"supports_inline_queries"`     // Optional. True, if the bot supports inline queries. Returned only in getMe.
}

type Venue

type Venue struct {
	Location        Location `json:"location"`          // Venue location. Can't be a live location
	Title           string   `json:"title"`             // Name of the venue
	Address         string   `json:"address"`           // Address of the venue
	FoursquareID    string   `json:"foursquare_id"`     // Optional. Foursquare identifier of the venue
	FoursquareType  string   `json:"foursquare_type"`   // Optional. Foursquare type of the venue. (For example, "arts_entertainment/default", "arts_entertainment/aquarium" or "food/icecream".)
	GooglePlaceID   string   `json:"google_place_id"`   // Optional. Google Places identifier of the venue
	GooglePlaceType string   `json:"google_place_type"` // Optional. Google Places type of the venue. (See supported types.)
}

type Video

type Video struct {
	FileID       string    `json:"file_id"`        // Identifier for this file, which can be used to download or reuse the file
	FileUniqueID string    `json:"file_unique_id"` // Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
	Width        int       `json:"width"`          // Video width as defined by sender
	Height       int       `json:"height"`         // Video height as defined by sender
	Duration     int       `json:"duration"`       // Duration of the video in seconds as defined by sender
	Thumb        PhotoSize `json:"thumb"`          // Optional. Video thumbnail
	FileName     string    `json:"file_name"`      // Optional. Original filename as defined by sender
	MimeType     string    `json:"mime_type"`      // Optional. Mime type of a file as defined by sender
	FileSize     int       `json:"file_size"`      // Optional. File size in bytes
}

type VideoNote

type VideoNote struct {
	FileID       string    `json:"file_id"`        // Identifier for this file, which can be used to download or reuse the file
	FileUniqueID string    `json:"file_unique_id"` // Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
	Length       int       `json:"length"`         // Video width and height (diameter of the video message) as defined by sender
	Duration     int       `json:"duration"`       // Duration of the video in seconds as defined by sender
	Thumb        PhotoSize `json:"thumb"`          // Optional. Video thumbnail
	FileSize     int       `json:"file_size"`      // Optional. File size in bytes
}

type Voice

type Voice struct {
	FileID       string `json:"file_id"`        // Identifier for this file, which can be used to download or reuse the file
	FileUniqueID string `json:"file_unique_id"` // Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
	Duration     int    `json:"duration"`       // Duration of the audio in seconds as defined by sender
	MimeType     string `json:"mime_type"`      // Optional. MIME type of the file as defined by sender
	FileSize     int    `json:"file_size"`      // Optional. File size in bytes
}

type VoiceChatEnded

type VoiceChatEnded struct {
	Duration int `json:"duration"` // Voice chat duration in seconds
}

type VoiceChatParticipantsInvited

type VoiceChatParticipantsInvited struct {
	Users []User `json:"users"` // Optional. New members that were invited to the voice chat
}

type VoiceChatScheduled

type VoiceChatScheduled struct {
	StartDate int `json:"start_date"` // Point in time (Unix timestamp) when the voice chat is supposed to be started by a chat administrator
}

type VoiceChatStarted

type VoiceChatStarted struct {
}

Directories

Path Synopsis
* @Author: McPlus * @Date: 2022-03-14 18:26:05 * @LastEditTime: 2022-03-19 18:08:58 * @LastEdit: McPlus * @Description: Chat方法 * @FilePath: \Momizi\Internal\MessageSend\ChatSoftwareAPI\Telegram\Methods\Chat.go
* @Author: McPlus * @Date: 2022-03-14 18:26:05 * @LastEditTime: 2022-03-19 18:08:58 * @LastEdit: McPlus * @Description: Chat方法 * @FilePath: \Momizi\Internal\MessageSend\ChatSoftwareAPI\Telegram\Methods\Chat.go

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL