Documentation
¶
Index ¶
- Constants
- Variables
- func Err(s string) error
- type AccessibleMessage
- func (u *AccessibleMessage) IsService() bool
- func (u *AccessibleMessage) MarshalJSON() ([]byte, error)
- func (u *AccessibleMessage) MessageSig() (Recipient, int64)
- func (u *AccessibleMessage) MessageType() string
- func (u *AccessibleMessage) ReflectType() string
- func (u *AccessibleMessage) String() string
- func (u *AccessibleMessage) Type() string
- func (u *AccessibleMessage) UnmarshalJSON(b []byte) error
- func (u *AccessibleMessage) Verify() error
- type Animation
- func (a *Animation) File() *File
- func (a *Animation) MarshalJSON() ([]byte, error)
- func (a *Animation) ReflectType() string
- func (a *Animation) Send(b Bot, to Recipient, options ...any) (Message, error)
- func (a *Animation) String() string
- func (a *Animation) Type() string
- func (a *Animation) UnmarshalJSON(data []byte) error
- func (a *Animation) Verify() error
- type Audio
- func (a *Audio) File() *File
- func (a *Audio) MarshalJSON() ([]byte, error)
- func (a *Audio) ReflectType() string
- func (a *Audio) Send(b Bot, to Recipient, options ...any) (Message, error)
- func (a *Audio) String() string
- func (a *Audio) Type() string
- func (a *Audio) UnmarshalJSON(data []byte) error
- func (a *Audio) Verify() error
- type AutoDeleteTimerChanged
- func (a *AutoDeleteTimerChanged) MarshalJSON() ([]byte, error)
- func (a *AutoDeleteTimerChanged) ReflectType() string
- func (a *AutoDeleteTimerChanged) String() string
- func (a *AutoDeleteTimerChanged) Type() string
- func (a *AutoDeleteTimerChanged) UnmarshalJSON(data []byte) error
- func (a *AutoDeleteTimerChanged) Verify() error
- type BirthDate
- type BoostRemoved
- type BoostSource
- type BoostUpdated
- type Bot
- type BotCommand
- type BotCommandScope
- type BotCommandScopeType
- type BotSettings
- type BusinessConnection
- type BusinessID
- type BusinessIntro
- type BusinessLocation
- type BusinessMessagesDeleted
- type BusinessOpeningHours
- type Button
- type Callback
- func (c *Callback) CallbackUnique() string
- func (c *Callback) IsInline() bool
- func (c *Callback) MarshalJSON() ([]byte, error)
- func (c *Callback) ReflectType() string
- func (c *Callback) String() string
- func (c *Callback) Type() string
- func (c *Callback) UnmarshalJSON(b []byte) error
- func (c *Callback) Verify() error
- type CallbackEndpoint
- type CallbackGame
- type Chat
- type ChatAction
- type ChatBoost
- type ChatBoostAdded
- type ChatBoostSource
- type ChatInviteLink
- type ChatJoinRequest
- func (c *ChatJoinRequest) MarshalJSON() ([]byte, error)
- func (c *ChatJoinRequest) Recipient() string
- func (c *ChatJoinRequest) ReflectType() string
- func (c *ChatJoinRequest) String() string
- func (c *ChatJoinRequest) Type() string
- func (c *ChatJoinRequest) UnmarshalJSON(b []byte) error
- func (c *ChatJoinRequest) Verify() error
- type ChatLocation
- type ChatMember
- type ChatMemberPermission
- type ChatMemberUpdated
- type ChatPermissions
- type ChatPhoto
- type ChatShared
- type ChatType
- type ChosenInlineResult
- type Contact
- type Context
- type CustomEmoji
- type Dice
- type DiceEmoji
- type Document
- func (d *Document) File() *File
- func (d *Document) MarshalJSON() ([]byte, error)
- func (d *Document) ReflectType() string
- func (d *Document) Send(b Bot, to Recipient, options ...any) (Message, error)
- func (d *Document) String() string
- func (d *Document) Type() string
- func (d *Document) UnmarshalJSON(data []byte) error
- func (d *Document) Verify() error
- type Emoji
- type EncryptedCredentials
- func (c *EncryptedCredentials) MarshalJSON() ([]byte, error)
- func (c *EncryptedCredentials) ReflectType() string
- func (f *EncryptedCredentials) String() string
- func (c *EncryptedCredentials) Type() string
- func (c *EncryptedCredentials) UnmarshalJSON(data []byte) error
- func (c *EncryptedCredentials) Verify() error
- type EncryptedPassportElement
- func (c *EncryptedPassportElement) MarshalJSON() ([]byte, error)
- func (c *EncryptedPassportElement) ReflectType() string
- func (f *EncryptedPassportElement) String() string
- func (c *EncryptedPassportElement) Type() string
- func (c *EncryptedPassportElement) UnmarshalJSON(data []byte) error
- func (c *EncryptedPassportElement) Verify() error
- type Entity
- type EntityType
- type Equal
- type Error
- type ExternalReplyInfo
- type File
- func (f *File) Download() ([]byte, error)
- func (f *File) GetFileID() string
- func (f *File) GetFileLocal() string
- func (f *File) GetFileName() string
- func (f *File) GetFilePath() string
- func (f *File) GetFileReader() io.Reader
- func (f *File) GetFileSize() int64
- func (f *File) GetFileURL() string
- func (f *File) InCloud() bool
- func (f *File) MarshalJSON() ([]byte, error)
- func (f *File) OnDisk() bool
- func (f *File) ReflectType() string
- func (f *File) SetFileName(fileName string)
- func (f *File) String() string
- func (f *File) Type() string
- func (f *File) URL() string
- func (f *File) UnmarshalJSON(data []byte) error
- func (f *File) Verify() error
- type FloodError
- type ForceReplyMarkup
- type ForumTopic
- type ForumTopicClosed
- type ForumTopicCreated
- type ForumTopicEdited
- type ForumTopicReopened
- func (f *ForumTopicReopened) MarshalJSON() ([]byte, error)
- func (c *ForumTopicReopened) ReflectType() string
- func (f *ForumTopicReopened) String() string
- func (c *ForumTopicReopened) Type() string
- func (f *ForumTopicReopened) UnmarshalJSON(data []byte) error
- func (f *ForumTopicReopened) Verify() error
- type Game
- type GameHighScore
- type GeneralForumTopicHidden
- func (f *GeneralForumTopicHidden) MarshalJSON() ([]byte, error)
- func (c *GeneralForumTopicHidden) ReflectType() string
- func (f *GeneralForumTopicHidden) String() string
- func (c *GeneralForumTopicHidden) Type() string
- func (f *GeneralForumTopicHidden) UnmarshalJSON(data []byte) error
- func (f *GeneralForumTopicHidden) Verify() error
- type GeneralForumTopicUnhidden
- func (f *GeneralForumTopicUnhidden) MarshalJSON() ([]byte, error)
- func (c *GeneralForumTopicUnhidden) ReflectType() string
- func (f *GeneralForumTopicUnhidden) String() string
- func (c *GeneralForumTopicUnhidden) Type() string
- func (f *GeneralForumTopicUnhidden) UnmarshalJSON(data []byte) error
- func (f *GeneralForumTopicUnhidden) Verify() error
- type Giveaway
- type GiveawayCompleted
- type GiveawayCreated
- type GiveawayWinners
- type Group
- type GroupError
- type HandlerFunc
- type Height
- type IFile
- type IconColor
- type InaccessibleMessage
- func (u *InaccessibleMessage) MarshalJSON() ([]byte, error)
- func (u *InaccessibleMessage) MessageSig() (Recipient, int64)
- func (u *InaccessibleMessage) MessageType() string
- func (u *InaccessibleMessage) ReflectType() string
- func (u *InaccessibleMessage) String() string
- func (u *InaccessibleMessage) Type() string
- func (u *InaccessibleMessage) UnmarshalJSON(b []byte) error
- func (u *InaccessibleMessage) Verify() error
- type InlineKeyboardButton
- func (*InlineKeyboardButton) Button()
- func (i *InlineKeyboardButton) Clone() Button
- func (i *InlineKeyboardButton) GetText() string
- func (i *InlineKeyboardButton) MarshalJSON() ([]byte, error)
- func (i *InlineKeyboardButton) ReflectType() string
- func (i *InlineKeyboardButton) SetText(t string)
- func (i *InlineKeyboardButton) String() string
- func (i *InlineKeyboardButton) Type() string
- func (i *InlineKeyboardButton) UnmarshalJSON(data []byte) error
- func (i *InlineKeyboardButton) Verify() error
- type InlineKeyboardMarkup
- func (m *InlineKeyboardMarkup) MarshalJSON() ([]byte, error)
- func (m *InlineKeyboardMarkup) ReflectType() string
- func (m *InlineKeyboardMarkup) String() string
- func (m *InlineKeyboardMarkup) Type() string
- func (m *InlineKeyboardMarkup) UnmarshalJSON(data []byte) error
- func (m *InlineKeyboardMarkup) Verify() error
- type InlineQuery
- type InlineQueryButton
- type InlineQueryResultType
- type InputContactMessageContent
- func (i *InputContactMessageContent) InputMessageContent()
- func (c *InputContactMessageContent) MarshalJSON() ([]byte, error)
- func (c *InputContactMessageContent) ReflectType() string
- func (f *InputContactMessageContent) String() string
- func (c *InputContactMessageContent) Type() string
- func (c *InputContactMessageContent) UnmarshalJSON(data []byte) error
- func (c *InputContactMessageContent) Verify() error
- type InputInvoiceMessageContent
- func (i *InputInvoiceMessageContent) InputMessageContent()
- func (c *InputInvoiceMessageContent) MarshalJSON() ([]byte, error)
- func (c *InputInvoiceMessageContent) ReflectType() string
- func (f *InputInvoiceMessageContent) String() string
- func (c *InputInvoiceMessageContent) Type() string
- func (c *InputInvoiceMessageContent) UnmarshalJSON(data []byte) error
- func (c *InputInvoiceMessageContent) Verify() error
- type InputLocationMessageContent
- func (i *InputLocationMessageContent) InputMessageContent()
- func (c *InputLocationMessageContent) MarshalJSON() ([]byte, error)
- func (c *InputLocationMessageContent) ReflectType() string
- func (f *InputLocationMessageContent) String() string
- func (c *InputLocationMessageContent) Type() string
- func (c *InputLocationMessageContent) UnmarshalJSON(data []byte) error
- func (c *InputLocationMessageContent) Verify() error
- type InputMedia
- type InputMediaType
- type InputMessageContent
- type InputSticker
- func (s *InputSticker) FileRepresent() string
- func (s *InputSticker) MarshalJSON() ([]byte, error)
- func (s *InputSticker) ReflectType() string
- func (s *InputSticker) String() string
- func (s *InputSticker) Type() string
- func (s *InputSticker) UnmarshalJSON(data []byte) error
- func (s *InputSticker) Verify() error
- type InputTextMessageContent
- func (i *InputTextMessageContent) InputMessageContent()
- func (c *InputTextMessageContent) MarshalJSON() ([]byte, error)
- func (c *InputTextMessageContent) ReflectType() string
- func (f *InputTextMessageContent) String() string
- func (c *InputTextMessageContent) Type() string
- func (c *InputTextMessageContent) UnmarshalJSON(data []byte) error
- func (c *InputTextMessageContent) Verify() error
- type InputVenueMessageContent
- func (i *InputVenueMessageContent) InputMessageContent()
- func (c *InputVenueMessageContent) MarshalJSON() ([]byte, error)
- func (c *InputVenueMessageContent) ReflectType() string
- func (f *InputVenueMessageContent) String() string
- func (c *InputVenueMessageContent) Type() string
- func (c *InputVenueMessageContent) UnmarshalJSON(data []byte) error
- func (c *InputVenueMessageContent) Verify() error
- type Invoice
- type JSONer
- type KeyboardButton
- func (*KeyboardButton) Button()
- func (i *KeyboardButton) Clone() Button
- func (i *KeyboardButton) GetText() string
- func (i *KeyboardButton) MarshalJSON() ([]byte, error)
- func (i *KeyboardButton) ReflectType() string
- func (i *KeyboardButton) SetText(t string)
- func (i *KeyboardButton) String() string
- func (i *KeyboardButton) Type() string
- func (i *KeyboardButton) UnmarshalJSON(data []byte) error
- func (i *KeyboardButton) Verify() error
- type KeyboardButtonPollType
- func (i *KeyboardButtonPollType) MarshalJSON() ([]byte, error)
- func (i *KeyboardButtonPollType) ReflectType() string
- func (i *KeyboardButtonPollType) String() string
- func (i *KeyboardButtonPollType) Type() string
- func (i *KeyboardButtonPollType) UnmarshalJSON(data []byte) error
- func (i *KeyboardButtonPollType) Verify() error
- type KeyboardButtonRequestChat
- func (i *KeyboardButtonRequestChat) MarshalJSON() ([]byte, error)
- func (i *KeyboardButtonRequestChat) ReflectType() string
- func (i *KeyboardButtonRequestChat) String() string
- func (i *KeyboardButtonRequestChat) Type() string
- func (i *KeyboardButtonRequestChat) UnmarshalJSON(data []byte) error
- func (i *KeyboardButtonRequestChat) Verify() error
- type KeyboardButtonRequestUsers
- func (i *KeyboardButtonRequestUsers) MarshalJSON() ([]byte, error)
- func (i *KeyboardButtonRequestUsers) ReflectType() string
- func (i *KeyboardButtonRequestUsers) String() string
- func (i *KeyboardButtonRequestUsers) Type() string
- func (i *KeyboardButtonRequestUsers) UnmarshalJSON(data []byte) error
- func (i *KeyboardButtonRequestUsers) Verify() error
- type LabeledPrice
- type LinkPreviewOptions
- func (f *LinkPreviewOptions) MarshalJSON() ([]byte, error)
- func (c *LinkPreviewOptions) ReflectType() string
- func (f *LinkPreviewOptions) String() string
- func (c *LinkPreviewOptions) Type() string
- func (f *LinkPreviewOptions) UnmarshalJSON(data []byte) error
- func (f *LinkPreviewOptions) Verify() error
- type Location
- type LoginURL
- type LongPoller
- type MaskPosition
- type MaxTipAmount
- type MaybeInaccessibleMessage
- func (u *MaybeInaccessibleMessage) IsAccessible() bool
- func (u *MaybeInaccessibleMessage) MarshalJSON() ([]byte, error)
- func (u *MaybeInaccessibleMessage) MessageType() string
- func (u *MaybeInaccessibleMessage) ReflectType() string
- func (u *MaybeInaccessibleMessage) String() string
- func (u *MaybeInaccessibleMessage) Type() string
- func (u *MaybeInaccessibleMessage) UnmarshalJSON(b []byte) error
- func (u *MaybeInaccessibleMessage) Verify() error
- type MenuButton
- type MenuButtonType
- type Message
- type MessageOrigin
- type MessageOriginType
- type MessageReaction
- type MessageReactionCountUpdated
- func (r *MessageReactionCountUpdated) MarshalJSON() ([]byte, error)
- func (r *MessageReactionCountUpdated) ReflectType() string
- func (r *MessageReactionCountUpdated) String() string
- func (r *MessageReactionCountUpdated) Type() string
- func (r *MessageReactionCountUpdated) UnmarshalJSON(b []byte) error
- func (r *MessageReactionCountUpdated) Verify() error
- type MessageThreadID
- type MiddlewareFunc
- type MiddlewarePoller
- type OpeningHours
- type Option
- type OrderInfo
- type ParseMode
- type PassportData
- type PassportElementError
- func (c *PassportElementError) MarshalJSON() ([]byte, error)
- func (c *PassportElementError) ReflectType() string
- func (f *PassportElementError) String() string
- func (c *PassportElementError) Type() string
- func (c *PassportElementError) UnmarshalJSON(data []byte) error
- func (c *PassportElementError) Verify() error
- type PassportFile
- func (c *PassportFile) File() *File
- func (c *PassportFile) MarshalJSON() ([]byte, error)
- func (c *PassportFile) ReflectType() string
- func (f *PassportFile) String() string
- func (c *PassportFile) Type() string
- func (c *PassportFile) UnmarshalJSON(data []byte) error
- func (c *PassportFile) Verify() error
- type Performer
- type PhotoSize
- func (p *PhotoSize) File() *File
- func (p *PhotoSize) MarshalJSON() ([]byte, error)
- func (p *PhotoSize) ReflectType() string
- func (p *PhotoSize) Send(b Bot, to Recipient, options ...any) (Message, error)
- func (p *PhotoSize) String() string
- func (p *PhotoSize) Type() string
- func (p *PhotoSize) UnmarshalJSON(data []byte) error
- func (p *PhotoSize) Verify() error
- type PhotoSizes
- type PhotoURL
- type PictureSize
- type Poll
- type PollAnswer
- type PollOption
- type PollType
- type Poller
- type PreCheckoutQuery
- type ProviderData
- type ProximityAlertTriggered
- func (f *ProximityAlertTriggered) MarshalJSON() ([]byte, error)
- func (c *ProximityAlertTriggered) ReflectType() string
- func (f *ProximityAlertTriggered) String() string
- func (c *ProximityAlertTriggered) Type() string
- func (f *ProximityAlertTriggered) UnmarshalJSON(data []byte) error
- func (f *ProximityAlertTriggered) Verify() error
- type QueryResult
- type QueryResults
- type ReactionCount
- type ReactionType
- type ReactionTypeType
- type Recipient
- type ReplyKeyboardMarkup
- func (m *ReplyKeyboardMarkup) MarshalJSON() ([]byte, error)
- func (m *ReplyKeyboardMarkup) ReflectType() string
- func (m *ReplyKeyboardMarkup) String() string
- func (m *ReplyKeyboardMarkup) Type() string
- func (m *ReplyKeyboardMarkup) UnmarshalJSON(data []byte) error
- func (m *ReplyKeyboardMarkup) Verify() error
- type ReplyKeyboardRemove
- func (m *ReplyKeyboardRemove) MarshalJSON() ([]byte, error)
- func (m *ReplyKeyboardRemove) ReflectType() string
- func (m *ReplyKeyboardRemove) String() string
- func (m *ReplyKeyboardRemove) Type() string
- func (m *ReplyKeyboardRemove) UnmarshalJSON(data []byte) error
- func (m *ReplyKeyboardRemove) Verify() error
- type ReplyMarkup
- type ReplyParameters
- type RequestContact
- type RequestLocation
- type Rights
- type Row
- type Sendable
- type SentWebAppMessage
- type SharedUser
- type ShippingAddress
- type ShippingOption
- type ShippingQuery
- type StartParameter
- type Status
- type Sticker
- type StickerEmoji
- type StickerFormat
- type StickerSet
- type StickerType
- type Story
- type Stringer
- type SuccessfulPayment
- type SuggestedTopAmounts
- type SwitchInlineQueryChosenChat
- func (i *SwitchInlineQueryChosenChat) MarshalJSON() ([]byte, error)
- func (i *SwitchInlineQueryChosenChat) ReflectType() string
- func (i *SwitchInlineQueryChosenChat) String() string
- func (i *SwitchInlineQueryChosenChat) Type() string
- func (i *SwitchInlineQueryChosenChat) UnmarshalJSON(data []byte) error
- func (i *SwitchInlineQueryChosenChat) Verify() error
- type SwitchInlineQueryChosenChatStringType
- type SwitchInlineQueryStringType
- type TType
- type TextQuote
- type Title
- type Update
- type UpdateHandlerOn
- type UpdateType
- type Updates
- type User
- type UserChatBoosts
- func (boost *UserChatBoosts) MarshalJSON() ([]byte, error)
- func (boost *UserChatBoosts) ReflectType() string
- func (boost *UserChatBoosts) String() string
- func (boost *UserChatBoosts) Type() string
- func (boost *UserChatBoosts) UnmarshalJSON(data []byte) error
- func (boost *UserChatBoosts) Verify() error
- type UserProfilePhotos
- type Userable
- type UsersShared
- type Venue
- type Verifiable
- type Video
- func (v *Video) File() *File
- func (v *Video) MarshalJSON() ([]byte, error)
- func (v *Video) ReflectType() string
- func (v *Video) Send(b Bot, to Recipient, options ...any) (Message, error)
- func (v *Video) String() string
- func (v *Video) Type() string
- func (v *Video) UnmarshalJSON(data []byte) error
- func (v *Video) Verify() error
- type VideoChatEnded
- type VideoChatParticipantsInvited
- func (f *VideoChatParticipantsInvited) MarshalJSON() ([]byte, error)
- func (c *VideoChatParticipantsInvited) ReflectType() string
- func (f *VideoChatParticipantsInvited) String() string
- func (c *VideoChatParticipantsInvited) Type() string
- func (f *VideoChatParticipantsInvited) UnmarshalJSON(data []byte) error
- func (f *VideoChatParticipantsInvited) Verify() error
- type VideoChatScheduled
- func (f *VideoChatScheduled) MarshalJSON() ([]byte, error)
- func (c *VideoChatScheduled) ReflectType() string
- func (f *VideoChatScheduled) String() string
- func (c *VideoChatScheduled) Type() string
- func (f *VideoChatScheduled) UnmarshalJSON(data []byte) error
- func (f *VideoChatScheduled) Verify() error
- type VideoChatStarted
- type VideoNote
- func (v *VideoNote) File() *File
- func (v *VideoNote) MarshalJSON() ([]byte, error)
- func (v *VideoNote) ReflectType() string
- func (v *VideoNote) Send(b Bot, to Recipient, options ...any) (Message, error)
- func (v *VideoNote) String() string
- func (v *VideoNote) Type() string
- func (v *VideoNote) UnmarshalJSON(data []byte) error
- func (v *VideoNote) Verify() error
- type Voice
- func (v *Voice) File() *File
- func (v *Voice) MarshalJSON() ([]byte, error)
- func (v *Voice) ReflectType() string
- func (v *Voice) Send(b Bot, to Recipient, options ...any) (Message, error)
- func (v *Voice) String() string
- func (v *Voice) Type() string
- func (v *Voice) UnmarshalJSON(data []byte) error
- func (v *Voice) Verify() error
- type WebAppData
- type WebAppInfo
- type Width
- type WriteAccessAllowed
- func (f *WriteAccessAllowed) MarshalJSON() ([]byte, error)
- func (c *WriteAccessAllowed) ReflectType() string
- func (f *WriteAccessAllowed) String() string
- func (c *WriteAccessAllowed) Type() string
- func (f *WriteAccessAllowed) UnmarshalJSON(data []byte) error
- func (f *WriteAccessAllowed) Verify() error
Constants ¶
const ( AccessibleMessageType = "AccessibleMessage" MaybeInaccessibleMessageType = "MaybeInaccessibleMessage" InaccessibleMessageType = "InaccessibleMessage" )
const Unknown = "unknown"
Variables ¶
var ( ErrTooLarge = NewError(400, "Request Entity Too Large") ErrNotFound = NewError(404, "Not Found") ErrInternal = NewError(500, "Internal Server Error") ErrNotClosed = NewError(400, "Bad Request: failed to close the bot account") )
General errors
var ( ErrNoMessageToMarshal = NewError(400, "Bad Type: no message to marshal (nil message)") ErrUnsupportedButton = NewError(400, "Bad Type: unsupported button") ErrNoMessageToSend = NewError(400, "Bad Type: no message to send (nil message)") ErrNoMessageToReply = NewError(400, "Bad Type: no message to reply (nil message)") ErrNoMessageToForward = NewError(400, "Bad Type: no message to forward (nil message)") )
Bad Type Errors
var ( ErrBadButtonData = NewError(400, "Bad Request: BUTTON_DATA_INVALID") ErrBadPollOptions = NewError(400, "Bad Request: expected an Array of String as options") ErrBadURLContent = NewError(400, "Bad Request: failed to get HTTP URL content") ErrCantEditMessage = NewError(400, "Bad Request: message can't be edited") ErrCantRemoveOwner = NewError(400, "Bad Request: can't remove chat owner") ErrCantUploadFile = NewError(400, "Bad Request: can't upload file by URL") ErrCantUseMediaInAlbum = NewError(400, "Bad Request: can't use the media of the specified type in the album") ErrChatAboutNotModified = NewError(400, "Bad Request: chat description is not modified") ErrChatNotFound = NewError(400, "Bad Request: chat not found") ErrEmptyChatID = NewError(400, "Bad Request: chat_id is empty") ErrEmptyMessage = NewError(400, "Bad Request: message must be non-empty") ErrEmptyText = NewError(400, "Bad Request: text is empty") ErrFailedImageProcess = NewError(400, "Bad Request: IMAGE_PROCESS_FAILED", "Image process failed") ErrGroupMigrated = NewError(400, "Bad Request: group chat was upgraded to a supergroup chat") ErrMessageNotModified = NewError(400, "Bad Request: message is not modified") ErrNoRightsToDelete = NewError(400, "Bad Request: message can't be deleted") ErrNoRightsToRestrict = NewError(400, "Bad Request: not enough rights to restrict/unrestrict chat member") ErrNoRightsToSend = NewError(400, "Bad Request: have no rights to send a message") ErrNoRightsToSendGifs = NewError(400, "Bad Request: CHAT_SEND_GIFS_FORBIDDEN", "sending GIFS is not allowed in this chat") ErrNoRightsToSendPhoto = NewError(400, "Bad Request: not enough rights to send photos to the chat") ErrNoRightsToSendStickers = NewError(400, "Bad Request: not enough rights to send stickers to the chat") ErrNotFoundToDelete = NewError(400, "Bad Request: message to delete not found") ErrNotFoundToForward = NewError(400, "Bad Request: message to forward not found") ErrNotFoundToReply = NewError(400, "Bad Request: reply message not found") ErrQueryTooOld = NewError(400, "Bad Request: query is too old and response timeout expired or query ID is invalid") ErrSameMessageContent = NewError(400, "Bad Request: message is not modified: specified new message content and reply markup are exactly the same as a current content and reply markup of the message") ErrStickerEmojisInvalid = NewError(400, "Bad Request: invalid sticker emojis") ErrStickerSetInvalid = NewError(400, "Bad Request: STICKERSET_INVALID", "Stickerset is invalid") ErrStickerSetInvalidName = NewError(400, "Bad Request: invalid sticker set name is specified") ErrStickerSetNameOccupied = NewError(400, "Bad Request: sticker set name is already occupied") ErrTooLongMarkup = NewError(400, "Bad Request: reply markup is too long") ErrTooLongMessage = NewError(400, "Bad Request: message is too long") ErrUserIsAdmin = NewError(400, "Bad Request: user is an administrator of the chat") ErrWrongFileID = NewError(400, "Bad Request: wrong file identifier/HTTP URL specified") ErrWrongFileIDCharacter = NewError(400, "Bad Request: wrong remote file id specified: Wrong character in the string") ErrWrongFileIDLength = NewError(400, "Bad Request: wrong remote file id specified: Wrong string length") ErrWrongFileIDPadding = NewError(400, "Bad Request: wrong remote file id specified: Wrong padding in the string") ErrWrongFileIDSymbol = NewError(400, "Bad Request: wrong remote file id specified: can't unserialize it. Wrong last symbol") ErrWrongTypeOfContent = NewError(400, "Bad Request: wrong type of the web page content") ErrWrongURL = NewError(400, "Bad Request: wrong HTTP URL specified") ErrForwardMessage = NewError(400, "Bad Request: administrators of the chat restricted message forwarding") )
Bad request errors
var ( ErrBlockedByUser = NewError(403, "Forbidden: bot was blocked by the user") ErrKickedFromGroup = NewError(403, "Forbidden: bot was kicked from the group chat") ErrKickedFromSuperGroup = NewError(403, "Forbidden: bot was kicked from the supergroup chat") ErrKickedFromChannel = NewError(403, "Forbidden: bot was kicked from the channel chat") ErrNotStartedByUser = NewError(403, "Forbidden: bot can't initiate conversation with a user") ErrUserIsDeactivated = NewError(403, "Forbidden: user is deactivated") )
Forbidden errors
var (
GeneralBadInputError = "telebot: unknown option type %T in %s"
)
Functions ¶
Types ¶
type AccessibleMessage ¶ added in v1.9.0
type AccessibleMessage struct { Command string `json:"-"` Payload string `json:"-"` ID int64 `json:"message_id"` ThreadID *int64 `json:"message_thread_id,omitempty"` From *User `json:"from,omitempty"` SenderChat *Chat `json:"sender_chat,omitempty"` Date int64 `json:"date"` Chat *Chat `json:"chat"` BusinessBot *User `json:"sender_business_bot,omitempty"` BusinessConnectionID *int64 `json:"business_connection_id,omitempty"` IsFromOffline *bool `json:"is_from_offline,omitempty"` ForwardOrigin *MessageOrigin `json:"forward_origin,omitempty"` IsTopic *bool `json:"is_topic_message,omitempty"` IsAutomaticForward *bool `json:"is_automatic_forward,omitempty"` ReplyTo *AccessibleMessage `json:"reply_to_message,omitempty"` ReplyToStory *Story `json:"reply_to_story,omitempty"` ExternalReply *ExternalReplyInfo `json:"external_reply,omitempty"` Quote *TextQuote `json:"quote,omitempty"` ViaBot *User `json:"via_bot,omitempty"` EditDate *int64 `json:"edit_date,omitempty"` HasProtectedContent *bool `json:"has_protected_content,omitempty"` MediaGroupID *string `json:"media_group_id,omitempty"` AuthorSignature *string `json:"author_signature,omitempty"` Entities []Entity `json:"entities,omitempty"` LinkPreviewOptions *LinkPreviewOptions `json:"link_preview_options,omitempty"` Caption *string `json:"caption,omitempty"` CaptionEntities []Entity `json:"caption_entities,omitempty"` HasMediaSpoiler *bool `json:"has_media_spoiler,omitempty"` Text *string `json:"text,omitempty"` Animation *Animation `json:"animation,omitempty"` Audio *Audio `json:"audio,omitempty"` Document *Document `json:"document,omitempty"` Photo PhotoSizes `json:"photo,omitempty"` Sticker *Sticker `json:"sticker,omitempty"` Story *Story `json:"story,omitempty"` Video *Video `json:"video,omitempty"` VideoNote *VideoNote `json:"video_note,omitempty"` Voice *Voice `json:"voice,omitempty"` Contact *Contact `json:"contact,omitempty"` Dice *Dice `json:"dice,omitempty"` Game *Game `json:"game,omitempty"` Poll *Poll `json:"poll,omitempty"` Venue *Venue `json:"venue,omitempty"` Location *Location `json:"location,omitempty"` NewChatMembers []User `json:"new_chat_members,omitempty"` LeftChatMember *User `json:"left_chat_member,omitempty"` NewChatTitle *string `json:"new_chat_title,omitempty"` NewChatPhoto PhotoSizes `json:"new_chat_photo,omitempty"` DeleteChatPhoto *bool `json:"delete_chat_photo,omitempty"` GroupChatCreated *bool `json:"group_chat_created,omitempty"` SupergroupChatCreated *bool `json:"supergroup_chat_created,omitempty"` ChannelChatCreated *bool `json:"channel_chat_created,omitempty"` AutoDeleteTimerChanged *AutoDeleteTimerChanged `json:"message_auto_delete_timer_changed,omitempty"` MigrateToChatID *int64 `json:"migrate_to_chat_id,omitempty"` MigrateFromChatID *int64 `json:"migrate_from_chat_id,omitempty"` PinnedMessage *MaybeInaccessibleMessage `json:"pinned_message,omitempty"` Invoice *Invoice `json:"invoice,omitempty"` SuccessfulPayment *SuccessfulPayment `json:"successful_payment,omitempty"` ConnectedWebsite *string `json:"connected_website,omitempty"` WriteAccessAllowed *WriteAccessAllowed `json:"write_access_allowed,omitempty"` PassportData *PassportData `json:"passport_data,omitempty"` ProximityAlertTriggered *ProximityAlertTriggered `json:"proximity_alert_triggered,omitempty"` ForumTopicCreated *ForumTopicCreated `json:"forum_topic_created,omitempty"` ForumTopicEdited *ForumTopicEdited `json:"forum_topic_edited,omitempty"` ForumTopicClosed *ForumTopicClosed `json:"forum_topic_closed,omitempty"` ForumTopicReopened *ForumTopicReopened `json:"forum_topic_reopened,omitempty"` GeneralForumTopicHidden *GeneralForumTopicHidden `json:"general_forum_topic_hidden,omitempty"` GiveawayCreated *GiveawayCreated `json:"giveaway_created,omitempty"` Giveaway *Giveaway `json:"giveaway,omitempty"` GiveawayWinners *GiveawayWinners `json:"giveaway_winners,omitempty"` GiveawayCompleted *GiveawayCompleted `json:"giveaway_completed,omitempty"` VideoChatScheduled *VideoChatScheduled `json:"video_chat_scheduled,omitempty"` VideoChatStarted *VideoChatStarted `json:"video_chat_started,omitempty"` VideoChatEnded *VideoChatEnded `json:"video_chat_ended,omitempty"` BoostAdded *ChatBoostAdded `json:"boost_added,omitempty"` SenderBoostCount *int `json:"sender_boost_count,omitempty"` VideoChatParticipantsInvited *VideoChatParticipantsInvited `json:"video_chat_participants_invited,omitempty"` WebAppData *WebAppData `json:"web_app_data,omitempty"` ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` }
AccessibleMessage This struct represents a Telegram message and includes various fields to capture different aspects of the message.
Fields: — ID (int64): Unique message identifier inside this chat. — ThreadID (int64): Optional. A unique identifier of a message thread to which the message belongs; for supergroups only. — From (*User): 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): 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 contains a fake sender user in non-channel chats if the message was sent on behalf of a chat. — Date (int64): Date the message was sent in Unix time. It is always a positive number, representing a valid date. — Chat (*Chat): Chat the message belongs to. — ForwardOrigin (*MessageOrigin): Optional. Information about the original message for forwarded messages. — IsTopic (*bool): Optional. True, if the message is sent to a forum topic. — IsAutomaticForward (*bool): Optional. True, if the message is a channel post that was automatically forwarded to the connected discussion group. — ReplyTo (*AccessibleMessage): Optional. For replies in the same chat and message thread, the original message. Note that the AccessibleMessage object in this field will not contain further reply_to_message fields even if it itself is a reply. — ExternalReply (*ExternalReplyInfo): Optional. Information about the message that is being replied to, which may come from another chat or forum topic. — Quote (*TextQuote): Optional. For replies that quote part of the original message, the quoted part of the message. — ViaBot (*User): Optional. Bot through which the message was sent. — EditDate (*int64): Optional. Date the message was last edited in Unix time. — HasProtectedContent (*bool): Optional. True, if the message can't be forwarded. — MediaGroupID (*string): Optional. The unique identifier of a media message group this message belongs to. — AuthorSignature (*string): Optional. Signature of the post-author for messages in channels, or the custom title of an anonymous group administrator. — Text (*string): Optional. For text messages, the actual UTF-8 text of the message. — Entities ([]Entity): Optional. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text. — LinkPreviewOptions (*LinkPreviewOptions): Optional. Options used for link preview generation for the message, if it is a text message and link preview options were changed. — Animation (*Animation): Optional. AccessibleMessage is an animation, information about the animation. — Audio (*Audio): Optional. AccessibleMessage is an audio file, information about the file. — Document (*Document): Optional. AccessibleMessage is a general file, information about the file. — Photo (PhotoSizes): Optional. AccessibleMessage is a photo, available sizes of the photo. — Sticker (*Sticker): Optional. AccessibleMessage is a sticker, information about the sticker. — Story (*Story): Optional. AccessibleMessage is a forwarded story. — Video (*Video): Optional. AccessibleMessage is a video, information about the video. — VideoNote (*VideoNote): Optional. AccessibleMessage is a video note, information about the video message. — Voice (*Voice): Optional. AccessibleMessage is a voice message, information about the file. — Caption (*string): Optional. Caption for the animation, audio, document, photo, video, or voice. — CaptionEntities ([]Entity): Optional. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption. — HasMediaSpoiler (*bool): Optional. True, if the message media is covered by a spoiler animation. — Contact (*Contact): Optional. AccessibleMessage is a shared contact, information about the contact. — Dice (*Dice): Optional. AccessibleMessage is a 'dice' with a random value. — Game (*Game): Optional. AccessibleMessage is a game, information about the game. More about games » — Poll (*Poll): Optional. AccessibleMessage is a native poll, information about the poll. — Venue (*Venue): Optional. AccessibleMessage is a venue, information about the venue. For backward compatibility, when this field is set, the location field will also be set. — Location (*Location): Optional. AccessibleMessage is a shared location, information about the location. — NewChatMembers ([]User): 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): Optional. A member was removed from the group, information about them (this member may be the bot itself). — NewChatTitle (*string): Optional. A chat title was changed to this value. — NewChatPhoto (PhotoSizes): Optional. A chat photo was changed to this value. — DeleteChatPhoto (*bool): Optional. Service message: the chat photo was deleted. — GroupChatCreated (*bool): Optional. Service message: the group has been created. — SupergroupChatCreated (*bool): Optional. Service message: the supergroup has been created. This field can't be received in a message coming through updates because the 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): Optional. Service message: the channel has been created. This field can't be received in a message coming through updates because the 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. — AutoDeleteTimerChanged (*AutoDeleteTimerChanged): Optional. Service message: auto-delete timer settings changed in the chat. — MigrateToChatID (*int64): 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 is safe for storing this identifier. — MigrateFromChatID (*int64): 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 is safe for storing this identifier. — PinnedMessage (*MaybeInaccessibleMessage): Optional. A specified message was pinned. Note that the AccessibleMessage object in this field will not contain further reply_to_message fields even if it itself is a reply. — Invoice (*Invoice): Optional. AccessibleMessage is an invoice for a payment, information about the invoice. — SuccessfulPayment (*SuccessfulPayment): Optional. AccessibleMessage is a service message about a successful payment, information about the payment. — UsersShared (*UsersShared): Optional. Service message: users were shared with the bot. — ChatShared (*ChatShared): Optional. Service message: a chat was shared with the bot. — ConnectedWebsite (*string): Optional. The domain name of the website on which the user has logged in. More about Telegram Login » — WriteAccessAllowed (*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. — PassportData (*PassportData): Optional. Telegram Passport data. — ProximityAlertTriggered (*ProximityAlertTriggered): Optional. Service message. A user in the chat triggered another user's proximity alert while sharing Live Location. — ForumTopicCreated (*ForumTopicCreated): Optional. Service message: forum topic created. — ForumTopicEdited (*ForumTopicEdited): Optional. Service message: forum topic edited. — ForumTopicClosed (*ForumTopicClosed): Optional. Service message: forum topic closed. — ForumTopicReopened (*ForumTopicReopened): Optional. Service message: a forum topic reopened. — GeneralForumTopicHidden (*GeneralForumTopicHidden): Optional. Service message: the 'General' forum topic hidden. — GeneralForumTopicUnhidden (*GeneralForumTopicUnhidden): Optional. Service message: the 'General' forum topic unhidden. — GiveawayCreated (*GiveawayCreated): Optional. Service message: a scheduled giveaway was created. — Giveaway (*Giveaway): Optional. The message is a scheduled giveaway message. — GiveawayWinners (*GiveawayWinners): Optional. A giveaway with public winners was completed. — GiveawayCompleted (*GiveawayCompleted): Optional. Service message: a giveaway without public winners was completed. — VideoChatScheduled (*VideoChatScheduled): Optional. Service message: a video chat scheduled. — VideoChatStarted (*VideoChatStarted): Optional. Service message: a video chat started. — VideoChatEnded (*VideoChatEnded): Optional. Service message: a video chat ended. — VideoChatParticipantsInvited (*VideoChatParticipantsInvited): Optional. Service message: new participants invited to a video chat. — WebAppData (*WebAppData): Optional. Service message: data sent by a Web App. — ReplyMarkup (*InlineKeyboardMarkup): Optional. Inline keyboard attached to the message. login_url buttons are represented as ordinary URL buttons.
func (*AccessibleMessage) IsService ¶ added in v1.9.8
func (u *AccessibleMessage) IsService() bool
func (*AccessibleMessage) MarshalJSON ¶ added in v1.9.0
func (u *AccessibleMessage) MarshalJSON() ([]byte, error)
func (*AccessibleMessage) MessageSig ¶ added in v1.9.0
func (u *AccessibleMessage) MessageSig() (Recipient, int64)
func (*AccessibleMessage) MessageType ¶ added in v1.9.0
func (u *AccessibleMessage) MessageType() string
func (*AccessibleMessage) ReflectType ¶ added in v1.9.0
func (u *AccessibleMessage) ReflectType() string
func (*AccessibleMessage) String ¶ added in v1.9.0
func (u *AccessibleMessage) String() string
func (*AccessibleMessage) Type ¶ added in v1.9.0
func (u *AccessibleMessage) Type() string
func (*AccessibleMessage) UnmarshalJSON ¶ added in v1.9.0
func (u *AccessibleMessage) UnmarshalJSON(b []byte) error
func (*AccessibleMessage) Verify ¶ added in v1.9.0
func (u *AccessibleMessage) Verify() error
type Animation ¶
type Animation struct { // FileID is the identifier for this file, which can be used to download or reuse the file. FileID string `json:"file_id"` // FileUniqueID is the 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. FileUniqueID string `json:"file_unique_id"` // Width is the video width as defined by the sender. Width int `json:"width"` // Height is the video height as defined by the sender. Height int `json:"height"` // Duration is the duration of the video in seconds as defined by the sender. Duration int `json:"duration"` // Thumbnail is the animation thumbnail as defined by the sender. Thumbnail *PhotoSize `json:"thumbnail,omitempty"` // FileName is the original animation filename as defined by the sender. FileName string `json:"file_name,omitempty"` // MIME is the MIME type of the file as defined by the sender. MIME string `json:"mime_type,omitempty"` // Size is the file size in bytes. Size int64 `json:"file_size,omitempty"` }
Animation represents an animation file (GIF or H.264/MPEG-4 AVC video without sound). <a href="https://core.telegram.org/bots/api#animation">/bots/api#animation</a> Wiki: <a href="https://github.com/reloadlife/telebot/wiki/Animation">/wiki/Animation</a>
func (*Animation) MarshalJSON ¶ added in v1.9.0
func (*Animation) ReflectType ¶ added in v1.9.0
ReflectType returns the type of this object
func (*Animation) Send ¶
Send sends an animation to the recipient with Options. for available Options please refer to <a href="https://">Available Animation Options</a>
func (*Animation) UnmarshalJSON ¶ added in v1.9.0
type Audio ¶
type Audio struct { // FileID is the identifier for this file, which can be used to download or reuse the file. FileID string `json:"file_id"` // FileUniqueID is the 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. FileUniqueID string `json:"file_unique_id"` // Duration is the duration of the audio in seconds as defined by the sender. Duration int `json:"duration"` // Performer is the performer of the audio as defined by the sender or by audio tags. Performer string `json:"performer,omitempty"` // Title is the title of the audio as defined by the sender or by audio tags. Title string `json:"title,omitempty"` // FileName is the original filename as defined by the sender. FileName string `json:"file_name,omitempty"` // MimeType is the MIME type of the file as defined by the sender. MimeType string `json:"mime_type,omitempty"` // FileSize is the file size in bytes. FileSize int64 `json:"file_size,omitempty"` // Thumbnail is the thumbnail of the album cover to which the music file belongs. Thumbnail *PhotoSize `json:"thumbnail,omitempty"` }
Audio represents an audio file to be treated as music by the Telegram clients. <a href="https://core.telegram.org/bots/api#audio">/bots/api#audio</a> Wiki: <a href="https://github.com/reloadlife/telebot/wiki/Audio">/wiki/Audio</a>
func (*Audio) MarshalJSON ¶ added in v1.9.0
func (*Audio) ReflectType ¶ added in v1.9.0
ReflectType returns the type of this object
func (*Audio) UnmarshalJSON ¶ added in v1.9.0
type AutoDeleteTimerChanged ¶ added in v1.9.0
type AutoDeleteTimerChanged struct { // AutoDeleteTime is the new auto-delete time for messages in the chat; in seconds. AutoDeleteTime int `json:"message_auto_delete_time"` }
AutoDeleteTimerChanged represents a service message about a change in auto-delete timer settings. <a href="https://core.telegram.org/bots/api#messageautodeletetimerchanged">/bots/api#messageautodeletetimerchanged</a>
func (*AutoDeleteTimerChanged) MarshalJSON ¶ added in v1.9.0
func (a *AutoDeleteTimerChanged) MarshalJSON() ([]byte, error)
func (*AutoDeleteTimerChanged) ReflectType ¶ added in v1.9.0
func (a *AutoDeleteTimerChanged) ReflectType() string
ReflectType returns the reflect type of the struct
func (*AutoDeleteTimerChanged) String ¶ added in v1.9.0
func (a *AutoDeleteTimerChanged) String() string
func (*AutoDeleteTimerChanged) Type ¶ added in v1.9.0
func (a *AutoDeleteTimerChanged) Type() string
Type returns the type of the message
func (*AutoDeleteTimerChanged) UnmarshalJSON ¶ added in v1.9.0
func (a *AutoDeleteTimerChanged) UnmarshalJSON(data []byte) error
func (*AutoDeleteTimerChanged) Verify ¶ added in v1.9.0
func (a *AutoDeleteTimerChanged) Verify() error
type BoostRemoved ¶ added in v1.9.0
type BoostRemoved struct { // Chat is the chat which was boosted. Chat Chat `json:"chat"` // BoostID is the unique identifier of the boost. BoostID string `json:"boost_id"` // RemoveDate is the point in time (Unix timestamp) when the boost was removed. // todo: #6: change to time.Time RemoveDate int64 `json:"remove_date"` // Source is the source of the removed boost. Source ChatBoostSource `json:"source"` }
BoostRemoved represents a boost removed from a chat. <a href="https://core.telegram.org/bots/api#chatboostremoved">/bots/api#chatboostremoved</a>
func (*BoostRemoved) MarshalJSON ¶ added in v1.9.0
func (c *BoostRemoved) MarshalJSON() ([]byte, error)
func (*BoostRemoved) ReflectType ¶ added in v1.9.0
func (c *BoostRemoved) ReflectType() string
ReflectType returns the type of the struct.
func (*BoostRemoved) String ¶ added in v1.9.0
func (c *BoostRemoved) String() string
func (*BoostRemoved) Type ¶ added in v1.9.0
func (c *BoostRemoved) Type() string
Type returns the type of the struct.
func (*BoostRemoved) UnmarshalJSON ¶ added in v1.9.0
func (c *BoostRemoved) UnmarshalJSON(b []byte) error
func (*BoostRemoved) Verify ¶ added in v1.9.0
func (c *BoostRemoved) Verify() error
type BoostSource ¶ added in v1.9.0
type BoostSource string
const ( ChatBoostSourcePremium BoostSource = "premium" ChatBoostSourceGiftCode BoostSource = "gift_code" ChatBoostSourceGiveaway BoostSource = "giveaway" )
type BoostUpdated ¶ added in v1.9.0
type BoostUpdated struct { // Chat is the chat which was boosted. Chat Chat `json:"chat"` // Boost is the information about the chat boost. Boost ChatBoost `json:"boost"` }
BoostUpdated represents a boost added to a chat or changed. <a href="https://core.telegram.org/bots/api#chatboostupdated">/bots/api#chatboostupdated</a>
func (*BoostUpdated) MarshalJSON ¶ added in v1.9.0
func (b *BoostUpdated) MarshalJSON() ([]byte, error)
func (*BoostUpdated) ReflectType ¶ added in v1.9.0
func (b *BoostUpdated) ReflectType() string
ReflectType returns the type of the struct.
func (*BoostUpdated) String ¶ added in v1.9.0
func (b *BoostUpdated) String() string
func (*BoostUpdated) Type ¶ added in v1.9.0
func (b *BoostUpdated) Type() string
Type returns the type of the struct.
func (*BoostUpdated) UnmarshalJSON ¶ added in v1.9.0
func (b *BoostUpdated) UnmarshalJSON(byt []byte) error
func (*BoostUpdated) Verify ¶ added in v1.9.0
func (b *BoostUpdated) Verify() error
type Bot ¶
type Bot interface { // Start starts the Bot and waits for requests. // Start starts a long polling loop to receive updates from the Telegram API. Start() // StartInWebhook starts the router in webhook mode. // StartInWebhook starts a simple HTTP server to receive updates from the Telegram API. StartInWebhook() // Stop Gracefully stops the Bot. // Stops the Bot. Stop() // Group creates a *Group Group() *Group // Use adds middleware to the global middleware chain. Use(middleware ...MiddlewareFunc) // Handle // adds new Handler Handle(endpoint any, h HandlerFunc, m ...MiddlewareFunc) // Debug sends a debug message to the bot. // // debugMessage can be anything that can be formatted into a string using fmt.Sprint. // Useful for debugging purposes. Debug(debugMessage ...any) // OnError sends an error message to the bot. // // err is the error that occurred. // ctx provides context about where the error occurred. OnError(err error, ctx Context) // Close // Telegram API Method. // Use this method to close the bot instance before moving it from one local server to another. // You need to delete the webhook before calling this method to ensure that // the bot isn't launched again after the server restarts. // The method will return error 429 in the first 10 minutes after the bot is launched. // <a href="https://core.telegram.org/bots/api#close">/bots/api#close</a> // Returns an error on failure. Close() error // Logout // Telegram API Method. // Use this method to log out from the cloud Bot API server before launching the bot locally. // You must log out the bot before running it locally, // otherwise there is no guarantee that the bot will receive updates. // After a successful call, you can immediately log in on a local server, // but will not be able to log in back to the cloud Bot API server for 10 minutes. // <a href="https://core.telegram.org/bots/api#logout">/bots/api#logout</a> // Returns an error on failure. Logout() error // GetUpdates // Telegram API Method. // Use this method to receive incoming updates using long polling. // <a href="https://core.telegram.org/bots/api#getupdates">/bots/api#getupdates</a> // Returns a list of Update objects and error on failure. GetUpdates(offset, limit int, timeout time.Duration, allowed ...UpdateType) (Updates, error) // GetMe // Telegram API Method. // Use this method to get current bot info. // <a href="https://core.telegram.org/bots/api#getme">/bots/api#getme</a> // Returns User info and error on failure. GetMe() (*User, error) // SendMessage sends a text message to the provided recipient. // Returns the sent AccessibleMessage and error on failure. SendMessage(recipient Recipient, text string, options ...any) (*AccessibleMessage, error) // SendPhoto sends a photo to the provided recipient. // Returns the sent AccessibleMessage and error on failure. SendPhoto(recipient Recipient, photo File, options ...any) (*AccessibleMessage, error) // SendAudio sends an audio track to the provided recipient. // // recipient is the chat to send the audio to. // audio is the audio File to send. // options contains additional send options like caption. // // Returns the sent AccessibleMessage and error on failure. SendAudio(recipient Recipient, audio File, options ...any) (*AccessibleMessage, error) // SendDocument sends a document to the provided recipient. // // recipient is the chat to send the document to. // document is the document File to send. // options contains additional send options like caption. // // Returns the sent AccessibleMessage and error on failure. SendDocument(recipient Recipient, document File, options ...any) (*AccessibleMessage, error) SendVideo(recipient Recipient, video File, options ...any) (*AccessibleMessage, error) // SendAnimation sends an animation to the provided recipient. // // recipient is the chat to send the animation to. // animation is the animation File to send. // options contains additional send options like caption. // // Returns the sent AccessibleMessage and error on failure. SendAnimation(recipient Recipient, animation File, options ...any) (*AccessibleMessage, error) // SendVoice sends a voice recording to the provided recipient. // // recipient is the chat to send the voice to. // voice is the voice recording File to send. // options contains additional send options like caption. // // Returns the sent AccessibleMessage and error on failure. SendVoice(recipient Recipient, voice File, options ...any) (*AccessibleMessage, error) // SendVideoNote sends a video note to the provided recipient. // // recipient is the chat to send the video note to. // videoNote is the video note File to send. // options contains additional send options like duration. // // Returns the sent AccessibleMessage and error on failure. SendVideoNote(recipient Recipient, videoNote File, options ...any) (*AccessibleMessage, error) // SendMediaGroup sends a group of photos or videos as an album to the recipient. // // recipient is the chat to send the media album to. // media is the list of photo and video Files to send. // options contains additional send options like disable_notification. // Returns the sent Messages and error on failure. SendMediaGroup(recipient Recipient, media []InputMedia, options ...any) ([]*AccessibleMessage, error) // SendLocation sends a location to the provided recipient. // // recipient is the chat to send the location to. // location is the latitude and longitude location to send. // options contains additional send options like live_period. // // Returns the sent AccessibleMessage and error on failure. SendLocation(recipient Recipient, location Location, options ...any) (*AccessibleMessage, error) // SendVenue sends a venue to the provided recipient. // // recipient is the chat to send the venue to. // venue is the venue information to send. // options contains additional send options like foursquare_id. // // Returns the sent AccessibleMessage and error on failure. SendVenue(recipient Recipient, venue Venue, options ...any) (*AccessibleMessage, error) // SendContact sends a contact's info to the provided recipient. // // recipient is the chat to send the contact to. // contact is the contact info to send. // options contains additional send options like last_name. // // Returns the sent AccessibleMessage and error on failure. SendContact(recipient Recipient, contact Contact, options ...any) (*AccessibleMessage, error) // SendPoll sends a poll to the provided recipient. // // recipient is the chat to send the poll to. // question is the poll question. // options contains additional send options like is_anonymous. // // Returns the sent AccessibleMessage and error on failure. SendPoll(recipient Recipient, question string, answerOptions []string, options ...any) (*AccessibleMessage, error) // SendDice sends a dice with random value to the provided recipient. // // recipient is the chat to send the dice to. // options contains additional send options like emoji. // // Returns the sent AccessibleMessage and error on failure. SendDice(recipient Recipient, options ...any) (*AccessibleMessage, error) // SendChatAction sends a chat action to the provided recipient. // // recipient is the chat to send the action to. // action is the chat action to send. // // Returns an error on failure. SendChatAction(recipient Recipient, action ChatAction, options ...any) error // SetMessageReaction adds a reaction to a message. // // recipient is the chat the message is in. // messageID is the ID of the message to react to. // options contains the reaction emoji to use. // // Returns an error on failure. SetMessageReaction(recipient Recipient, messageID int64, options ...any) error // GetUserProfilePhotos retrieves a user's profile photos. // // userID is the ID of the user to get profile photos for. // offset optionally offsets the list of returned photos. // limit limits the number of photos returned. // // Returns UserProfilePhotos and error on failure. GetUserProfilePhotos(userID int64, offset, limit int) (*UserProfilePhotos, error) Forward(to Recipient, From Recipient, messageID int, opts ...any) (*AccessibleMessage, error) Forwards(to Recipient, From Recipient, messageIDs []int, opts ...any) ([]int, error) Copy(to Recipient, from Recipient, messageIDs []int, opts ...any) ([]int, error) // GetFile retrieves information about a file from its file_id. // // fileID is the ID of the file to get info about. // // Returns File object and error on failure. GetFile(fileID string) (*File, error) // Ban bans a user from a chat. // // chatID is the ID of the chat to ban the user from. // userID is the ID of the user to ban. // untilDate optionally bans the user until a specific date. // revokeMessages optionally deletes all messages by the user. // // Returns an error on failure. Ban(chatID Recipient, userID int64, options ...any) error // Unban unbans a user from a chat. // // chatID is the ID of the chat to unban the user from. // userID is the ID of the user to unban. // onlyIfBanned optionally only unbans if the user was banned. // // Returns an error on failure. Unban(chatID Recipient, userID int64, options ...any) error // Restrict restricts a user in a supergroup. // // chatID is the ID of the supergroup. // userID is the ID of the user to restrict. // permissions sets the user's new permissions. // useIndependentChatPermissions optionally customizes the permissions. // untilDate optionally restricts the user until a certain date. // // Returns an error on failure. Restrict(chatID Recipient, userID int64, permissions ChatPermissions, options ...any) error // Promote promotes or demotes a user in a supergroup or channel. // // chatID is the ID of the supergroup or channel. // userID is the ID of the user to promote/demote. // roles are the new member permissions to set. // // Returns an error on failure. Promote(chatID Recipient, userID int64, roles ...ChatMemberPermission) error // SetChatAdministratorCustomTitle sets a custom title for an admin promoted by the bot. // // chatID is the ID of the supergroup. // userID is the ID of the administrator. // customTitle is the new custom title. // // Returns an error on failure. SetChatAdministratorCustomTitle(chatID Recipient, userID int64, customTitle string) error // BanChatSenderChat bans a user from sending messages in a supergroup. // // chatID is the ID of the supergroup. // userID is the ID of the user to ban. // // Returns an error on failure. BanChatSenderChat(chatID Recipient, userID int64) error // UnbanChatSenderChat unbans a user from sending messages in a supergroup/channel. // // chatID is the ID of the supergroup/channel. // userID is the ID of the user to unban. // // Returns an error on failure. UnbanChatSenderChat(chatID Recipient, userID int64) error // SetChatPermissions sets default permissions for members in a chat. // // chatID is the ID of the chat. // permissions are the new default permissions. // useIndependentChatPermissions optionally customizes the permissions. // // Returns an error on failure. SetChatPermissions(chatID Recipient, permissions ChatPermissions, useIndependentChatPermissions *bool) error // ExportChatInviteLink generates a new primary invite link for a chat. // // chatID is the ID of the chat. // // Returns the new invite link and error on failure. ExportChatInviteLink(chatID Recipient) (*string, error) // CreateChatInviteLink creates a new additional invite link for a chat. // // chatID is the ID of the chat. // name is the name of the invite link. // expireDate optionally sets invite link expiration. // memberLimit limits the maximum number of users that can join. // createsJoinRequest enables users to request to join. // // Returns the new ChatInviteLink and error on failure. CreateChatInviteLink(chatID Recipient, name string, expireDate int64, memberLimit int, createsJoinRequest bool) (*ChatInviteLink, error) // EditChatInviteLink edits a non-primary invite link created by the bot. // // chatID is the ID of the chat. // inviteLink is the invite link to edit. // name is the new name of the invite link. // expireDate optionally sets new expiration date. // memberLimit limits the maximum number of users that can join. // createsJoinRequest enables users to request to join. // // Returns the edited ChatInviteLink and error on failure. EditChatInviteLink(chatID Recipient, inviteLink, name string, expireDate int64, memberLimit int, createsJoinRequest bool) (*ChatInviteLink, error) // RevokeChatInviteLink revokes an invite link created by the bot. // // chatID is the ID of the chat. // inviteLink is the invite link to revoke. // // Returns the revoked ChatInviteLink and error on failure. RevokeChatInviteLink(chatID Recipient, inviteLink string) (*ChatInviteLink, error) // ApproveChatJoinRequest approves a chat join request. // // chatID is the ID of the chat. // userID is the ID of the user requesting to join. // // Returns an error on failure. ApproveChatJoinRequest(chatID Recipient, userID int64) error // DeclineChatJoinRequest declines a chat join request. // // chatID is the ID of the chat. // userID is the ID of the user requesting to join. // // Returns an error on failure. DeclineChatJoinRequest(chatID Recipient, userID int64) error // SetChatPhoto sets a new chat photo. // // chatID is the ID of the chat. // photo is the new File to set as the photo. // // Returns an error on failure. SetChatPhoto(chatID Recipient, photo File) error // DeleteChatPhoto deletes the chat's current photo. // // chatID is the ID of the chat. // // Returns an error on failure. DeleteChatPhoto(chatID Recipient) error // SetChatTitle changes the title of a chat. // // chatID is the ID of the chat. // title is the new chat title. // // Returns an error on failure. SetChatTitle(chatID Recipient, title string) error // SetChatDescription changes the description of a chat. // // chatID is the ID of the chat. // description is the new chat description. // // Returns an error on failure. SetChatDescription(chatID Recipient, description string) error // PinChatMessage pins a message in a chat. // // chatID is the ID of the chat. // messageID is the ID of the message to pin. // disableNotification optionally mutes notifications for the pin. // // Returns an error on failure. PinChatMessage(chatID Recipient, messageID int, disableNotification bool) error // UnpinChatMessage unpins a pinned message in a chat. // // chatID is the ID of the chat. // messageID is the ID of the pinned message to unpin. // // Returns an error on failure. UnpinChatMessage(chatID Recipient, messageID int) error // UnpinAllChatMessages unpins all pinned messages in a chat. // // chatID is the ID of the chat. // // Returns an error on failure. UnpinAllChatMessages(chatID Recipient) error // LeaveChat makes the bot leave a group, supergroup, or channel. // // chatID is the ID of the chat to leave. // // Returns an error on failure. LeaveChat(chatID Recipient) error // GetChat gets information about a chat. // // chatID is the ID of the chat to get info about. // // Returns the Chat object and error on failure. GetChat(chatID Recipient) (*Chat, error) // GetChatAdministrators gets a list of administrators in a chat. // // chatID is the ID of the chat to get admins for. // // Returns list of ChatMembers and error on failure. GetChatAdministrators(chatID Recipient) ([]ChatMember, error) // GetChatMemberCount gets the number of members in a chat. // // chatID is the ID of the chat. // // Returns number of members and error on failure. GetChatMemberCount(chatID Recipient) (*int, error) // GetChatMember gets information about a chat member. // // chatID is the ID of the chat. // userID is the ID of the user. // // Returns ChatMember and error on failure. GetChatMember(chatID Recipient, userID int64) (*ChatMember, error) // SetChatStickerSet sets the sticker set for a chat. // // chatID is the ID of the chat. // stickerSetName is the name of the sticker set. // // Returns an error on failure. SetChatStickerSet(chatID Recipient, stickerSetName string) error // DeleteChatStickerSet deletes the custom sticker set for a chat. // // chatID is the ID of the chat. // // Returns an error on failure. DeleteChatStickerSet(chatID Recipient) error // GetForumTopicIconStickers gets the default stickers for forum topics. // // Returns the list of Stickers and error on failure. GetForumTopicIconStickers() ([]Sticker, error) // CreateForumTopic creates a new forum topic in the given chat. // // chatID is the ID of the chat to create the topic in. // // name is the name for the new topic. // // options can contain additional settings for the topic like pinned, etc. // // Returns the new ForumTopic and any error that occurred. CreateForumTopic(chatID Recipient, name string, options ...any) (*ForumTopic, error) // EditForumTopic edits an existing forum topic in a chat. // // chatID is the ID of the chat containing the topic. // // topicID is the ID of the topic to edit. // // options can contain the new topic name or other properties to edit. // // Returns any error that occurred. EditForumTopic(chatID Recipient, topicID int64, options ...any) error // CloseForumTopic closes an existing forum topic in a chat. // // chatID is the ID of the chat containing the topic. // // topicID is the ID of the topic to close. // // Closed topics cannot be replied to but the existing messages remain. // // Returns any error that occurred. CloseForumTopic(chatID Recipient, topicID int64) error // ReopenForumTopic reopens a previously closed forum topic in a chat. // // chatID is the ID of the chat containing the topic. // // topicID is the ID of the closed topic to reopen. // // Reopened topics can be replied to again. // // Returns any error that occurred. ReopenForumTopic(chatID Recipient, topicID int64) error // DeleteForumTopic deletes an existing forum topic from a chat. // // chatID is the ID of the chat containing the topic. // // topicID is the ID of the topic to delete. // // Deleting a topic also deletes all messages posted in the topic. // // Returns any error that occurred. DeleteForumTopic(chatID Recipient, topicID int64) error // UnpinAllForumTopicMessages unpins all pinned messages in a forum topic. // // chatID is the ID of the chat containing the topic. // // topicID is the ID of the topic to unpin messages from. // // Returns any error that occurred. UnpinAllForumTopicMessages(chatID Recipient, topicID int64) error // EditGeneralForumTopic edits the general forum topic in a chat. // // chatID is the ID of the chat containing the general forum topic. // // name is the new name for the general forum topic. // // Returns any error that occurred. EditGeneralForumTopic(chatID Recipient, name string) error // CloseGeneralForumTopic closes the general forum topic in a chat. // // chatID is the ID of the chat containing the general forum. // // Closed general topics cannot be replied to but existing messages remain. // // Returns any error that occurred. CloseGeneralForumTopic(chatID Recipient) error // ReopenGeneralForumTopic reopens a closed general forum topic in a chat. // // chatID is the ID of the chat containing the general forum topic. // // Reopened general topics can be replied to again. // // Returns any error that occurred. ReopenGeneralForumTopic(chatID Recipient) error // HideGeneralForumTopic hides the general forum topic from a chat. // // chatID is the ID of the chat containing the general forum topic. // // Hidden general topics are not displayed in the chat but still exist. // // Returns any error that occurred. HideGeneralForumTopic(chatID Recipient) error // UnhideGeneralForumTopic unhides a previously hidden general forum topic. // // chatID is the ID of the chat containing the hidden general topic. // // Unhidden general topics are displayed in the chat again. // // Returns any error that occurred. UnhideGeneralForumTopic(chatID Recipient) error // UnpinAllGeneralForumTopicMessages unpins all pinned messages in the general forum topic. // // chatID is the ID of the chat containing the general forum topic. // // Returns any error that occurred. UnpinAllGeneralForumTopicMessages(chatID Recipient) error // AnswerCallbackQuery answers an incoming callback query. // // callback is the callback query to respond to. // // opts can contain additional API options. // // Returns any error that occurred. AnswerCallbackQuery(callback *Callback, opts ...any) error // Commands gets the list of commands registered by the bot. // // opts can contain additional API options. // // Returns the commands and any error that occurred. Commands(opts ...any) ([]BotCommand, error) // SetCommands changes the list of commands registered by the bot. // // commands is the new list of commands. // // opts can contain additional API options. // // Returns any error that occurred. SetCommands(commands []BotCommand, opts ...any) error // DeleteCommands removes all commands registered by the bot. // // opts can contain additional API options. // // Returns any error that occurred. DeleteCommands(opts ...any) error // SetName changes the name of the bot. // // name is the new name for the bot. // // opts can contain additional API options. // // Returns any error that occurred. SetName(name string, opts ...any) error // GetName gets the current name of the bot. // // opts can contain additional API options. // // Returns the name and any error that occurred. GetName(opts ...any) (*string, error) // SetDescription changes the description of the bot. // // description is the new description. // // opts can contain additional API options. // // Returns any error that occurred. SetDescription(description string, opts ...any) error // GetDescription gets the current description of the bot. // // opts can contain additional API options. // // Returns the description and any error that occurred. GetDescription(opts ...any) (*string, error) // SetShortDescription changes the short description of the bot. // // shortDescription is the new short description. // // opts can contain additional API options. // // Returns any error that occurred. SetShortDescription(shortDescription string, opts ...any) error // GetShortDescription gets the current short description of the bot. // // opts can contain additional API options. // // Returns the short description and any error that occurred. GetShortDescription(opts ...any) (*string, error) // SetChatMenuButton sets the menu button for the bot in chat screens. // // opts can contain the new MenuButton to set. // // Returns any error that occurred. SetChatMenuButton(opts ...any) error // GetChatMenuButton gets the current menu button for the bot. // // opts can contain additional API options. // // Returns the MenuButton and any error that occurred. GetChatMenuButton(opts ...any) (*MenuButton, error) // SetDefaultAdministratorRights changes default admin rights for bot admins. // // opts can contain the new Rights. // // Returns any error that occurred. SetDefaultAdministratorRights(opts ...any) error // GetDefaultAdministratorRights gets the current default admin rights. // // opts can contain additional API options. // // Returns the Rights and any error that occurred. GetDefaultAdministratorRights(opts ...any) (*Rights, error) // EditMessageText edits the text of a previously sent message. // // recipient is the chat to edit the message in. // // messageID is the ID of the message to edit. // // text is the new text for the message. // // options can specify additional editing options. // // Returns the edited AccessibleMessage and any error. EditMessageText(msg Message, text string, options ...any) (*AccessibleMessage, error) // EditMessageTextInline edits text of an inline message. // // inlineMessageID is the ID of the inline message to edit. // // text is the new text for the message. // // options can specify additional editing options. // // Returns any error that occurred. EditMessageTextInline(inlineMessageID string, text string, options ...any) error // EditMessageCaption edits the caption of a previously sent message. // // recipient is the chat to edit the message in. // // messageID is the ID of the message to edit. // // caption is the new caption text. // // options can specify additional editing options. // // Returns the edited AccessibleMessage and any error. EditMessageCaption(msg Message, caption string, options ...any) (*AccessibleMessage, error) // EditMessageCaptionInline edits caption of an inline message. // // inlineMessageID is the ID of the inline message to edit. // // caption is the new caption text. // // options can specify additional editing options. // // Returns any error that occurred. EditMessageCaptionInline(inlineMessageID string, caption string, options ...any) error // EditMessageMedia edits the media content of a previously sent message. // // recipient is the chat to edit the message in. // // messageID is the ID of the message to edit. // // media is the new media content. // // options can specify additional editing options. // // Returns the edited AccessibleMessage and any error. EditMessageMedia(msg Message, media InputMedia, options ...any) (*AccessibleMessage, error) // EditMessageMediaInline edits media content of an inline message. // // inlineMessageID is the ID of the inline message to edit. // // media is the new media content. // // options can specify additional editing options. // // Returns any error that occurred. EditMessageMediaInline(inlineMessageID string, media InputMedia, options ...any) error // EditMessageLiveLocation edits live location in a previously sent message. // Returns the edited AccessibleMessage and any error. EditMessageLiveLocation(msg Message, location Location, options ...any) (*AccessibleMessage, error) // EditMessageLiveLocationInline edits live location in an inline message. // Returns any error that occurred. EditMessageLiveLocationInline(inlineMessageID string, location Location, options ...any) error // StopMessageLiveLocation stops updating live location in a message. // Returns the edited AccessibleMessage and any error. StopMessageLiveLocation(msg Message, options ...any) (*AccessibleMessage, error) // StopMessageLiveLocationInline stops live location in an inline message. // Returns any error that occurred. StopMessageLiveLocationInline(inlineMessageID string, options ...any) error // EditMessageReplyMarkup edits the inline keyboard markup of a message. // // recipient is the chat to edit the message in. // // messageID is the ID of the message to edit. // // markup is the new inline keyboard markup. // // Returns the edited AccessibleMessage and any error. EditMessageReplyMarkup(msg Message, markup ReplyMarkup) (*AccessibleMessage, error) // EditMessageReplyMarkupInline edits reply markup of an inline message. // // inlineMessageID is the ID of the inline message to edit. // // markup is the new inline keyboard markup. // // Returns any error that occurred. EditMessageReplyMarkupInline(inlineMessageID string, markup ReplyMarkup) error // StopPoll stops an active poll and updates the message. // Returns the stopped Poll and any error. StopPoll(msg Message, options ...any) (*Poll, error) // DeleteMessage deletes a previously sent message. // Returns any error that occurred. DeleteMessage(msg Message, messageIDs ...int64) error // SendSticker sends a sticker to a chat. // recipient is the chat to send the sticker to. // sticker is the sticker file to send. // options can specify additional send options. // Returns the sent AccessibleMessage and any error. SendSticker(recipient Recipient, sticker File, options ...any) (*AccessibleMessage, error) // GetStickerSet gets info about a sticker set by name. // // name is the short name of the sticker set. // // Returns the StickerSet and any error. GetStickerSet(name string) (*StickerSet, error) // GetCustomEmojiStickers gets stickers for the given custom emoji. // // CustomEmojiIds is a list of custom emoji identifiers. // // Returns the list of matching Stickers. GetCustomEmojiStickers(customEmojiIDs ...CustomEmoji) ([]Sticker, error) // UploadStickerFile uploads a sticker image to be used in a set. // // Owner is the user ID of the sticker set owner. // // sticker is the image file to upload. // // Format is the image format like png, webp, etc. // // Returns the uploaded File and any error. UploadStickerFile(user Userable, sticker File, format StickerFormat) (*File, error) // CreateNewStickerSet creates a new sticker set owned by a user. // Returns any error that occurred. CreateNewStickerSet(user Userable, name, title string, stickers []InputSticker, options ...any) error // AddStickerToSet adds a new sticker to an existing set. // Returns any error that occurred. AddStickerToSet(user Userable, name string, sticker InputSticker) error // SetStickerPositionInSet moves a sticker to a new position. // Returns any error that occurred. SetStickerPositionInSet(sticker string, position int) error // DeleteStickerFromSet removes a sticker from a set. // Returns any error that occurred. DeleteStickerFromSet(sticker string) error // SetStickerEmojiList updates the emoji list for a sticker. // Returns any error that occurred. SetStickerEmojiList(sticker string, EmojiList []StickerEmoji) error // SetStickerKeywords updates the search keywords for a sticker. // Returns any error that occurred. SetStickerKeywords(sticker string, Keywords []string) error // SetStickerMaskPosition updates the mask position for a mask sticker. // Returns any error that occurred. SetStickerMaskPosition(sticker string, maskPosition ...MaskPosition) error // SetStickerSetTitle updates the title of a sticker. // Returns any error that occurred. SetStickerSetTitle(sticker string, title string) error // SetStickerSetThumbnail updates the thumbnail for a set. // Returns any error that occurred. SetStickerSetThumbnail(name string, user Userable, thumbnail File, format StickerFormat) error // SetCustomEmojiStickerSetThumbnail updates emoji set thumbnail. // Returns any error that occurred. SetCustomEmojiStickerSetThumbnail(name string, CustomEmojiID ...string) error // DeleteStickerSet removes a sticker set. // Returns any error that occurred. DeleteStickerSet(name string) error // AnswerInlineQuery sends results for an inline query. // Returns any error that occurred. AnswerInlineQuery(queryID string, results QueryResults, options ...any) error // AnswerWebAppQuery sends result for a Web App query. // Returns the sent message info and any error. AnswerWebAppQuery(webAppQueryID string, result QueryResult) (*SentWebAppMessage, error) // SendInvoice sends an invoice requesting payment. // Returns the sent AccessibleMessage and any error. SendInvoice(to Recipient, title, description, payload, providerToken, currency string, prices []LabeledPrice, options ...any) (*AccessibleMessage, error) // CreateInvoiceLink generates a link for an invoice. // Returns the generated URL as string and any error. CreateInvoiceLink(title, description, payload, providerToken, currency string, prices []LabeledPrice, options ...any) (*string, error) // AnswerShippingQuery responds to shipping query with options. // Returns any error that occurred. AnswerShippingQuery(ID string, ok bool, options ...any) error // AnswerPreCheckoutQuery responds to pre-checkout query. // Returns any error that occurred. AnswerPreCheckoutQuery(queryID string, ok bool, errorMessage *string) error // SetPassportDataErrors informs a user of errors with Telegram Passport data. // Returns any error that occurred. SetPassportDataErrors(userID Userable, errors []PassportElementError) error // SendGame sends a game for the user to play. // Returns the sent AccessibleMessage and any error. SendGame(recipient Recipient, gameShortName string, options ...any) (*AccessibleMessage, error) // SetGameScore sets a new high score for a game. // Returns the updated AccessibleMessage and any error. SetGameScore(msg Message, userID Userable, score uint, options ...any) (*AccessibleMessage, error) // SetGameScoreInline sets high score for an inline game message. // Returns any error that occurred. SetGameScoreInline(inlineMessageID string, userID Userable, score uint, options ...any) error // GetGameHighScores gets high score table for a game. // Returns the high scores and any error. GetGameHighScores(user Userable, options ...any) ([]GameHighScore, error) // GetUserChatBoosts returns a list of boosts added to a chat by a user. // <a href="https://core.telegram.org/bots/api#getuserchatboosts">/bots/api#getuserchatboosts</a> // // chatID: Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) // // userID: Unique identifier of the target user // // Returns: (*UserChatBoosts, error) // // Example: // “`go // chatID := &Chat{ID:1234567890} // userID := &User{ID:1234567890} // // chatBoosts, err := bot.GetUserChatBoosts(chatID, userID) // if err != nil { // log.Println(err) // } // log.Println(chatBoosts) // “` GetUserChatBoosts(chatID Recipient, userID Userable) (*UserChatBoosts, error) // GetBusinessConnection // Use this method to get information about the connection of the bot with a business account. // Returns a *BusinessConnection object on success. GetBusinessConnection(BusinessConnectionID BusinessID) (*BusinessConnection, error) }
Bot Interface for a Bot instance. Bot is a high-level interface for interacting with the Telegram API; Bot provides Start Method to Start the Bot using LongPolling. Bot also provides a StartInWebhook to start the Bot in Webhook mode with a Simple Mux HTTP Server. Example for a Simple Echo Bot: ```golang package main
import (
tele "go.mamad.dev/gtb" "os"
)
func main() { tg := tele.New(tele.BotSettings{ Token: os.Getenv("TELEGRAM_TOKEN"), }) tg.Handle("/start", func(c tele.Context) error { return c.Send("Hello Sir, I'm Echo OldBot, Please send me something to echo.") }) tg.Handle(tele.OnText, func(c tele.Context) error { return c.Send(c.Text()) }) tg.Start() }
```
type BotCommand ¶ added in v1.9.0
func (*BotCommand) MarshalJSON ¶ added in v1.9.0
func (f *BotCommand) MarshalJSON() ([]byte, error)
func (*BotCommand) ReflectType ¶ added in v1.9.0
func (c *BotCommand) ReflectType() string
func (*BotCommand) String ¶ added in v1.9.0
func (f *BotCommand) String() string
func (*BotCommand) Type ¶ added in v1.9.0
func (c *BotCommand) Type() string
func (*BotCommand) UnmarshalJSON ¶ added in v1.9.0
func (f *BotCommand) UnmarshalJSON(data []byte) error
func (*BotCommand) Verify ¶ added in v1.9.0
func (f *BotCommand) Verify() error
type BotCommandScope ¶ added in v1.9.0
type BotCommandScope struct { ScopeType BotCommandScopeType `json:"type"` ChatID any `json:"chat_id,omitempty"` UserID any `json:"user_id,omitempty"` }
func (*BotCommandScope) MarshalJSON ¶ added in v1.9.0
func (f *BotCommandScope) MarshalJSON() ([]byte, error)
func (*BotCommandScope) ReflectType ¶ added in v1.9.0
func (c *BotCommandScope) ReflectType() string
func (*BotCommandScope) String ¶ added in v1.9.0
func (f *BotCommandScope) String() string
func (*BotCommandScope) Type ¶ added in v1.9.0
func (c *BotCommandScope) Type() string
func (*BotCommandScope) UnmarshalJSON ¶ added in v1.9.0
func (f *BotCommandScope) UnmarshalJSON(data []byte) error
func (*BotCommandScope) Verify ¶ added in v1.9.0
func (f *BotCommandScope) Verify() error
type BotCommandScopeType ¶ added in v1.9.0
type BotCommandScopeType string
const ( BotCommandScopeDefault BotCommandScopeType = "default" BotCommandScopeAllPrivateChats BotCommandScopeType = "all_private_chats" BotCommandScopeAllGroupChats BotCommandScopeType = "all_group_chats" BotCommandScopeAllChatAdministrators BotCommandScopeType = "all_chat_administrators" BotCommandScopeChat BotCommandScopeType = "chat" BotCommandScopeChatAdministrators BotCommandScopeType = "chat_administrators" BotCommandScopeChatMember BotCommandScopeType = "chat_member" )
type BotSettings ¶ added in v1.9.0
type BusinessConnection ¶ added in v1.10.9
type BusinessConnection struct { // ID Unique identifier of the business connection ID BusinessID `json:"id"` // User Business account user that created the business connection User User `json:"user"` // UserChatID Identifier of a private chat with the user who created the business connection. UserChatID int64 `json:"user_chat_id"` // Date Point in time (Unix timestamp) when the business connection was created Date int64 `json:"date"` // CanReply if the bot can act on behalf of the business account in chats that were active in the last 24 hours CanReply bool `json:"can_reply"` // Enabled if the connection is active Enabled bool `json:"is_enabled"` }
type BusinessID ¶ added in v1.10.9
type BusinessID string
type BusinessIntro ¶ added in v1.10.9
type BusinessLocation ¶ added in v1.10.9
type BusinessMessagesDeleted ¶ added in v1.10.9
type BusinessMessagesDeleted struct { // ID Unique identifier of the business connection ID string `json:"business_connection_id"` // Chat Information about a chat in the business account. The bot may not have access to the chat or the corresponding user. Chat *Chat `json:"chat"` // MessageIds The list of identifiers of deleted messages in the chat of the business account MessageIds []int64 `json:"message_ids"` }
type BusinessOpeningHours ¶ added in v1.10.9
type BusinessOpeningHours struct { TimeZoneName string `json:"time_zone_name"` OpeningHours []OpeningHours `json:"opening_hours"` }
type Button ¶ added in v1.9.0
type Button interface { Button() String() string MarshalJSON() ([]byte, error) UnmarshalJSON(data []byte) error GetText() string SetText(string) Clone() Button // contains filtered or unexported methods }
Button is the interface for all buttons It is implemented by InlineKeyboardButton and KeyboardButton
func NewInlineKeyboardButton ¶ added in v1.9.0
NewInlineKeyboardButton creates a new inline keyboard button with the given text and options.
func NewKeyboardButton ¶ added in v1.9.0
NewKeyboardButton creates a new keyboard button with the given text and options.
type Callback ¶
type Callback struct { ID string `json:"id"` Sender *User `json:"from"` Message *MaybeInaccessibleMessage `json:"message,omitempty"` MessageID string `json:"inline_message_id"` ChatInstance string `json:"chat_instance,omitempty"` Data string `json:"data"` GameShortName string `json:"game_short_name,omitempty"` Unique string `json:"-"` }
func (*Callback) CallbackUnique ¶ added in v1.9.28
func (*Callback) MarshalJSON ¶ added in v1.9.0
func (*Callback) ReflectType ¶ added in v1.9.0
func (*Callback) UnmarshalJSON ¶ added in v1.9.0
type CallbackEndpoint ¶
type CallbackEndpoint interface {
CallbackUnique() string
}
func NewCallbackEndpoint ¶ added in v1.9.28
func NewCallbackEndpoint(unique string) CallbackEndpoint
type CallbackGame ¶ added in v1.9.0
type CallbackGame struct{}
CallbackGame represents a placeholder for game-related information. Use BotFather to set up your game.
func (*CallbackGame) MarshalJSON ¶ added in v1.9.0
func (c *CallbackGame) MarshalJSON() ([]byte, error)
func (*CallbackGame) ReflectType ¶ added in v1.9.0
func (c *CallbackGame) ReflectType() string
func (*CallbackGame) String ¶ added in v1.9.0
func (c *CallbackGame) String() string
func (*CallbackGame) Type ¶ added in v1.9.0
func (c *CallbackGame) Type() string
func (*CallbackGame) UnmarshalJSON ¶ added in v1.9.0
func (c *CallbackGame) UnmarshalJSON(data []byte) error
func (*CallbackGame) Verify ¶ added in v1.9.0
func (c *CallbackGame) Verify() error
type Chat ¶
type Chat struct { // ID is the 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. It has at most 52 significant bits, // so a signed 64-bit integer or double-precision float type are safe for storing this identifier. ID int64 `json:"id"` // Type is the type of chat, which can be either "private", "group", "supergroup" or "channel". ChatType ChatType `json:"type"` // Title is the title for supergroups, channels, and group chats. Title *string `json:"title,omitempty"` // Username is the username for private chats, supergroups, and channels if available. Username *string `json:"username,omitempty"` // FirstName is the first name of the other party in a private chat. FirstName *string `json:"first_name,omitempty"` // LastName is the last name of the other party in a private chat. LastName *string `json:"last_name,omitempty"` // IsForum indicates whether the supergroup chat is a forum (has topics enabled). IsForum *bool `json:"is_forum,omitempty"` // Photo is the chat photo. Returned only in getChat. Photo *ChatPhoto `json:"photo,omitempty"` // ActiveUsernames is the list of all active chat usernames for private chats, supergroups, and channels. // Returned only in getChat. ActiveUsernames []string `json:"active_usernames,omitempty"` // AvailableReactions is the list of available reactions allowed in the chat. // If omitted, then all emoji reactions are allowed. Returned only in getChat. AvailableReactions []ReactionType `json:"available_reactions,omitempty"` // AccentColorID is the identifier of the accent color for the chat name and backgrounds of the chat photo, // reply header, and link preview. Returned only in getChat. Always returned in getChat. // todo: make Custom enum AccentColorID *int `json:"accent_color_id,omitempty"` // BackgroundCustomEmojiID is the custom emoji identifier of emoji chosen by the chat for the reply header and link preview background. // Returned only in getChat. BackgroundCustomEmojiID *string `json:"background_custom_emoji_id,omitempty"` // ProfileAccentColorID is the identifier of the accent color for the chat's profile background. // Returned only in getChat. ProfileAccentColorID *int `json:"profile_accent_color_id,omitempty"` // ProfileBackgroundCustomEmojiID is the custom emoji identifier of the emoji chosen by the chat for its profile background. // Returned only in getChat. ProfileBackgroundCustomEmojiID *string `json:"profile_background_custom_emoji_id,omitempty"` // EmojiStatusCustomEmojiID is the custom emoji identifier of the emoji status of the chat or the other party in a private chat. // Returned only in getChat. EmojiStatusCustomEmojiID *string `json:"emoji_status_custom_emoji_id,omitempty"` // EmojiStatusExpirationDate is the expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any. // Returned only in getChat. EmojiStatusExpirationDate *int `json:"emoji_status_expiration_date,omitempty"` // Bio is the bio of the other party in a private chat. Returned only in getChat. Bio *string `json:"bio,omitempty"` // HasPrivateForwards indicates whether the 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. HasPrivateForwards *bool `json:"has_private_forwards,omitempty"` // HasRestrictedVoiceAndVideoMessages indicates whether the privacy settings of the other party restrict // sending voice and video note messages in the private chat. Returned only in getChat. HasRestrictedVoiceAndVideoMessages *bool `json:"has_restricted_voice_and_video_messages,omitempty"` // JoinToSendMessages indicates whether users need to join the supergroup before they can send messages. // Returned only in getChat. JoinToSendMessages *bool `json:"join_to_send_messages,omitempty"` // JoinByRequest indicates whether all users directly joining the supergroup need to be approved by supergroup administrators. // Returned only in getChat. JoinByRequest *bool `json:"join_by_request,omitempty"` // Description is the description for groups, supergroups, and channel chats. // Returned only in getChat. Description *string `json:"description,omitempty"` // InviteLink is the primary invite link for groups, supergroups, and channel chats. // Returned only in getChat. InviteLink *string `json:"invite_link,omitempty"` // PinnedMessage is the most recent pinned message (by sending date). // Returned only in getChat. PinnedMessage *AccessibleMessage `json:"pinned_message,omitempty"` // Permissions is the default chat member permissions for groups and supergroups. // Returned only in getChat. Permissions *ChatPermissions `json:"permissions,omitempty"` // SlowModeDelay is the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds. // Returned only in getChat. SlowModeDelay *int `json:"slow_mode_delay,omitempty"` // MessageAutoDeleteTime is the time after which all messages sent to the chat will be automatically deleted; in seconds. // Returned only in getChat. MessageAutoDeleteTime *int `json:"message_auto_delete_time,omitempty"` // HasAggressiveAntiSpamEnabled indicates whether aggressive anti-spam checks are enabled in the supergroup. // The field is only available to chat administrators. Returned only in getChat. HasAggressiveAntiSpamEnabled *bool `json:"has_aggressive_anti_spam_enabled,omitempty"` // HasHiddenMembers indicates whether non-administrators can only get the list of bots and administrators in the chat. // Returned only in getChat. HasHiddenMembers *bool `json:"has_hidden_members,omitempty"` // HasProtectedContent indicates whether messages from the chat can't be forwarded to other chats. // Returned only in getChat. HasProtectedContent *bool `json:"has_protected_content,omitempty"` // HasVisibleHistory indicates whether new chat members will have access to old messages; // available only to chat administrators. Returned only in getChat. HasVisibleHistory *bool `json:"has_visible_history,omitempty"` // StickerSetName is the name of the group sticker set. Returned only in getChat. StickerSetName *string `json:"sticker_set_name,omitempty"` // CanSetStickerSet indicates whether the bot can change the group sticker set. Returned only in getChat. CanSetStickerSet *bool `json:"can_set_sticker_set,omitempty"` // LinkedChatID is the 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. LinkedChatID *int64 `json:"linked_chat_id,omitempty"` // Location is the location to which the supergroup is connected. // Returned only in getChat. Location *ChatLocation `json:"location,omitempty"` // UnRestrictBoostCount For supergroups, the minimum number of boosts that a // non-administrator user needs to add in order to ignore slow mode and chat // permissions. Returned only in getChat. UnRestrictBoostCount *int `json:"unrestrict_boost_count,omitempty"` // CustomEmojiStickerSetName For supergroups, // the name of the group's custom emoji sticker set. // Custom emoji from this set can be used by all users and bots in the group. // Returned only in getChat. CustomEmojiStickerSetName *string `json:"custom_emoji_sticker_set_name,omitempty"` PersonalChat *Chat `json:"personal_chat,omitempty"` BusinessIntro *BusinessIntro `json:"business_intro,omitempty"` BusinessLocation *BusinessLocation `json:"business_location,omitempty"` BusinessHours *BusinessOpeningHours `json:"business_opening_hours,omitempty"` BirthDate *BirthDate `json:"birthdate,omitempty"` }
Chat represents a chat.
func (*Chat) MarshalJSON ¶ added in v1.9.0
func (*Chat) ReflectType ¶ added in v1.9.0
func (*Chat) UnmarshalJSON ¶ added in v1.9.0
type ChatAction ¶
type ChatAction string
const ( ChatTyping ChatAction = "typing" ChatUploadPhoto ChatAction = "upload_photo" ChatRecordVideo ChatAction = "record_video" ChatUploadVideo ChatAction = "upload_video" ChatRecordVoice ChatAction = "record_voice" ChatUploadVoice ChatAction = "upload_voice" ChatActionUploadDocument ChatAction = "upload_document" ChatActionChooseSticker ChatAction = "choose_sticker" ChatActionFindLocation ChatAction = "find_location" ChatActionRecordVideoNote ChatAction = "record_video_note" ChatActionUploadVideoNote ChatAction = "upload_video_note" )
type ChatBoost ¶ added in v1.9.0
type ChatBoost struct { // ID Unique identifier of the boost ID string `json:"boost_id"` // AddedDate Point in time (Unix timestamp) when the chat was boosted // todo: #6: change to time.Time AddedDate int64 `json:"add_date"` // ExpiresAt Point in time (Unix timestamp) when the boost will automatically expire, // unless the booster's Telegram Premium subscription is prolonged // todo: #6: change to time.Time ExpiresAt int `json:"expires_at"` // Source Information about the source of the boost Source ChatBoostSource `json:"source"` }
ChatBoost contains information about a chat boost. <a href="https://core.telegram.org/bots/api#chatboost">/bots/api#chatboost</a>
func (*ChatBoost) MarshalJSON ¶ added in v1.9.0
func (*ChatBoost) ReflectType ¶ added in v1.9.0
ReflectType returns the type of the struct
func (*ChatBoost) UnmarshalJSON ¶ added in v1.9.0
type ChatBoostAdded ¶ added in v1.9.0
type ChatBoostAdded struct {
BoostCount int `json:"boost_count"`
}
ChatBoostAdded represents a service message about a user boosting a chat.
func (*ChatBoostAdded) MarshalJSON ¶ added in v1.9.0
func (c *ChatBoostAdded) MarshalJSON() ([]byte, error)
func (*ChatBoostAdded) ReflectType ¶ added in v1.9.0
func (c *ChatBoostAdded) ReflectType() string
func (*ChatBoostAdded) String ¶ added in v1.9.0
func (f *ChatBoostAdded) String() string
func (*ChatBoostAdded) Type ¶ added in v1.9.0
func (c *ChatBoostAdded) Type() string
func (*ChatBoostAdded) UnmarshalJSON ¶ added in v1.9.0
func (c *ChatBoostAdded) UnmarshalJSON(data []byte) error
func (*ChatBoostAdded) Verify ¶ added in v1.9.0
func (c *ChatBoostAdded) Verify() error
type ChatBoostSource ¶ added in v1.9.0
type ChatBoostSource struct { // Source The source of the boost, one of "premium", "gift_code", or "giveaway" Source BoostSource `json:"source"` // User The user who added the boost to the chat. // It can be null if the source is "giveaway" and the winner has not claimed the boost yet User *User `json:"user,omitempty"` // GiveawayID Identifier of a message in the chat with the giveaway; // the message could have been deleted already. May be 0 if the message isn't sent yet. GiveawayID int `json:"giveaway_message_id,omitempty"` // IsUnclaimed True, if the giveaway was completed, but there was no user to win the prize IsUnclaimed bool `json:"is_unclaimed,omitempty"` }
ChatBoostSource describes the source of a chat boost. It can be one of the following: premium (ChatBoostSourcePremium), gift_code (ChatBoostSourceGiftCode), or giveaway (ChatBoostSourceGiveaway). <a href="https://core.telegram.org/bots/api#chatboostsource">/bots/api#chatboostsource</a>
func (*ChatBoostSource) MarshalJSON ¶ added in v1.9.0
func (bs *ChatBoostSource) MarshalJSON() ([]byte, error)
func (*ChatBoostSource) ReflectType ¶ added in v1.9.0
func (bs *ChatBoostSource) ReflectType() string
ReflectType returns the type of the struct
func (*ChatBoostSource) String ¶ added in v1.9.0
func (bs *ChatBoostSource) String() string
func (*ChatBoostSource) Type ¶ added in v1.9.0
func (bs *ChatBoostSource) Type() string
Type returns the type of the struct
func (*ChatBoostSource) UnmarshalJSON ¶ added in v1.9.0
func (bs *ChatBoostSource) UnmarshalJSON(data []byte) error
func (*ChatBoostSource) Verify ¶ added in v1.9.0
func (bs *ChatBoostSource) Verify() error
type ChatInviteLink ¶
type ChatInviteLink struct { // InviteLink is the invite link. InviteLink string `json:"invite_link"` // Creator is the creator of the link. Creator *User `json:"creator,omitempty"` // CreatesJoinRequest indicates if users joining the chat via the link need to be approved by chat administrators. CreatesJoinRequest bool `json:"creates_join_request,omitempty"` // IsPrimary indicates if the link is primary. IsPrimary bool `json:"is_primary,omitempty"` // IsRevoked indicates if the link is revoked. IsRevoked bool `json:"is_revoked,omitempty"` // Name is the invite link name. Name string `json:"name,omitempty"` // ExpireDate is the point in time (Unix timestamp) when the link will expire or has been expired. ExpireDate int64 `json:"expire_date,omitempty"` // MemberLimit is the maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999. MemberLimit int `json:"member_limit,omitempty"` // PendingJoinRequestCount is the number of pending join requests created using this link. PendingJoinRequestCount int `json:"pending_join_request_count,omitempty"` }
ChatInviteLink represents an invite link for a chat.
func (*ChatInviteLink) MarshalJSON ¶ added in v1.9.0
func (c *ChatInviteLink) MarshalJSON() ([]byte, error)
func (*ChatInviteLink) ReflectType ¶ added in v1.9.0
func (c *ChatInviteLink) ReflectType() string
func (*ChatInviteLink) String ¶ added in v1.9.0
func (c *ChatInviteLink) String() string
func (*ChatInviteLink) Type ¶ added in v1.9.0
func (c *ChatInviteLink) Type() string
func (*ChatInviteLink) UnmarshalJSON ¶ added in v1.9.0
func (c *ChatInviteLink) UnmarshalJSON(data []byte) error
func (*ChatInviteLink) Verify ¶ added in v1.9.0
func (c *ChatInviteLink) Verify() error
type ChatJoinRequest ¶
type ChatJoinRequest struct { // Chat is the chat to which the request was sent. Chat Chat `json:"chat"` // From is the user that sent the join request. From User `json:"from"` // UserChatID is the identifier of a private chat with the user who sent the join request. // 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 is safe for storing this identifier. // The bot can use this identifier for 5 minutes to send messages until the join request is processed, assuming no other administrator contacted the user. UserChatID int64 `json:"user_chat_id"` // Date is the date the request was sent in Unix time. Date int64 `json:"date"` // Bio is the bio of the user (optional). Bio string `json:"bio,omitempty"` // InviteLink is the chat invite link that was used by the user to send the join request (optional). InviteLink *ChatInviteLink `json:"invite_link,omitempty"` }
ChatJoinRequest represents a join request sent to a chat.
func (*ChatJoinRequest) MarshalJSON ¶ added in v1.9.0
func (c *ChatJoinRequest) MarshalJSON() ([]byte, error)
func (*ChatJoinRequest) Recipient ¶ added in v1.9.0
func (c *ChatJoinRequest) Recipient() string
func (*ChatJoinRequest) ReflectType ¶ added in v1.9.0
func (c *ChatJoinRequest) ReflectType() string
func (*ChatJoinRequest) String ¶ added in v1.9.0
func (c *ChatJoinRequest) String() string
func (*ChatJoinRequest) Type ¶ added in v1.9.0
func (c *ChatJoinRequest) Type() string
func (*ChatJoinRequest) UnmarshalJSON ¶ added in v1.9.0
func (c *ChatJoinRequest) UnmarshalJSON(b []byte) error
func (*ChatJoinRequest) Verify ¶ added in v1.9.0
func (c *ChatJoinRequest) Verify() error
type ChatLocation ¶
type ChatLocation struct { Location Location `json:"location,omitempty"` Address string `json:"address,omitempty"` }
ChatLocation represents a location to which a chat is connected.
func (*ChatLocation) MarshalJSON ¶ added in v1.9.0
func (c *ChatLocation) MarshalJSON() ([]byte, error)
func (*ChatLocation) ReflectType ¶ added in v1.9.0
func (c *ChatLocation) ReflectType() string
func (*ChatLocation) String ¶ added in v1.9.0
func (c *ChatLocation) String() string
func (*ChatLocation) Type ¶ added in v1.9.0
func (c *ChatLocation) Type() string
func (*ChatLocation) UnmarshalJSON ¶ added in v1.9.0
func (c *ChatLocation) UnmarshalJSON(data []byte) error
func (*ChatLocation) Verify ¶ added in v1.9.0
func (c *ChatLocation) Verify() error
type ChatMember ¶
type ChatMember struct { Rights Status Status `json:"status"` User User `json:"user"` IsAnonymous bool `json:"is_anonymous"` CanManageChat bool `json:"can_manage_chat"` CanDeleteMessages bool `json:"can_delete_messages"` CanManageVideoChats bool `json:"can_manage_video_chats"` CanRestrictMembers bool `json:"can_restrict_members"` CanPromoteMembers bool `json:"can_promote_members"` CanChangeInfo bool `json:"can_change_info"` CanInviteUsers bool `json:"can_invite_users"` CanPostMessages *bool `json:"can_post_messages,omitempty"` CanEditMessages *bool `json:"can_edit_messages,omitempty"` CanPinMessages *bool `json:"can_pin_messages,omitempty"` CanPostStories *bool `json:"can_post_stories,omitempty"` CanEditStories *bool `json:"can_edit_stories,omitempty"` CanDeleteStories *bool `json:"can_delete_stories,omitempty"` CanManageTopics *bool `json:"can_manage_topics,omitempty"` // Additional fields based on the ChatMember type CustomTitle string `json:"custom_title,omitempty"` CanBeEdited bool `json:"can_be_edited,omitempty"` IsMember bool `json:"is_member,omitempty"` CanSendMessages bool `json:"can_send_messages,omitempty"` CanSendAudios bool `json:"can_send_audios,omitempty"` CanSendDocuments bool `json:"can_send_documents,omitempty"` CanSendPhotos bool `json:"can_send_photos,omitempty"` CanSendVideos bool `json:"can_send_videos,omitempty"` CanSendVideoNotes bool `json:"can_send_video_notes,omitempty"` CanSendVoiceNotes bool `json:"can_send_voice_notes,omitempty"` CanSendPolls bool `json:"can_send_polls,omitempty"` CanSendOtherMessages bool `json:"can_send_other_messages,omitempty"` CanAddWebPagePreviews bool `json:"can_add_web_page_previews,omitempty"` UntilDate int `json:"until_date,omitempty"` }
ChatMember represents information about a member of a chat.
func (*ChatMember) MarshalJSON ¶ added in v1.9.0
func (c *ChatMember) MarshalJSON() ([]byte, error)
func (*ChatMember) ReflectType ¶ added in v1.9.0
func (c *ChatMember) ReflectType() string
func (*ChatMember) String ¶ added in v1.9.0
func (c *ChatMember) String() string
func (*ChatMember) Type ¶ added in v1.9.0
func (c *ChatMember) Type() string
func (*ChatMember) UnmarshalJSON ¶ added in v1.9.0
func (c *ChatMember) UnmarshalJSON(data []byte) error
func (*ChatMember) Verify ¶ added in v1.9.0
func (c *ChatMember) Verify() error
type ChatMemberPermission ¶ added in v1.9.0
type ChatMemberPermission int
ChatMemberPermission represents the chat member role permissions.
const ( // IsAnonymous indicates whether the administrator's presence in the chat is hidden. IsAnonymous ChatMemberPermission = iota // CanManageChat indicates whether the administrator can access the chat event log, // boost list in channels, see channel members, report spam messages, // see anonymous administrators in supergroups, and ignore slow mode. CanManageChat // CanDeleteMessages indicates whether the administrator can delete messages of other users. CanDeleteMessages // CanManageVideoChats indicates whether the administrator can manage video chats. CanManageVideoChats // CanRestrictMembers indicates whether the administrator can restrict, ban, or unban chat members, // or access supergroup statistics. CanRestrictMembers // CanPromoteMembers indicates whether the administrator can add new administrators with a subset of their own privileges // or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by him). CanPromoteMembers // CanChangeInfo indicates whether the administrator can change chat title, photo, and other settings. CanChangeInfo // CanInviteUsers indicates whether the administrator can invite new users to the chat. CanInviteUsers // CanPostMessages indicates whether the administrator can post messages in the channel // or access channel statistics (channels only). CanPostMessages // CanEditMessages indicates whether the administrator can edit messages of other users // and can pin messages (channels only). CanEditMessages // CanPinMessages indicates whether the administrator can pin messages (supergroups only). CanPinMessages // CanPostStories indicates whether the administrator can post stories in the channel (channels only). CanPostStories // CanEditStories indicates whether the administrator can edit stories posted by other users (channels only). CanEditStories // CanDeleteStories indicates whether the administrator can delete stories posted by other users (channels only). CanDeleteStories // CanManageTopics indicates whether the user is allowed to create, rename, close, and reopen forum topics (supergroups only). CanManageTopics )
func (*ChatMemberPermission) String ¶ added in v1.9.0
func (p *ChatMemberPermission) String() string
type ChatMemberUpdated ¶ added in v1.9.0
type ChatMemberUpdated struct { // Chat is the chat the user belongs to. Chat Chat `json:"chat"` // From is the performer of the action, which resulted in the change. From User `json:"from"` // Date is the date the change was done in Unix time. Date int64 `json:"date"` // OldChatMember is the previous information about the chat member. OldChatMember ChatMember `json:"old_chat_member"` // NewChatMember is the new information about the chat member. NewChatMember ChatMember `json:"new_chat_member"` // InviteLink is the chat invite link, which was used by the user to join the chat (optional, for joining by invite link events only). InviteLink *ChatInviteLink `json:"invite_link,omitempty"` // ViaChatFolderInviteLink is true if the user joined the chat via a chat folder invite link (optional). ViaChatFolderInviteLink bool `json:"via_chat_folder_invite_link,omitempty"` ViaJoinRequest bool `json:"via_join_request,omitempty"` }
ChatMemberUpdated represents changes in the status of a chat member.
func (*ChatMemberUpdated) MarshalJSON ¶ added in v1.9.0
func (c *ChatMemberUpdated) MarshalJSON() ([]byte, error)
func (*ChatMemberUpdated) ReflectType ¶ added in v1.9.0
func (c *ChatMemberUpdated) ReflectType() string
func (*ChatMemberUpdated) String ¶ added in v1.9.0
func (c *ChatMemberUpdated) String() string
func (*ChatMemberUpdated) Type ¶ added in v1.9.0
func (c *ChatMemberUpdated) Type() string
func (*ChatMemberUpdated) UnmarshalJSON ¶ added in v1.9.0
func (c *ChatMemberUpdated) UnmarshalJSON(b []byte) error
func (*ChatMemberUpdated) Verify ¶ added in v1.9.0
func (c *ChatMemberUpdated) Verify() error
type ChatPermissions ¶ added in v1.9.0
type ChatPermissions struct { // CanSendMessages indicates whether the user is allowed to send text messages, contacts, giveaways, giveaway winners, invoices, locations, and venues. CanSendMessages *bool `json:"can_send_messages,omitempty"` // CanSendAudios indicates whether the user is allowed to send audios. CanSendAudios *bool `json:"can_send_audios,omitempty"` // CanSendDocuments indicates whether the user is allowed to send documents. CanSendDocuments *bool `json:"can_send_documents,omitempty"` // CanSendPhotos indicates whether the user is allowed to send photos. CanSendPhotos *bool `json:"can_send_photos,omitempty"` // CanSendVideos indicates whether the user is allowed to send videos. CanSendVideos *bool `json:"can_send_videos,omitempty"` // CanSendVideoNotes indicates whether the user is allowed to send video notes. CanSendVideoNotes *bool `json:"can_send_video_notes,omitempty"` // CanSendVoiceNotes indicates whether the user is allowed to send voice notes. CanSendVoiceNotes *bool `json:"can_send_voice_notes,omitempty"` // CanSendPolls indicates whether the user is allowed to send polls. CanSendPolls *bool `json:"can_send_polls,omitempty"` // CanSendOtherMessages indicates whether the user is allowed to send animations, games, stickers, and use inline bots. CanSendOtherMessages *bool `json:"can_send_other_messages,omitempty"` // CanAddWebPagePreviews indicates whether the user is allowed to add web page previews to their messages. CanAddWebPagePreviews *bool `json:"can_add_web_page_previews,omitempty"` // CanChangeInfo indicates whether the user is allowed to change the chat title, photo, and other settings. Ignored in public supergroups. CanChangeInfo *bool `json:"can_change_info,omitempty"` // CanInviteUsers indicates whether the user is allowed to invite new users to the chat. CanInviteUsers *bool `json:"can_invite_users,omitempty"` // CanPinMessages indicates whether the user is allowed to pin messages. Ignored in public supergroups. CanPinMessages *bool `json:"can_pin_messages,omitempty"` // CanManageTopics indicates whether the user is allowed to create forum topics. If omitted, defaults to the value of can_pin_messages. CanManageTopics *bool `json:"can_manage_topics,omitempty"` }
ChatPermissions describes actions that a non-administrator user is allowed to take in a chat.
func (*ChatPermissions) MarshalJSON ¶ added in v1.9.0
func (c *ChatPermissions) MarshalJSON() ([]byte, error)
func (*ChatPermissions) ReflectType ¶ added in v1.9.0
func (c *ChatPermissions) ReflectType() string
func (*ChatPermissions) String ¶ added in v1.9.0
func (c *ChatPermissions) String() string
func (*ChatPermissions) Type ¶ added in v1.9.0
func (c *ChatPermissions) Type() string
func (*ChatPermissions) UnmarshalJSON ¶ added in v1.9.0
func (c *ChatPermissions) UnmarshalJSON(data []byte) error
func (*ChatPermissions) Verify ¶ added in v1.9.0
func (c *ChatPermissions) Verify() error
type ChatPhoto ¶
type ChatPhoto struct { // File identifiers of small (160x160) chat photo SmallFileID string `json:"small_file_id"` SmallUniqueID string `json:"small_file_unique_id"` // File identifiers of big (640x640) chat photo BigFileID string `json:"big_file_id"` BigUniqueID string `json:"big_file_unique_id"` }
ChatPhoto object represents a chat photo.
func (*ChatPhoto) MarshalJSON ¶ added in v1.9.0
func (*ChatPhoto) ReflectType ¶ added in v1.9.0
func (*ChatPhoto) UnmarshalJSON ¶ added in v1.9.0
type ChatShared ¶
type ChatShared struct { int `json:"request_id"` // 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"` }RequestID
ChatShared contains information about the chat whose identifier was shared with the bot using a KeyboardButtonRequestChat button.
func (*ChatShared) MarshalJSON ¶ added in v1.9.0
func (f *ChatShared) MarshalJSON() ([]byte, error)
func (*ChatShared) ReflectType ¶ added in v1.9.0
func (c *ChatShared) ReflectType() string
func (*ChatShared) String ¶ added in v1.9.0
func (f *ChatShared) String() string
func (*ChatShared) Type ¶ added in v1.9.0
func (c *ChatShared) Type() string
func (*ChatShared) UnmarshalJSON ¶ added in v1.9.0
func (f *ChatShared) UnmarshalJSON(data []byte) error
func (*ChatShared) Verify ¶ added in v1.9.0
func (f *ChatShared) Verify() error
type ChosenInlineResult ¶ added in v1.9.0
type ChosenInlineResult struct { // ResultID is the unique identifier for the result that was chosen. ID string `json:"result_id"` // From is the user that chose the result. From User `json:"from"` // Location is the sender's location (optional, only for bots that require user location). Location *Location `json:"location,omitempty"` // InlineMessageID is the identifier of the sent inline message. Available only if there is an inline keyboard attached to the message. // Will be also received in callback queries and can be used to edit the message. InlineMessageID string `json:"inline_message_id,omitempty"` // Query is the query that was used to obtain the result. Query string `json:"query"` }
func (*ChosenInlineResult) MarshalJSON ¶ added in v1.9.0
func (c *ChosenInlineResult) MarshalJSON() ([]byte, error)
func (*ChosenInlineResult) ReflectType ¶ added in v1.9.0
func (c *ChosenInlineResult) ReflectType() string
func (*ChosenInlineResult) String ¶ added in v1.9.0
func (c *ChosenInlineResult) String() string
func (*ChosenInlineResult) Type ¶ added in v1.9.0
func (c *ChosenInlineResult) Type() string
func (*ChosenInlineResult) UnmarshalJSON ¶ added in v1.9.0
func (c *ChosenInlineResult) UnmarshalJSON(b []byte) error
func (*ChosenInlineResult) Verify ¶ added in v1.9.0
func (c *ChosenInlineResult) Verify() error
type Contact ¶
type Contact struct { // PhoneNumber is the contact's phone number. PhoneNumber string `json:"phone_number"` // FirstName is the contact's first name. FirstName string `json:"first_name"` // LastName is an optional field representing the contact's last name. LastName *string `json:"last_name,omitempty"` // UserID is an optional field representing the 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 is safe for storing this identifier. UserID *int64 `json:"user_id,omitempty"` // VCard is an optional field providing additional data about the contact in the form of a vCard. VCard *string `json:"vcard,omitempty"` }
Contact represents a phone contact.
func (*Contact) MarshalJSON ¶ added in v1.9.0
func (*Contact) ReflectType ¶ added in v1.9.0
func (*Contact) UnmarshalJSON ¶ added in v1.9.0
type Context ¶
type Context interface { // Bot returns the bot instance. Bot() Bot // Update returns the original update. Update() Update // Message returns stored *AccessibleMessage if such presented. Message() *AccessibleMessage // Callback returns stored callback if such presented. Callback() *Callback // Query returns stored query if such presented. Query() *InlineQuery // Get retrieves data from the context. Get(key string) any // Set saves data in the context. Set(key string, val any) ReplyTo(msg Message, text string, options ...any) (Message, error) Reply(text string, options ...any) (Message, error) Send(s any, options ...any) (Message, error) EditOrReply(text string, options ...any) (Message, error) Edit(text string, options ...any) (Message, error) Text() string Sender() *User Args() []string }
Context wraps an update and represents the context of the current event.
type CustomEmoji ¶
type CustomEmoji string
type Dice ¶
type Dice struct { // Emoji is the emoji on which the dice throw animation is based. Emoji StickerEmoji `json:"emoji"` // Value is the value of the dice. // For “🎲”, “🎯”, and “🎳” base emoji, the value ranges from 1 to 6. // For “🏀” and “⚽” base emoji, the value ranges from 1 to 5. // For “🎰” base emoji, the value ranges from 1 to 64. Value int `json:"value"` }
Dice represents an animated emoji that displays a random value.
func (*Dice) MarshalJSON ¶ added in v1.9.0
func (*Dice) ReflectType ¶ added in v1.9.0
func (*Dice) UnmarshalJSON ¶ added in v1.9.0
type DiceEmoji ¶ added in v1.9.0
type DiceEmoji StickerEmoji
DiceEmoji on which the dice throw animation is based. Currently, must be one of “🎲”, “🎯”, “🏀”, “⚽”, “🎳”, or “🎰”. Dice can have values 1-6 for “🎲”, “🎯” and “🎳”, values 1-5 for “🏀” and “⚽”, and values 1-64 for “🎰”. Defaults to “🎲”
type Document ¶
type Document struct { // FileID is the identifier for this file, which can be used to download or reuse the file. FileID string `json:"file_id"` // FileUniqueID is the unique identifier for this file, which is supposed to be the same over time and for different bots. // It can't be used to download or reuse the file. FileUniqueID string `json:"file_unique_id"` // Thumbnail is the document thumbnail as defined by the sender (optional). Thumbnail *PhotoSize `json:"thumbnail,omitempty"` // FileName is the original filename as defined by the sender (optional). FileName string `json:"file_name,omitempty"` // MimeType is the MIME type of the file as defined by the sender (optional). MimeType string `json:"mime_type,omitempty"` // FileSize is the file size in bytes. It can be bigger than 2^31, 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 is safe for storing this value (optional). FileSize int64 `json:"file_size,omitempty"` }
Document represents a general file (as opposed to photos, voice messages, and audio files).
func (*Document) MarshalJSON ¶ added in v1.9.0
func (*Document) ReflectType ¶ added in v1.9.0
func (*Document) UnmarshalJSON ¶ added in v1.9.0
type Emoji ¶ added in v1.9.0
type Emoji StickerEmoji
const ( EmojiLike Emoji = "👍" EmojiDislike Emoji = "👎" EmojiHeart Emoji = "❤" EmojiFire Emoji = "🔥" EmojiLove Emoji = "🥰" EmojiClap Emoji = "👏" EmojiSmile Emoji = "😁" EmojiThink Emoji = "🤔" EmojiMindBlown Emoji = "🤯" EmojiScream Emoji = "😱" EmojiAngry Emoji = "🤬" EmojiCry Emoji = "😢" EmojiParty Emoji = "🎉" EmojiExcited Emoji = "🤩" EmojiVomit Emoji = "🤮" EmojiPoop Emoji = "💩" EmojiPray Emoji = "🙏" EmojiOk Emoji = "👌" EmojiDove Emoji = "🕊" EmojiClown Emoji = "🤡" EmojiYawn Emoji = "🥱" EmojiDrunk Emoji = "🥴" EmojiHeartEyes Emoji = "😍" EmojiDolphin Emoji = "🐳" EmojiHeartFire Emoji = "❤🔥" EmojiMoon Emoji = "🌚" EmojiHotdog Emoji = "🌭" EmojiHundred Emoji = "💯" EmojiLaugh Emoji = "🤣" EmojiLightning Emoji = "⚡" EmojiBanana Emoji = "🍌" EmojiTrophy Emoji = "🏆" EmojiBroken Emoji = "💔" EmojiSkeptical Emoji = "🤨" EmojiNeutral Emoji = "😐" EmojiStrawberry Emoji = "🍓" EmojiChampagne Emoji = "🍾" EmojiKiss Emoji = "💋" EmojiFuckYou Emoji = "🖕" EmojiEvil Emoji = "😈" EmojiSleep Emoji = "😴" EmojiCrying Emoji = "😭" EmojiNerd Emoji = "🤓" EmojiGhost Emoji = "👻" EmojiComputer Emoji = "👨💻" EmojiEyes Emoji = "👀" EmojiJackO Emoji = "🎃" EmojiSeeNoEvil Emoji = "🙈" EmojiAngel Emoji = "😇" EmojiFearful Emoji = "😨" EmojiHandshake Emoji = "🤝" EmojiWriting Emoji = "✍" EmojiHugging Emoji = "🤗" EmojiSmiling Emoji = "🫡" EmojiSanta Emoji = "🎅" EmojiChristmas Emoji = "🎄" EmojiSnowman Emoji = "☃" EmojiNailPolish Emoji = "💅" EmojiZany Emoji = "🤪" EmojiMoai Emoji = "🗿" EmojiCool Emoji = "🆒" EmojiHearts Emoji = "💘" EmojiHearNoEvil Emoji = "🙉" EmojiUnicorn Emoji = "🦄" EmojiKissing Emoji = "😘" EmojiPill Emoji = "💊" EmojiSayNoEvil Emoji = "🙊" EmojiSunglasses Emoji = "😎" EmojiAlien Emoji = "👾" EmojiMan Emoji = "🤷♂" EmojiWoman Emoji = "🤷" EmojiWoman2 Emoji = "🤷♀" EmojiAngry2 Emoji = "😡" )
type EncryptedCredentials ¶ added in v1.9.0
type EncryptedCredentials struct { // Data is Base64-encoded encrypted JSON-serialized data with unique user's payload, data hashes, and secrets required for EncryptedPassportElement decryption and authentication. Data string `json:"data"` // Hash is Base64-encoded data hash for data authentication. Hash string `json:"hash"` // Secret is Base64-encoded secret, encrypted with the bot's public RSA key, required for data decryption. Secret string `json:"secret"` }
EncryptedCredentials describes data required for decrypting and authenticating EncryptedPassportElement.
func (*EncryptedCredentials) MarshalJSON ¶ added in v1.9.0
func (c *EncryptedCredentials) MarshalJSON() ([]byte, error)
func (*EncryptedCredentials) ReflectType ¶ added in v1.9.0
func (c *EncryptedCredentials) ReflectType() string
func (*EncryptedCredentials) String ¶ added in v1.9.0
func (f *EncryptedCredentials) String() string
func (*EncryptedCredentials) Type ¶ added in v1.9.0
func (c *EncryptedCredentials) Type() string
func (*EncryptedCredentials) UnmarshalJSON ¶ added in v1.9.0
func (c *EncryptedCredentials) UnmarshalJSON(data []byte) error
func (*EncryptedCredentials) Verify ¶ added in v1.9.0
func (c *EncryptedCredentials) Verify() error
type EncryptedPassportElement ¶ added in v1.9.0
type EncryptedPassportElement struct { // ElementType is the element type, one of the predefined types. ElementType string `json:"type"` // Data is optional. Base64-encoded encrypted Telegram Passport element data provided by the user, available for certain types. // Can be decrypted and verified using the accompanying EncryptedCredentials. Data string `json:"data,omitempty"` // PhoneNumber is optional. User's verified phone number, available only for "phone_number" type. PhoneNumber string `json:"phone_number,omitempty"` // Email is optional. User's verified email address, available only for "email" type. Email string `json:"email,omitempty"` // Files is an array of encrypted files with documents provided by the user, available for certain types. // Files can be decrypted and verified using the accompanying EncryptedCredentials. Files []PassportFile `json:"files,omitempty"` // FrontSide is an encrypted file with the front side of the document, provided by the user. // Available for certain types. The file can be decrypted and verified using the accompanying EncryptedCredentials. FrontSide *PassportFile `json:"front_side,omitempty"` // ReverseSide is an encrypted file with the reverse side of the document, provided by the user. // Available for certain types. The file can be decrypted and verified using the accompanying EncryptedCredentials. ReverseSide *PassportFile `json:"reverse_side,omitempty"` // Selfie is an encrypted file with the selfie of the user holding a document, provided by the user. // Available for certain types. The file can be decrypted and verified using the accompanying EncryptedCredentials. Selfie *PassportFile `json:"selfie,omitempty"` // Translation is an array of encrypted files with translated versions of documents provided by the user. // Available if requested for certain types. Files can be decrypted and verified using the accompanying EncryptedCredentials. Translation []PassportFile `json:"translation,omitempty"` // Hash is the Base64-encoded element hash for using in PassportElementErrorUnspecified. Hash string `json:"hash"` }
EncryptedPassportElement describes documents or other Telegram Passport elements shared with the bot by the user.
func (*EncryptedPassportElement) MarshalJSON ¶ added in v1.9.0
func (c *EncryptedPassportElement) MarshalJSON() ([]byte, error)
func (*EncryptedPassportElement) ReflectType ¶ added in v1.9.0
func (c *EncryptedPassportElement) ReflectType() string
func (*EncryptedPassportElement) String ¶ added in v1.9.0
func (f *EncryptedPassportElement) String() string
func (*EncryptedPassportElement) Type ¶ added in v1.9.0
func (c *EncryptedPassportElement) Type() string
func (*EncryptedPassportElement) UnmarshalJSON ¶ added in v1.9.0
func (c *EncryptedPassportElement) UnmarshalJSON(data []byte) error
func (*EncryptedPassportElement) Verify ¶ added in v1.9.0
func (c *EncryptedPassportElement) Verify() error
type Entity ¶ added in v1.9.0
type Entity struct { EntityType EntityType `json:"type"` Offset int `json:"offset"` Length int `json:"length"` URL string `json:"url,omitempty"` User *User `json:"user,omitempty"` Language *string `json:"language,omitempty"` CustomEmojiID *CustomEmoji `json:"custom_emoji_id,omitempty"` }
func (*Entity) MarshalJSON ¶ added in v1.9.0
func (*Entity) ReflectType ¶ added in v1.9.0
func (*Entity) UnmarshalJSON ¶ added in v1.9.0
type EntityType ¶
type EntityType string
const ( EntityTypeMention EntityType = "mention" EntityTypeHashtag EntityType = "hashtag" EntityTypeCashTag EntityType = "cashtag" EntityTypeBotCommand EntityType = "bot_command" EntityTypeURL EntityType = "url" EntityTypeEmail EntityType = "email" EntityTypePhoneNumber EntityType = "phone_number" EntityTypeBold EntityType = "bold" EntityTypeItalic EntityType = "italic" EntityTypeUnderline EntityType = "underline" EntityTypeStrikethrough EntityType = "strikethrough" EntityTypeSpoiler EntityType = "spoiler" EntityTypeBlockquote EntityType = "blockquote" EntityTypeCode EntityType = "code" EntityTypePre EntityType = "pre" EntityTypeTextLink EntityType = "text_link" EntityTypeTextMention EntityType = "text_mention" EntityTypeCustomEmoji EntityType = "custom_emoji" )
type Error ¶
type ExternalReplyInfo ¶ added in v1.9.0
type ExternalReplyInfo struct { Origin MessageOrigin `json:"origin"` Chat *Chat `json:"chat,omitempty"` ID *int `json:"message_id,omitempty"` LinkPreviewOptions *LinkPreviewOptions `json:"link_preview_options,omitempty"` Animation *Animation `json:"animation,omitempty"` Audio *Audio `json:"audio,omitempty"` Document *Document `json:"document,omitempty"` Photo []PhotoSize `json:"photo,omitempty"` Sticker *Sticker `json:"sticker,omitempty"` Story *Story `json:"story,omitempty"` Video *Video `json:"video,omitempty"` VideoNote *VideoNote `json:"video_note,omitempty"` Voice *Voice `json:"voice,omitempty"` HasMediaSpoiler *bool `json:"has_media_spoiler,omitempty"` Contact *Contact `json:"contact,omitempty"` Dice *Dice `json:"dice,omitempty"` Game *Game `json:"game,omitempty"` Giveaway *Giveaway `json:"giveaway,omitempty"` GiveawayWinners *GiveawayWinners `json:"giveaway_winners,omitempty"` Invoice *Invoice `json:"invoice,omitempty"` Location *Location `json:"location,omitempty"` Poll *Poll `json:"poll,omitempty"` Venue *Venue `json:"venue,omitempty"` }
func (*ExternalReplyInfo) MarshalJSON ¶ added in v1.9.0
func (u *ExternalReplyInfo) MarshalJSON() ([]byte, error)
func (*ExternalReplyInfo) ReflectType ¶ added in v1.9.0
func (u *ExternalReplyInfo) ReflectType() string
func (*ExternalReplyInfo) String ¶ added in v1.9.0
func (u *ExternalReplyInfo) String() string
func (*ExternalReplyInfo) Type ¶ added in v1.9.0
func (u *ExternalReplyInfo) Type() string
func (*ExternalReplyInfo) UnmarshalJSON ¶ added in v1.9.0
func (u *ExternalReplyInfo) UnmarshalJSON(data []byte) error
func (*ExternalReplyInfo) Verify ¶ added in v1.9.0
func (u *ExternalReplyInfo) Verify() error
type File ¶
type File struct { FileID string `json:"file_id"` UniqueID string `json:"file_unique_id"` FileSize int64 `json:"file_size"` // FilePath is used for files on Telegram server. FilePath string `json:"file_path"` // FileLocal is used for files on local file system. FileLocal string `json:"file_local"` // FileURL is used for file on the internet. FileURL string `json:"file_url"` // FileReader is used for file backed with io.Reader. FileReader io.Reader `json:"-"` // contains filtered or unexported fields }
File object represents any sort of file.
func FromDisk ¶
FromDisk constructs a new local (on-disk) file object.
Note, it returns File, not *File for a very good reason: in telebot, File is pretty much an embeddable struct, so upon uploading media you'll need to set embedded File with something. NewFile() returning File makes it a one-liner.
photo := &tele.Photo{File: tele.FromDisk("chicken.jpg")}
func FromFileID ¶ added in v1.9.0
FromFileID constructs a new file from file_id.
func FromReader ¶
FromReader constructs a new file from io.Reader.
Note, it returns File, not *File for a very good reason: in telebot, File is pretty much an embeddable struct, so upon uploading media you'll need to set embedded File with something. NewFile() returning File makes it a one-liner.
photo := &tele.Photo{File: tele.FromReader(bytes.NewReader(...))}
func FromURL ¶
FromURL constructs a new file on provided HTTP URL.
Note, it returns File, not *File for a very good reason: in telebot, File is pretty much an embeddable struct, so upon uploading media you'll need to set embedded File with something. NewFile() returning File makes it a one-liner.
photo := &tele.Photo{File: tele.FromURL("https://site.com/picture.jpg")}
func (*File) GetFileLocal ¶ added in v1.9.0
func (*File) GetFileName ¶ added in v1.9.0
func (*File) GetFilePath ¶ added in v1.9.0
func (*File) GetFileReader ¶ added in v1.9.0
func (*File) GetFileSize ¶ added in v1.9.0
func (*File) GetFileURL ¶ added in v1.9.0
func (*File) MarshalJSON ¶ added in v1.9.0
func (*File) ReflectType ¶ added in v1.9.0
func (*File) SetFileName ¶ added in v1.10.10
func (*File) URL ¶ added in v1.9.0
URL currently only supports TELEGRAM's OFFICIAL API URL todo: implement SelfHosted API Support
func (*File) UnmarshalJSON ¶ added in v1.9.0
type FloodError ¶
type FloodError struct { RetryAfter int // contains filtered or unexported fields }
type ForceReplyMarkup ¶ added in v1.9.0
type ForceReplyMarkup struct { // ForceReply requests clients to display a reply interface to the user (act as if the user selected the bot's message and tapped 'Reply'). // This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to sacrifice privacy mode. // Available in private chats only ForceReply bool `json:"force_reply"` // InputFieldPlaceholder is the placeholder to be shown in the input field when the reply interface is active; 1-64 characters InputFieldPlaceholder *string `json:"input_field_placeholder,omitempty"` // Selective Use this parameter if you want to force reply from specific users only Selective *bool `json:"selective,omitempty"` }
ForceReplyMarkup requests clients to display a reply interface to the user (act as if the user selected the bot's message and tapped 'Reply'). This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to sacrifice privacy mode. Available in private chats only
func (*ForceReplyMarkup) MarshalJSON ¶ added in v1.9.0
func (m *ForceReplyMarkup) MarshalJSON() ([]byte, error)
func (*ForceReplyMarkup) ReflectType ¶ added in v1.9.0
func (m *ForceReplyMarkup) ReflectType() string
func (*ForceReplyMarkup) String ¶ added in v1.9.0
func (m *ForceReplyMarkup) String() string
func (*ForceReplyMarkup) Type ¶ added in v1.9.0
func (m *ForceReplyMarkup) Type() string
func (*ForceReplyMarkup) UnmarshalJSON ¶ added in v1.9.0
func (m *ForceReplyMarkup) UnmarshalJSON(data []byte) error
func (*ForceReplyMarkup) Verify ¶ added in v1.9.0
func (m *ForceReplyMarkup) Verify() error
type ForumTopic ¶
type ForumTopic struct { ID int64 `json:"message_thread_id"` Name string `json:"name"` IconColor IconColor `json:"icon_color"` IconCustomEmojiID CustomEmoji `json:"icon_custom_emoji_id,omitempty"` }
func (*ForumTopic) MarshalJSON ¶ added in v1.9.0
func (f *ForumTopic) MarshalJSON() ([]byte, error)
func (*ForumTopic) ReflectType ¶ added in v1.9.0
func (c *ForumTopic) ReflectType() string
func (*ForumTopic) String ¶ added in v1.9.0
func (f *ForumTopic) String() string
func (*ForumTopic) Type ¶ added in v1.9.0
func (c *ForumTopic) Type() string
func (*ForumTopic) UnmarshalJSON ¶ added in v1.9.0
func (f *ForumTopic) UnmarshalJSON(data []byte) error
func (*ForumTopic) Verify ¶ added in v1.9.0
func (f *ForumTopic) Verify() error
type ForumTopicClosed ¶
type ForumTopicClosed struct{}
ForumTopicClosed represents a service message about a forum topic closed in the chat. Currently holds no information.
func (*ForumTopicClosed) MarshalJSON ¶ added in v1.9.0
func (f *ForumTopicClosed) MarshalJSON() ([]byte, error)
func (*ForumTopicClosed) ReflectType ¶ added in v1.9.0
func (c *ForumTopicClosed) ReflectType() string
func (*ForumTopicClosed) String ¶ added in v1.9.0
func (f *ForumTopicClosed) String() string
func (*ForumTopicClosed) Type ¶ added in v1.9.0
func (c *ForumTopicClosed) Type() string
func (*ForumTopicClosed) UnmarshalJSON ¶ added in v1.9.0
func (f *ForumTopicClosed) UnmarshalJSON(data []byte) error
func (*ForumTopicClosed) Verify ¶ added in v1.9.0
func (f *ForumTopicClosed) Verify() error
type ForumTopicCreated ¶
type ForumTopicCreated struct { // Name is the name of the topic. Name string `json:"name"` // IconColor is the color of the topic icon in RGB format. IconColor IconColor `json:"icon_color"` // IconCustomEmojiID is an optional unique identifier of the custom emoji shown as the topic icon. IconCustomEmojiID string `json:"icon_custom_emoji_id,omitempty"` }
ForumTopicCreated represents a service message about a new forum topic created in the chat.
func (*ForumTopicCreated) MarshalJSON ¶ added in v1.9.0
func (f *ForumTopicCreated) MarshalJSON() ([]byte, error)
func (*ForumTopicCreated) ReflectType ¶ added in v1.9.0
func (c *ForumTopicCreated) ReflectType() string
func (*ForumTopicCreated) String ¶ added in v1.9.0
func (f *ForumTopicCreated) String() string
func (*ForumTopicCreated) Type ¶ added in v1.9.0
func (c *ForumTopicCreated) Type() string
func (*ForumTopicCreated) UnmarshalJSON ¶ added in v1.9.0
func (f *ForumTopicCreated) UnmarshalJSON(data []byte) error
func (*ForumTopicCreated) Verify ¶ added in v1.9.0
func (f *ForumTopicCreated) Verify() error
type ForumTopicEdited ¶
type ForumTopicEdited struct { // Name is optional. New name of the topic, if it was edited. Name string `json:"name,omitempty"` // IconCustomEmojiID is optional. New identifier of the custom emoji shown as the topic icon, if it was edited; // an empty string if the icon was removed. IconCustomEmojiID string `json:"icon_custom_emoji_id,omitempty"` }
ForumTopicEdited represents a service message about an edited forum topic.
func (*ForumTopicEdited) MarshalJSON ¶ added in v1.9.0
func (f *ForumTopicEdited) MarshalJSON() ([]byte, error)
func (*ForumTopicEdited) ReflectType ¶ added in v1.9.0
func (c *ForumTopicEdited) ReflectType() string
func (*ForumTopicEdited) String ¶ added in v1.9.0
func (f *ForumTopicEdited) String() string
func (*ForumTopicEdited) Type ¶ added in v1.9.0
func (c *ForumTopicEdited) Type() string
func (*ForumTopicEdited) UnmarshalJSON ¶ added in v1.9.0
func (f *ForumTopicEdited) UnmarshalJSON(data []byte) error
func (*ForumTopicEdited) Verify ¶ added in v1.9.0
func (f *ForumTopicEdited) Verify() error
type ForumTopicReopened ¶
type ForumTopicReopened struct{}
ForumTopicReopened represents a service message about a forum topic reopened in the chat. Currently holds no information.
func (*ForumTopicReopened) MarshalJSON ¶ added in v1.9.0
func (f *ForumTopicReopened) MarshalJSON() ([]byte, error)
func (*ForumTopicReopened) ReflectType ¶ added in v1.9.0
func (c *ForumTopicReopened) ReflectType() string
func (*ForumTopicReopened) String ¶ added in v1.9.0
func (f *ForumTopicReopened) String() string
func (*ForumTopicReopened) Type ¶ added in v1.9.0
func (c *ForumTopicReopened) Type() string
func (*ForumTopicReopened) UnmarshalJSON ¶ added in v1.9.0
func (f *ForumTopicReopened) UnmarshalJSON(data []byte) error
func (*ForumTopicReopened) Verify ¶ added in v1.9.0
func (f *ForumTopicReopened) Verify() error
type Game ¶
type Game struct { // Title is the title of the game. Title string `json:"title"` // Description is the description of the game. Description string `json:"description"` // Photo is an array of PhotoSize representing the photo that will be displayed in the game message in chats. Photo []PhotoSize `json:"photo"` // Text is an optional field providing a brief description of the game or high scores included in the game message. // It can be automatically edited to include current high scores for the game when the bot calls setGameScore, // or manually edited using editMessageText. It can have 0-4096 characters. Text *string `json:"text,omitempty"` // TextEntities is an optional field representing special entities that appear in text, such as usernames, URLs, bot commands, etc. TextEntities []Entity `json:"text_entities,omitempty"` // Animation is an optional field representing the animation that will be displayed in the game message in chats. // Upload via BotFather. Animation *Animation `json:"animation,omitempty"` }
Game represents a game. Use BotFather to create and edit games; their short names will act as unique identifiers.
func (*Game) MarshalJSON ¶ added in v1.9.0
func (*Game) ReflectType ¶ added in v1.9.0
func (*Game) UnmarshalJSON ¶ added in v1.9.0
type GameHighScore ¶
type GameHighScore struct { Position int `json:"position"` User User `json:"user"` Score int `json:"score"` }
func (*GameHighScore) MarshalJSON ¶ added in v1.9.0
func (f *GameHighScore) MarshalJSON() ([]byte, error)
func (*GameHighScore) ReflectType ¶ added in v1.9.0
func (c *GameHighScore) ReflectType() string
func (*GameHighScore) String ¶ added in v1.9.0
func (f *GameHighScore) String() string
func (*GameHighScore) Type ¶ added in v1.9.0
func (c *GameHighScore) Type() string
func (*GameHighScore) UnmarshalJSON ¶ added in v1.9.0
func (f *GameHighScore) UnmarshalJSON(data []byte) error
func (*GameHighScore) Verify ¶ added in v1.9.0
func (f *GameHighScore) Verify() error
type GeneralForumTopicHidden ¶
type GeneralForumTopicHidden struct{}
GeneralForumTopicHidden represents a service message about General forum topic hidden in the chat. Currently holds no information.
func (*GeneralForumTopicHidden) MarshalJSON ¶ added in v1.9.0
func (f *GeneralForumTopicHidden) MarshalJSON() ([]byte, error)
func (*GeneralForumTopicHidden) ReflectType ¶ added in v1.9.0
func (c *GeneralForumTopicHidden) ReflectType() string
func (*GeneralForumTopicHidden) String ¶ added in v1.9.0
func (f *GeneralForumTopicHidden) String() string
func (*GeneralForumTopicHidden) Type ¶ added in v1.9.0
func (c *GeneralForumTopicHidden) Type() string
func (*GeneralForumTopicHidden) UnmarshalJSON ¶ added in v1.9.0
func (f *GeneralForumTopicHidden) UnmarshalJSON(data []byte) error
func (*GeneralForumTopicHidden) Verify ¶ added in v1.9.0
func (f *GeneralForumTopicHidden) Verify() error
type GeneralForumTopicUnhidden ¶
type GeneralForumTopicUnhidden struct{}
GeneralForumTopicUnhidden represents a service message about General forum topic unhidden in the chat. Currently holds no information.
func (*GeneralForumTopicUnhidden) MarshalJSON ¶ added in v1.9.0
func (f *GeneralForumTopicUnhidden) MarshalJSON() ([]byte, error)
func (*GeneralForumTopicUnhidden) ReflectType ¶ added in v1.9.0
func (c *GeneralForumTopicUnhidden) ReflectType() string
func (*GeneralForumTopicUnhidden) String ¶ added in v1.9.0
func (f *GeneralForumTopicUnhidden) String() string
func (*GeneralForumTopicUnhidden) Type ¶ added in v1.9.0
func (c *GeneralForumTopicUnhidden) Type() string
func (*GeneralForumTopicUnhidden) UnmarshalJSON ¶ added in v1.9.0
func (f *GeneralForumTopicUnhidden) UnmarshalJSON(data []byte) error
func (*GeneralForumTopicUnhidden) Verify ¶ added in v1.9.0
func (f *GeneralForumTopicUnhidden) Verify() error
type Giveaway ¶ added in v1.9.0
type Giveaway struct { // Chats is the list of chats, which the user must join to participate in the giveaway. Chats []Chat `json:"chats"` // WinnersSelectionDate is the point in time (Unix timestamp) when winners of the giveaway will be selected. WinnersSelectionDate int `json:"winners_selection_date"` // WinnerCount is the number of users which are supposed to be selected as winners of the giveaway. WinnerCount int `json:"winner_count"` // OnlyNewMembers is true if only users who join the chats after the giveaway started should be eligible to win. OnlyNewMembers bool `json:"only_new_members,omitempty"` // HasPublicWinners is true if the list of giveaway winners will be visible to everyone. HasPublicWinners bool `json:"has_public_winners,omitempty"` // PrizeDescription is the description of additional giveaway prize. PrizeDescription string `json:"prize_description,omitempty"` // CountryCodes is a list of two-letter ISO 3166-1 alpha-2 country codes indicating the countries from which eligible users for the giveaway must come. // If empty, then all users can participate in the giveaway. // Users with a phone number that was bought on Fragment can always participate in giveaways. CountryCodes []string `json:"country_codes,omitempty"` // PremiumSubscriptionMonthCount is the number of months the Telegram Premium subscription won from the giveaway will be active for. PremiumSubscriptionMonthCount int `json:"premium_subscription_month_count,omitempty"` }
Giveaway represents a message about a scheduled giveaway.
func (*Giveaway) MarshalJSON ¶ added in v1.9.0
func (*Giveaway) ReflectType ¶ added in v1.9.0
func (*Giveaway) UnmarshalJSON ¶ added in v1.9.0
type GiveawayCompleted ¶ added in v1.9.0
type GiveawayCompleted struct { // WinnerCount is the number of winners in the giveaway. WinnerCount int `json:"winner_count"` // UnclaimedPrizeCount is the number of undistributed prizes. UnclaimedPrizeCount int `json:"unclaimed_prize_count,omitempty"` // GiveawayMessage is the message with the giveaway that was completed if it wasn't deleted. GiveawayMessage AccessibleMessage `json:"giveaway_message,omitempty"` }
GiveawayCompleted represents a service message about the completion of a giveaway without public winners.
func (*GiveawayCompleted) MarshalJSON ¶ added in v1.9.0
func (f *GiveawayCompleted) MarshalJSON() ([]byte, error)
func (*GiveawayCompleted) ReflectType ¶ added in v1.9.0
func (c *GiveawayCompleted) ReflectType() string
func (*GiveawayCompleted) String ¶ added in v1.9.0
func (f *GiveawayCompleted) String() string
func (*GiveawayCompleted) Type ¶ added in v1.9.0
func (c *GiveawayCompleted) Type() string
func (*GiveawayCompleted) UnmarshalJSON ¶ added in v1.9.0
func (f *GiveawayCompleted) UnmarshalJSON(data []byte) error
func (*GiveawayCompleted) Verify ¶ added in v1.9.0
func (f *GiveawayCompleted) Verify() error
type GiveawayCreated ¶ added in v1.9.0
type GiveawayCreated struct{}
GiveawayCreated represents a service message about the creation of a scheduled giveaway. Currently holds no information.
func (*GiveawayCreated) MarshalJSON ¶ added in v1.9.0
func (f *GiveawayCreated) MarshalJSON() ([]byte, error)
func (*GiveawayCreated) ReflectType ¶ added in v1.9.0
func (c *GiveawayCreated) ReflectType() string
func (*GiveawayCreated) String ¶ added in v1.9.0
func (f *GiveawayCreated) String() string
func (*GiveawayCreated) Type ¶ added in v1.9.0
func (c *GiveawayCreated) Type() string
func (*GiveawayCreated) UnmarshalJSON ¶ added in v1.9.0
func (f *GiveawayCreated) UnmarshalJSON(data []byte) error
func (*GiveawayCreated) Verify ¶ added in v1.9.0
func (f *GiveawayCreated) Verify() error
type GiveawayWinners ¶ added in v1.9.0
type GiveawayWinners struct { // Chat is the chat that created the giveaway. Chat Chat `json:"chat"` // GiveawayMessageID is the identifier of the message with the giveaway in the chat. GiveawayMessageID int `json:"giveaway_message_id"` // WinnersSelectionDate is the point in time (Unix timestamp) when winners of the giveaway were selected. WinnersSelectionDate int `json:"winners_selection_date"` // WinnerCount is the total number of winners in the giveaway. WinnerCount int `json:"winner_count"` // Winners is the list of up to 100 winners of the giveaway. Winners []User `json:"winners"` // AdditionalChatCount is the number of other chats the user had to join in order to be eligible for the giveaway. AdditionalChatCount int `json:"additional_chat_count,omitempty"` // PremiumSubscriptionMonthCount is the number of months the Telegram Premium subscription won from the giveaway will be active for. PremiumSubscriptionMonthCount int `json:"premium_subscription_month_count,omitempty"` // UnclaimedPrizeCount is the number of undistributed prizes. UnclaimedPrizeCount int `json:"unclaimed_prize_count,omitempty"` // OnlyNewMembers is true if only users who had joined the chats after the giveaway started were eligible to win. OnlyNewMembers bool `json:"only_new_members,omitempty"` // WasRefunded is true if the giveaway was canceled because the payment for it was refunded. WasRefunded bool `json:"was_refunded,omitempty"` // PrizeDescription is the description of additional giveaway prize. PrizeDescription string `json:"prize_description,omitempty"` }
GiveawayWinners represents a message about the completion of a giveaway with public winners.
func (*GiveawayWinners) MarshalJSON ¶ added in v1.9.0
func (f *GiveawayWinners) MarshalJSON() ([]byte, error)
func (*GiveawayWinners) ReflectType ¶ added in v1.9.0
func (c *GiveawayWinners) ReflectType() string
func (*GiveawayWinners) String ¶ added in v1.9.0
func (f *GiveawayWinners) String() string
func (*GiveawayWinners) Type ¶ added in v1.9.0
func (c *GiveawayWinners) Type() string
func (*GiveawayWinners) UnmarshalJSON ¶ added in v1.9.0
func (f *GiveawayWinners) UnmarshalJSON(data []byte) error
func (*GiveawayWinners) Verify ¶ added in v1.9.0
func (f *GiveawayWinners) Verify() error
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
Group is a separated group of handlers, united by the general middleware.
func (*Group) Handle ¶
func (g *Group) Handle(endpoint any, h HandlerFunc, m ...MiddlewareFunc)
Handle adds endpoint handler to the bot, combining group's middleware with the optional given middleware.
func (*Group) Use ¶
func (g *Group) Use(middleware ...MiddlewareFunc)
Use adds middleware to the chain.
type GroupError ¶
type GroupError struct { MigratedTo int64 // contains filtered or unexported fields }
type HandlerFunc ¶
HandlerFunc represents a handler function, which is used to handle actual endpoints.
type InaccessibleMessage ¶ added in v1.9.0
type InaccessibleMessage struct { ID int64 `json:"message_id" verify:"nonzero"` Date int64 `json:"date" verify:"literalZero"` Chat *Chat `json:"chat" verify:"required"` }
InaccessibleMessage This object represents a message that is inaccessible to the bot.
Fields: — ID (int64): Unique message identifier inside this chat. — Date (int64): Date the message was sent in Unix time. (<b>Always 0 for inaccessible messages.</b>) — Chat (*Chat): Chat the message belongs to.
func (*InaccessibleMessage) MarshalJSON ¶ added in v1.9.0
func (u *InaccessibleMessage) MarshalJSON() ([]byte, error)
func (*InaccessibleMessage) MessageSig ¶ added in v1.9.0
func (u *InaccessibleMessage) MessageSig() (Recipient, int64)
func (*InaccessibleMessage) MessageType ¶ added in v1.9.0
func (u *InaccessibleMessage) MessageType() string
func (*InaccessibleMessage) ReflectType ¶ added in v1.9.0
func (u *InaccessibleMessage) ReflectType() string
func (*InaccessibleMessage) String ¶ added in v1.9.0
func (u *InaccessibleMessage) String() string
func (*InaccessibleMessage) Type ¶ added in v1.9.0
func (u *InaccessibleMessage) Type() string
func (*InaccessibleMessage) UnmarshalJSON ¶ added in v1.9.0
func (u *InaccessibleMessage) UnmarshalJSON(b []byte) error
func (*InaccessibleMessage) Verify ¶ added in v1.9.0
func (u *InaccessibleMessage) Verify() error
type InlineKeyboardButton ¶ added in v1.9.0
type InlineKeyboardButton struct { // Text is the label text on the button. Text string `json:"text"` // URL is the 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 is the 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"` // WebApp is the optional description of the Web App that will be launched when the user presses the button. // The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. // Available only in private chats between a user and the bot. WebApp *WebAppInfo `json:"web_app,omitempty"` // LoginURL is the optional HTTPS URL used to automatically authorize the user. // Can be used as a replacement for the Telegram Login Widget. LoginURL *LoginURL `json:"login_url,omitempty"` // SwitchInlineQuery is the optional inline query to prompt the user to select one of their chats and insert the bot's username and the specified inline query in the input field. // May be empty, in which case just the bot's username will be inserted. SwitchInlineQuery *string `json:"switch_inline_query,omitempty"` // SwitchInlineQueryCurrentChat is the optional inline query to insert the bot's username and the specified inline query in the current chat's input field. // May be empty, in which case only the bot's username will be inserted. SwitchInlineQueryCurrentChat *string `json:"switch_inline_query_current_chat,omitempty"` // SwitchInlineQueryChosenChat is the optional inline query to prompt the user to select one of their chats of the specified type, // open that chat and insert the bot's username and the specified inline query in the input field. SwitchInlineQueryChosenChat *SwitchInlineQueryChosenChat `json:"switch_inline_query_chosen_chat,omitempty"` // CallbackGame is the optional description of the game that will be launched when the user presses the button. // NOTE: This type of button must always be the first button in the first row. CallbackGame *CallbackGame `json:"callback_game,omitempty"` // Pay is the optional boolean to specify True, to send a Pay button. // NOTE: This type of button must always be the first button in the first row and can only be used in invoice messages. Pay *bool `json:"pay,omitempty"` }
InlineKeyboardButton represents one button of an inline keyboard. You must use exactly one of the optional fields.
func (*InlineKeyboardButton) Button ¶ added in v1.9.0
func (*InlineKeyboardButton) Button()
Button is here so InlineKeyboardButton implements Button
func (*InlineKeyboardButton) Clone ¶ added in v1.9.23
func (i *InlineKeyboardButton) Clone() Button
func (*InlineKeyboardButton) GetText ¶ added in v1.9.0
func (i *InlineKeyboardButton) GetText() string
func (*InlineKeyboardButton) MarshalJSON ¶ added in v1.9.0
func (i *InlineKeyboardButton) MarshalJSON() ([]byte, error)
func (*InlineKeyboardButton) ReflectType ¶ added in v1.9.0
func (i *InlineKeyboardButton) ReflectType() string
func (*InlineKeyboardButton) SetText ¶ added in v1.9.0
func (i *InlineKeyboardButton) SetText(t string)
func (*InlineKeyboardButton) String ¶ added in v1.9.0
func (i *InlineKeyboardButton) String() string
func (*InlineKeyboardButton) Type ¶ added in v1.9.0
func (i *InlineKeyboardButton) Type() string
func (*InlineKeyboardButton) UnmarshalJSON ¶ added in v1.9.0
func (i *InlineKeyboardButton) UnmarshalJSON(data []byte) error
func (*InlineKeyboardButton) Verify ¶ added in v1.9.0
func (i *InlineKeyboardButton) Verify() error
type InlineKeyboardMarkup ¶ added in v1.9.0
type InlineKeyboardMarkup struct { // InlineKeyboard is an array of button rows, each represented by an array of InlineKeyboardButton objects. InlineKeyboard []Row `json:"inline_keyboard"` }
InlineKeyboardMarkup represents an inline keyboard that appears right next to the message it belongs to.
func (*InlineKeyboardMarkup) MarshalJSON ¶ added in v1.9.0
func (m *InlineKeyboardMarkup) MarshalJSON() ([]byte, error)
func (*InlineKeyboardMarkup) ReflectType ¶ added in v1.9.0
func (m *InlineKeyboardMarkup) ReflectType() string
func (*InlineKeyboardMarkup) String ¶ added in v1.9.0
func (m *InlineKeyboardMarkup) String() string
func (*InlineKeyboardMarkup) Type ¶ added in v1.9.0
func (m *InlineKeyboardMarkup) Type() string
func (*InlineKeyboardMarkup) UnmarshalJSON ¶ added in v1.9.0
func (m *InlineKeyboardMarkup) UnmarshalJSON(data []byte) error
func (*InlineKeyboardMarkup) Verify ¶ added in v1.9.0
func (m *InlineKeyboardMarkup) Verify() error
type InlineQuery ¶ added in v1.9.0
type InlineQuery struct { // ID is the unique identifier for this query. ID string `json:"id"` // From is the sender of the inline query. From User `json:"from"` // Query is the text of the query (up to 256 characters). Query string `json:"query"` // Offset is the offset of the results to be returned, which can be controlled by the bot. Offset string `json:"offset"` // ChatType is the type of the chat from which the inline query was sent. // It can be either “sender” for a private chat with the inline query sender, “private”, “group”, “supergroup”, or “channel”. // The chat type should be always known for requests sent from official clients and most third-party clients unless the request was sent from a secret chat. ChatType ChatType `json:"chat_type,omitempty"` // Location is the sender's location (optional, only for bots that request user location). Location *Location `json:"location,omitempty"` }
InlineQuery represents an incoming inline query. When the user sends an empty query, your bot could return some default or trending results.
func (*InlineQuery) MarshalJSON ¶ added in v1.9.0
func (c *InlineQuery) MarshalJSON() ([]byte, error)
func (*InlineQuery) ReflectType ¶ added in v1.9.0
func (c *InlineQuery) ReflectType() string
func (*InlineQuery) String ¶ added in v1.9.0
func (c *InlineQuery) String() string
func (*InlineQuery) Type ¶ added in v1.9.0
func (c *InlineQuery) Type() string
func (*InlineQuery) UnmarshalJSON ¶ added in v1.9.0
func (c *InlineQuery) UnmarshalJSON(b []byte) error
func (*InlineQuery) Verify ¶ added in v1.9.0
func (c *InlineQuery) Verify() error
type InlineQueryButton ¶ added in v1.9.0
type InlineQueryButton struct { Text string `json:"text"` WebApp *WebAppInfo `json:"url,omitempty"` StartParam *string `json:"start_parameter,omitempty"` }
type InlineQueryResultType ¶ added in v1.9.0
type InlineQueryResultType string
const ( InlineQueryResultCachedAudio InlineQueryResultType = "audio" InlineQueryResultCachedDocument InlineQueryResultType = "document" InlineQueryResultCachedGif InlineQueryResultType = "gif" InlineQueryResultCachedMpeg4Gif InlineQueryResultType = "mpeg4_gif" InlineQueryResultCachedPhoto InlineQueryResultType = "photo" InlineQueryResultCachedSticker InlineQueryResultType = "sticker" InlineQueryResultCachedVideo InlineQueryResultType = "video" InlineQueryResultCachedVoice InlineQueryResultType = "voice" InlineQueryResultArticle InlineQueryResultType = "article" InlineQueryResultAudio InlineQueryResultType = "audio" InlineQueryResultContact InlineQueryResultType = "contact" InlineQueryResultGame InlineQueryResultType = "game" InlineQueryResultDocument InlineQueryResultType = "document" InlineQueryResultGif InlineQueryResultType = "gif" InlineQueryResultLocation InlineQueryResultType = "location" InlineQueryResultMpeg4Gif InlineQueryResultType = "mpeg4_gif" InlineQueryResultPhoto InlineQueryResultType = "photo" InlineQueryResultVenue InlineQueryResultType = "venue" InlineQueryResultVideo InlineQueryResultType = "video" InlineQueryResultVoice InlineQueryResultType = "voice" )
type InputContactMessageContent ¶
type InputContactMessageContent struct { PhoneNumber string `json:"phone_number"` FirstName string `json:"first_name"` LastName string `json:"last_name,omitempty"` VCard string `json:"vcard,omitempty"` }
func (*InputContactMessageContent) InputMessageContent ¶ added in v1.9.0
func (i *InputContactMessageContent) InputMessageContent()
func (*InputContactMessageContent) MarshalJSON ¶ added in v1.9.0
func (c *InputContactMessageContent) MarshalJSON() ([]byte, error)
func (*InputContactMessageContent) ReflectType ¶ added in v1.9.0
func (c *InputContactMessageContent) ReflectType() string
func (*InputContactMessageContent) String ¶ added in v1.9.0
func (f *InputContactMessageContent) String() string
func (*InputContactMessageContent) Type ¶ added in v1.9.0
func (c *InputContactMessageContent) Type() string
func (*InputContactMessageContent) UnmarshalJSON ¶ added in v1.9.0
func (c *InputContactMessageContent) UnmarshalJSON(data []byte) error
func (*InputContactMessageContent) Verify ¶ added in v1.9.0
func (c *InputContactMessageContent) Verify() error
type InputInvoiceMessageContent ¶ added in v1.9.0
type InputInvoiceMessageContent struct { Title string `json:"title"` Description string `json:"description"` Payload string `json:"payload"` ProviderToken string `json:"provider_token"` Currency string `json:"currency"` Prices []LabeledPrice `json:"prices"` MaxTipAmount int `json:"max_tip_amount,omitempty"` SuggestedTipAmounts []int `json:"suggested_tip_amounts,omitempty"` ProviderData string `json:"provider_data,omitempty"` PhotoURL string `json:"photo_url,omitempty"` PhotoSize int `json:"photo_size,omitempty"` PhotoWidth int `json:"photo_width,omitempty"` PhotoHeight int `json:"photo_height,omitempty"` NeedName bool `json:"need_name,omitempty"` NeedPhoneNumber bool `json:"need_phone_number,omitempty"` NeedEmail bool `json:"need_email,omitempty"` NeedShippingAddress bool `json:"need_shipping_address,omitempty"` SendPhoneNumberToProvider bool `json:"send_phone_number_to_provider,omitempty"` SendEmailToProvider bool `json:"send_email_to_provider,omitempty"` IsFlexible bool `json:"is_flexible,omitempty"` }
func (*InputInvoiceMessageContent) InputMessageContent ¶ added in v1.9.0
func (i *InputInvoiceMessageContent) InputMessageContent()
func (*InputInvoiceMessageContent) MarshalJSON ¶ added in v1.9.0
func (c *InputInvoiceMessageContent) MarshalJSON() ([]byte, error)
func (*InputInvoiceMessageContent) ReflectType ¶ added in v1.9.0
func (c *InputInvoiceMessageContent) ReflectType() string
func (*InputInvoiceMessageContent) String ¶ added in v1.9.0
func (f *InputInvoiceMessageContent) String() string
func (*InputInvoiceMessageContent) Type ¶ added in v1.9.0
func (c *InputInvoiceMessageContent) Type() string
func (*InputInvoiceMessageContent) UnmarshalJSON ¶ added in v1.9.0
func (c *InputInvoiceMessageContent) UnmarshalJSON(data []byte) error
func (*InputInvoiceMessageContent) Verify ¶ added in v1.9.0
func (c *InputInvoiceMessageContent) Verify() error
type InputLocationMessageContent ¶
type InputLocationMessageContent struct { Latitude float64 `json:"latitude"` Longitude float64 `json:"longitude"` HorizontalAccuracy float64 `json:"horizontal_accuracy,omitempty"` LivePeriod int `json:"live_period,omitempty"` Heading int `json:"heading,omitempty"` ProximityAlertRadius int `json:"proximity_alert_radius,omitempty"` }
func (*InputLocationMessageContent) InputMessageContent ¶ added in v1.9.0
func (i *InputLocationMessageContent) InputMessageContent()
func (*InputLocationMessageContent) MarshalJSON ¶ added in v1.9.0
func (c *InputLocationMessageContent) MarshalJSON() ([]byte, error)
func (*InputLocationMessageContent) ReflectType ¶ added in v1.9.0
func (c *InputLocationMessageContent) ReflectType() string
func (*InputLocationMessageContent) String ¶ added in v1.9.0
func (f *InputLocationMessageContent) String() string
func (*InputLocationMessageContent) Type ¶ added in v1.9.0
func (c *InputLocationMessageContent) Type() string
func (*InputLocationMessageContent) UnmarshalJSON ¶ added in v1.9.0
func (c *InputLocationMessageContent) UnmarshalJSON(data []byte) error
func (*InputLocationMessageContent) Verify ¶ added in v1.9.0
func (c *InputLocationMessageContent) Verify() error
type InputMedia ¶
type InputMedia struct { Repr string `json:"-"` MediaType InputMediaType `json:"type"` Media *File `json:"media"` Caption *string `json:"caption,omitempty"` ParseMode ParseMode `json:"parse_mode,omitempty"` Entities []Entity `json:"caption_entities,omitempty"` HasSpoiler *bool `json:"has_spoiler,omitempty"` Thumb *File `json:"thumbnail,omitempty" file:"1"` Width *int `json:"width,omitempty"` Height *int `json:"height,omitempty"` Duration *int `json:"duration,omitempty"` Streamable *bool `json:"supports_streaming,omitempty"` Preformer *string `json:"performer,omitempty"` Title *string `json:"title,omitempty"` DisableContentTypeDetection *bool `json:"disable_content_type_detection,omitempty"` }
func (*InputMedia) FileRepresent ¶ added in v1.9.0
func (m *InputMedia) FileRepresent() string
func (*InputMedia) MarshalJSON ¶ added in v1.9.0
func (m *InputMedia) MarshalJSON() ([]byte, error)
func (*InputMedia) ReflectType ¶ added in v1.9.0
func (m *InputMedia) ReflectType() string
func (*InputMedia) String ¶ added in v1.9.0
func (m *InputMedia) String() string
func (*InputMedia) Type ¶
func (m *InputMedia) Type() string
func (*InputMedia) UnmarshalJSON ¶ added in v1.9.0
func (m *InputMedia) UnmarshalJSON(data []byte) error
func (*InputMedia) Verify ¶ added in v1.9.0
func (m *InputMedia) Verify() error
Verify for InputMedia should be a Custom function
type InputMediaType ¶ added in v1.9.0
type InputMediaType string
const ( InputMediaAnimation InputMediaType = "animation" InputMediaDocument InputMediaType = "document" InputMediaAudio InputMediaType = "audio" InputMediaPhoto InputMediaType = "photo" InputMediaVideo InputMediaType = "video" )
type InputMessageContent ¶
type InputMessageContent interface { JSONer InputMessageContent() }
type InputSticker ¶
type InputSticker struct { Sticker File `json:"sticker" file:"1"` EmojiList []StickerEmoji `json:"emoji_list,omitempty"` MaskPosition *MaskPosition `json:"mask_position,omitempty"` Keywords []string `json:"keywords,omitempty"` Format StickerFormat `json:"format,omitempty"` Repr string `json:"-"` }
func (*InputSticker) FileRepresent ¶ added in v1.9.0
func (s *InputSticker) FileRepresent() string
func (*InputSticker) MarshalJSON ¶ added in v1.9.0
func (s *InputSticker) MarshalJSON() ([]byte, error)
func (*InputSticker) ReflectType ¶ added in v1.9.0
func (s *InputSticker) ReflectType() string
func (*InputSticker) String ¶ added in v1.9.0
func (s *InputSticker) String() string
func (*InputSticker) Type ¶ added in v1.9.0
func (s *InputSticker) Type() string
func (*InputSticker) UnmarshalJSON ¶ added in v1.9.0
func (s *InputSticker) UnmarshalJSON(data []byte) error
func (*InputSticker) Verify ¶ added in v1.9.0
func (s *InputSticker) Verify() error
type InputTextMessageContent ¶
type InputTextMessageContent struct { MessageText string `json:"message_text"` ParseMode string `json:"parse_mode,omitempty"` Entities []Entity `json:"entities,omitempty"` LinkPreviewOptions LinkPreviewOptions `json:"link_preview_options,omitempty"` }
func (*InputTextMessageContent) InputMessageContent ¶ added in v1.9.0
func (i *InputTextMessageContent) InputMessageContent()
func (*InputTextMessageContent) MarshalJSON ¶ added in v1.9.0
func (c *InputTextMessageContent) MarshalJSON() ([]byte, error)
func (*InputTextMessageContent) ReflectType ¶ added in v1.9.0
func (c *InputTextMessageContent) ReflectType() string
func (*InputTextMessageContent) String ¶ added in v1.9.0
func (f *InputTextMessageContent) String() string
func (*InputTextMessageContent) Type ¶ added in v1.9.0
func (c *InputTextMessageContent) Type() string
func (*InputTextMessageContent) UnmarshalJSON ¶ added in v1.9.0
func (c *InputTextMessageContent) UnmarshalJSON(data []byte) error
func (*InputTextMessageContent) Verify ¶ added in v1.9.0
func (c *InputTextMessageContent) Verify() error
type InputVenueMessageContent ¶
type InputVenueMessageContent struct { Latitude float64 `json:"latitude"` Longitude float64 `json:"longitude"` Title string `json:"title"` Address string `json:"address"` FoursquareID string `json:"foursquare_id,omitempty"` FoursquareType string `json:"foursquare_type,omitempty"` GooglePlaceID string `json:"google_place_id,omitempty"` GooglePlaceType string `json:"google_place_type,omitempty"` }
func (*InputVenueMessageContent) InputMessageContent ¶ added in v1.9.0
func (i *InputVenueMessageContent) InputMessageContent()
func (*InputVenueMessageContent) MarshalJSON ¶ added in v1.9.0
func (c *InputVenueMessageContent) MarshalJSON() ([]byte, error)
func (*InputVenueMessageContent) ReflectType ¶ added in v1.9.0
func (c *InputVenueMessageContent) ReflectType() string
func (*InputVenueMessageContent) String ¶ added in v1.9.0
func (f *InputVenueMessageContent) String() string
func (*InputVenueMessageContent) Type ¶ added in v1.9.0
func (c *InputVenueMessageContent) Type() string
func (*InputVenueMessageContent) UnmarshalJSON ¶ added in v1.9.0
func (c *InputVenueMessageContent) UnmarshalJSON(data []byte) error
func (*InputVenueMessageContent) Verify ¶ added in v1.9.0
func (c *InputVenueMessageContent) Verify() error
type Invoice ¶
type Invoice struct { // Title is the product name. Title string `json:"title"` // Description is the product description. Description string `json:"description"` // StartParameter is a unique bot deep-linking parameter that can be used to generate this invoice. StartParameter string `json:"start_parameter"` // Currency is the three-letter ISO 4217 currency code. Currency string `json:"currency"` // TotalAmount is the 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). TotalAmount int `json:"total_amount"` }
Invoice contains basic information about an invoice.
func (*Invoice) MarshalJSON ¶ added in v1.9.0
func (*Invoice) ReflectType ¶ added in v1.9.0
func (*Invoice) UnmarshalJSON ¶ added in v1.9.0
type KeyboardButton ¶ added in v1.9.0
type KeyboardButton struct { // Text is the text of the button. If none of the optional fields are used, it will be sent as a message when the button is pressed. Text string `json:"text"` // RequestUsers, 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"` // RequestChat, 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"` // RequestContact, 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, 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, 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"` // WebApp, 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"` }
KeyboardButton represents one button of the reply keyboard. For simple text buttons, String can be used instead of this object to specify the button text. The optional fields web_app, request_users, request_chat, request_contact, request_location, and request_poll are mutually exclusive.
func (*KeyboardButton) Button ¶ added in v1.9.0
func (*KeyboardButton) Button()
Button is here so InlineKeyboardButton implements Button
func (*KeyboardButton) Clone ¶ added in v1.9.23
func (i *KeyboardButton) Clone() Button
func (*KeyboardButton) GetText ¶ added in v1.9.0
func (i *KeyboardButton) GetText() string
func (*KeyboardButton) MarshalJSON ¶ added in v1.9.0
func (i *KeyboardButton) MarshalJSON() ([]byte, error)
func (*KeyboardButton) ReflectType ¶ added in v1.9.0
func (i *KeyboardButton) ReflectType() string
func (*KeyboardButton) SetText ¶ added in v1.9.0
func (i *KeyboardButton) SetText(t string)
func (*KeyboardButton) String ¶ added in v1.9.0
func (i *KeyboardButton) String() string
func (*KeyboardButton) Type ¶ added in v1.9.0
func (i *KeyboardButton) Type() string
func (*KeyboardButton) UnmarshalJSON ¶ added in v1.9.0
func (i *KeyboardButton) UnmarshalJSON(data []byte) error
func (*KeyboardButton) Verify ¶ added in v1.9.0
func (i *KeyboardButton) Verify() error
type KeyboardButtonPollType ¶ added in v1.9.0
type KeyboardButtonPollType struct { // Type // 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. PollType PollType `json:"type,omitempty"` }
KeyboardButtonPollType represents the type of a poll, which is allowed to be created and sent when the corresponding button is pressed.
func (*KeyboardButtonPollType) MarshalJSON ¶ added in v1.9.0
func (i *KeyboardButtonPollType) MarshalJSON() ([]byte, error)
func (*KeyboardButtonPollType) ReflectType ¶ added in v1.9.0
func (i *KeyboardButtonPollType) ReflectType() string
func (*KeyboardButtonPollType) String ¶ added in v1.9.0
func (i *KeyboardButtonPollType) String() string
func (*KeyboardButtonPollType) Type ¶ added in v1.9.0
func (i *KeyboardButtonPollType) Type() string
func (*KeyboardButtonPollType) UnmarshalJSON ¶ added in v1.9.0
func (i *KeyboardButtonPollType) UnmarshalJSON(data []byte) error
func (*KeyboardButtonPollType) Verify ¶ added in v1.9.0
func (i *KeyboardButtonPollType) Verify() error
type KeyboardButtonRequestChat ¶
type KeyboardButtonRequestChat struct { // RequestID Signed 32-bit identifier of the request RequestID int32 `json:"request_id" yaml:"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" yaml:"chat_is_channel"` // ChatIsForum Optional. Pass true to request a forum supergroup, pass false to request a non-forum chat ChatIsForum bool `json:"chat_is_forum,omitempty" yaml:"chat_is_forum,omitempty"` // ChatHasUsernameOptional. Pass true to request a supergroup or a channel with a username, pass false to request a chat without a username ChatHasUsername bool `json:"chat_has_username,omitempty" yaml:"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" yaml:"chat_is_created,omitempty"` // UserRights Optional. Administrator rights required for the user in the chat UserRights Rights `json:"user_administrator_rights,omitempty" yaml:"user_rights,omitempty"` // BotRights Optional. Administrator rights required for the bot in the chat BotRights Rights `json:"bot_administrator_rights,omitempty" yaml:"bot_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" yaml:"bot_is_member,omitempty"` RequestTitle *bool `json:"request_name,omitempty" yaml:"request_name,omitempty"` RequestUsername *bool `json:"request_username,omitempty" yaml:"request_username,omitempty"` RequestPhoto *bool `json:"request_photo,omitempty" yaml:"request_photo,omitempty"` }
KeyboardButtonRequestChat defines the criteria used to request a suitable chat.
func (*KeyboardButtonRequestChat) MarshalJSON ¶ added in v1.9.0
func (i *KeyboardButtonRequestChat) MarshalJSON() ([]byte, error)
func (*KeyboardButtonRequestChat) ReflectType ¶ added in v1.9.0
func (i *KeyboardButtonRequestChat) ReflectType() string
func (*KeyboardButtonRequestChat) String ¶ added in v1.9.0
func (i *KeyboardButtonRequestChat) String() string
func (*KeyboardButtonRequestChat) Type ¶ added in v1.9.0
func (i *KeyboardButtonRequestChat) Type() string
func (*KeyboardButtonRequestChat) UnmarshalJSON ¶ added in v1.9.0
func (i *KeyboardButtonRequestChat) UnmarshalJSON(data []byte) error
func (*KeyboardButtonRequestChat) Verify ¶ added in v1.9.0
func (i *KeyboardButtonRequestChat) Verify() error
type KeyboardButtonRequestUsers ¶ added in v1.9.0
type KeyboardButtonRequestUsers struct { // RequestID Signed 32-bit identifier of the request RequestID int32 `json:"request_id" yaml:"request_id"` // UserIsBot. Request bots if true, regular users if false UserIsBot *bool `json:"user_is_bot,omitempty" yaml:"user_is_bot,omitempty"` // UserIsPremium. Request premium users if true, non-premium users if false UserIsPremium *bool `json:"user_is_premium,omitempty" yaml:"user_is_premium,omitempty"` // MaxQuantity. Maximum number of users to be selected; 1-10. Defaults to 1. MaxQuantity *int `json:"max_quantity,omitempty" yaml:"max_quantity,omitempty"` RequestName *bool `json:"request_name,omitempty" yaml:"request_name,omitempty"` RequestUsername *bool `json:"request_username,omitempty" yaml:"request_username,omitempty"` RequestPhoto *bool `json:"request_photo,omitempty" yaml:"request_photo,omitempty"` }
KeyboardButtonRequestUsers defines the criteria used to request suitable users.
func (*KeyboardButtonRequestUsers) MarshalJSON ¶ added in v1.9.0
func (i *KeyboardButtonRequestUsers) MarshalJSON() ([]byte, error)
func (*KeyboardButtonRequestUsers) ReflectType ¶ added in v1.9.0
func (i *KeyboardButtonRequestUsers) ReflectType() string
func (*KeyboardButtonRequestUsers) String ¶ added in v1.9.0
func (i *KeyboardButtonRequestUsers) String() string
func (*KeyboardButtonRequestUsers) Type ¶ added in v1.9.0
func (i *KeyboardButtonRequestUsers) Type() string
func (*KeyboardButtonRequestUsers) UnmarshalJSON ¶ added in v1.9.0
func (i *KeyboardButtonRequestUsers) UnmarshalJSON(data []byte) error
func (*KeyboardButtonRequestUsers) Verify ¶ added in v1.9.0
func (i *KeyboardButtonRequestUsers) Verify() error
type LabeledPrice ¶ added in v1.9.0
func (*LabeledPrice) MarshalJSON ¶ added in v1.9.0
func (c *LabeledPrice) MarshalJSON() ([]byte, error)
func (*LabeledPrice) ReflectType ¶ added in v1.9.0
func (c *LabeledPrice) ReflectType() string
func (*LabeledPrice) String ¶ added in v1.9.0
func (f *LabeledPrice) String() string
func (*LabeledPrice) Type ¶ added in v1.9.0
func (c *LabeledPrice) Type() string
func (*LabeledPrice) UnmarshalJSON ¶ added in v1.9.0
func (c *LabeledPrice) UnmarshalJSON(data []byte) error
func (*LabeledPrice) Verify ¶ added in v1.9.0
func (c *LabeledPrice) Verify() error
type LinkPreviewOptions ¶ added in v1.9.0
type LinkPreviewOptions struct { IsDisabled *bool `json:"is_disabled,omitempty"` URL *string `json:"url,omitempty"` PreferSmallMedia *bool `json:"prefer_small_media,omitempty"` PreferLargeMedia *bool `json:"prefer_large_media,omitempty"` ShowAboveText *bool `json:"show_above_text,omitempty"` }
func (*LinkPreviewOptions) MarshalJSON ¶ added in v1.9.0
func (f *LinkPreviewOptions) MarshalJSON() ([]byte, error)
func (*LinkPreviewOptions) ReflectType ¶ added in v1.9.0
func (c *LinkPreviewOptions) ReflectType() string
func (*LinkPreviewOptions) String ¶ added in v1.9.0
func (f *LinkPreviewOptions) String() string
func (*LinkPreviewOptions) Type ¶ added in v1.9.0
func (c *LinkPreviewOptions) Type() string
func (*LinkPreviewOptions) UnmarshalJSON ¶ added in v1.9.0
func (f *LinkPreviewOptions) UnmarshalJSON(data []byte) error
func (*LinkPreviewOptions) Verify ¶ added in v1.9.0
func (f *LinkPreviewOptions) Verify() error
type Location ¶
type Location struct { // Longitude is the longitude as defined by the sender. Longitude float64 `json:"longitude"` // Latitude is the latitude as defined by the sender. Latitude float64 `json:"latitude"` // HorizontalAccuracy is an optional field representing the radius of uncertainty for the location, measured in meters; 0-1500. HorizontalAccuracy float64 `json:"horizontal_accuracy,omitempty"` // LivePeriod is an optional field representing the time relative to the message sending date, during which the location can be updated, in seconds. // For active live locations only. LivePeriod int `json:"live_period,omitempty"` // Heading is an optional field representing the direction in which the user is moving, in degrees; 1-360. // For active live locations only. Heading int `json:"heading,omitempty"` // ProximityAlertRadius is an optional field representing the maximum distance for proximity alerts about approaching another chat member, in meters. // For sent live locations only. ProximityAlertRadius int `json:"proximity_alert_radius,omitempty"` }
Location represents a point on the map.
func (*Location) MarshalJSON ¶ added in v1.9.0
func (*Location) ReflectType ¶ added in v1.9.0
func (*Location) UnmarshalJSON ¶ added in v1.9.0
type LoginURL ¶ added in v1.9.0
type LoginURL struct { // URL is an HTTPS 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. URL string `json:"url" yaml:"url"` // ForwardText is the new text of the button in forwarded messages. ForwardText string `json:"forward_text,omitempty" yaml:"forward_text"` // BotUsername is the 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. BotUsername string `json:"bot_username,omitempty" yaml:"bot_username"` // RequestWriteAccess, if true, passes True to request the permission for your bot to send messages to the user. RequestWriteAccess bool `json:"request_write_access,omitempty" yaml:"request_write_access"` }
LoginURL represents a parameter of the inline keyboard button used to automatically authorize a user. Serves as a great replacement for the Telegram Login Widget when the user is coming from Telegram. All the user needs to do is tap/click a button and confirm that they want to log in.
func (*LoginURL) MarshalJSON ¶ added in v1.9.0
func (*LoginURL) ReflectType ¶ added in v1.9.0
func (*LoginURL) UnmarshalJSON ¶ added in v1.9.0
type LongPoller ¶
type LongPoller struct { Limit int Timeout time.Duration LastUpdateID int AllowedUpdates []UpdateType `yaml:"allowed_updates"` }
LongPoller is a classic LongPoller with timeout.
func (*LongPoller) Poll ¶
func (p *LongPoller) Poll(b Bot, dest chan Update, stop chan struct{})
Poll does long polling.
type MaskPosition ¶
type MaskPosition struct { Point string `json:"point"` XShift float64 `json:"x_shift"` YShift float64 `json:"y_shift"` Scale float64 `json:"scale"` }
func (*MaskPosition) MarshalJSON ¶ added in v1.9.0
func (f *MaskPosition) MarshalJSON() ([]byte, error)
func (*MaskPosition) ReflectType ¶ added in v1.9.0
func (c *MaskPosition) ReflectType() string
func (*MaskPosition) String ¶ added in v1.9.0
func (f *MaskPosition) String() string
func (*MaskPosition) Type ¶ added in v1.9.0
func (c *MaskPosition) Type() string
func (*MaskPosition) UnmarshalJSON ¶ added in v1.9.0
func (f *MaskPosition) UnmarshalJSON(data []byte) error
func (*MaskPosition) Verify ¶ added in v1.9.0
func (f *MaskPosition) Verify() error
type MaxTipAmount ¶ added in v1.9.0
type MaxTipAmount int
type MaybeInaccessibleMessage ¶ added in v1.9.0
type MaybeInaccessibleMessage struct { *AccessibleMessage *InaccessibleMessage }
MaybeInaccessibleMessage This object represents a message. It can be either a regular message or a message that is inaccessible to the bot.
Fields: — AccessibleMessage (*AccessibleMessage): Optional. The message itself, if it is accessible to the bot. — InaccessibleMessage (*InaccessibleMessage): Optional. Information about the message that is inaccessible to the bot.
func (*MaybeInaccessibleMessage) IsAccessible ¶ added in v1.9.0
func (u *MaybeInaccessibleMessage) IsAccessible() bool
func (*MaybeInaccessibleMessage) MarshalJSON ¶ added in v1.9.0
func (u *MaybeInaccessibleMessage) MarshalJSON() ([]byte, error)
func (*MaybeInaccessibleMessage) MessageType ¶ added in v1.9.0
func (u *MaybeInaccessibleMessage) MessageType() string
func (*MaybeInaccessibleMessage) ReflectType ¶ added in v1.9.0
func (u *MaybeInaccessibleMessage) ReflectType() string
func (*MaybeInaccessibleMessage) String ¶ added in v1.9.0
func (u *MaybeInaccessibleMessage) String() string
func (*MaybeInaccessibleMessage) Type ¶ added in v1.9.0
func (u *MaybeInaccessibleMessage) Type() string
func (*MaybeInaccessibleMessage) UnmarshalJSON ¶ added in v1.9.0
func (u *MaybeInaccessibleMessage) UnmarshalJSON(b []byte) error
UnmarshalJSON in MaybeInaccessibleMessage is a custom unmarshaler that checks if the message is accessible or not and unmarshals it accordingly. It first checks if the message is accessible by checking the date field. note from the author: I'm not sure if this is the best way to do it, but it works. if you find a better way of doing it that passes the UnitTests, i'd appreciate the PR <3.
func (*MaybeInaccessibleMessage) Verify ¶ added in v1.9.0
func (u *MaybeInaccessibleMessage) Verify() error
Verify in MaybeInaccessibleMessage needs a custom implementation because it can be either AccessibleMessage or InaccessibleMessage.
type MenuButton ¶
type MenuButton struct { Menu MenuButtonType `json:"type"` Text *string `json:"text,omitempty"` WebApp *WebAppInfo `json:"web_app,omitempty"` }
func (*MenuButton) MarshalJSON ¶ added in v1.9.0
func (f *MenuButton) MarshalJSON() ([]byte, error)
func (*MenuButton) ReflectType ¶ added in v1.9.0
func (c *MenuButton) ReflectType() string
func (*MenuButton) String ¶ added in v1.9.0
func (f *MenuButton) String() string
func (*MenuButton) Type ¶
func (c *MenuButton) Type() string
func (*MenuButton) UnmarshalJSON ¶ added in v1.9.0
func (f *MenuButton) UnmarshalJSON(data []byte) error
func (*MenuButton) Verify ¶ added in v1.9.0
func (f *MenuButton) Verify() error
type MenuButtonType ¶
type MenuButtonType string
const ( MenuButtonTypeCommands MenuButtonType = "commands" MenuButtonTypeWebApp MenuButtonType = "web_app" MenuButtonTypeDefault MenuButtonType = "default" )
type Message ¶
Message This interface represents a message.
Types: — AccessibleMessage (*AccessibleMessage): The message itself, if it is accessible to the bot. — InaccessibleMessage (*InaccessibleMessage): Information about the message that is inaccessible to the bot. — MaybeInaccessibleMessage (*MaybeInaccessibleMessage): The message itself, if it is accessible to the bot, or information about the message that is inaccessible to the bot.
Methods: — MessageType() string: Returns the type of the message.
type MessageOrigin ¶ added in v1.9.0
type MessageOrigin struct { ID int `json:"message_id"` OriginType MessageOriginType `json:"type"` Date int `json:"date"` SenderUser *User `json:"sender_user,omitempty"` SenderUserName *string `json:"sender_user_name,omitempty"` SenderChat *Chat `json:"sender_chat,omitempty"` AuthorSignature *string `json:"author_signature,omitempty"` }
func (*MessageOrigin) MarshalJSON ¶ added in v1.9.0
func (m *MessageOrigin) MarshalJSON() ([]byte, error)
func (*MessageOrigin) ReflectType ¶ added in v1.9.0
func (m *MessageOrigin) ReflectType() string
func (*MessageOrigin) String ¶ added in v1.9.0
func (m *MessageOrigin) String() string
func (*MessageOrigin) Type ¶ added in v1.9.0
func (m *MessageOrigin) Type() string
func (*MessageOrigin) UnmarshalJSON ¶ added in v1.9.0
func (m *MessageOrigin) UnmarshalJSON(data []byte) error
func (*MessageOrigin) Verify ¶ added in v1.9.0
func (m *MessageOrigin) Verify() error
type MessageOriginType ¶ added in v1.9.0
type MessageOriginType string
const ( MessageOriginUser MessageOriginType = "user" MessageOriginHiddenUser MessageOriginType = "hidden_user" MessageOriginChat MessageOriginType = "chat" MessageOriginChannel MessageOriginType = "channel" )
type MessageReaction ¶ added in v1.9.0
type MessageReaction struct { // ID is the unique identifier of the message inside the chat. ID int `json:"message_id" verify:"required"` // Chat is the chat containing the message the user reacted to. Chat Chat `json:"chat" verify:"required"` // User is the user that changed the reaction. It is optional if the user isn't anonymous. User *User `json:"user,omitempty"` // ActorChat is the chat on behalf of which the reaction was changed, if the user is anonymous. ActorChat *Chat `json:"actor_chat,omitempty"` // Date is the date of the change in Unix time. Date int64 `json:"date" verify:"required"` // OldReaction is the previous list of reaction types that were set by the user. OldReaction []ReactionType `json:"old_reaction" verify:"required"` // NewReaction is the new list of reaction types that have been set by the user. NewReaction []ReactionType `json:"new_reaction" verify:"required"` }
MessageReaction represents a change of a reaction on a message performed by a user.
func (*MessageReaction) MarshalJSON ¶ added in v1.9.0
func (r *MessageReaction) MarshalJSON() ([]byte, error)
func (*MessageReaction) ReflectType ¶ added in v1.9.0
func (r *MessageReaction) ReflectType() string
func (*MessageReaction) String ¶ added in v1.9.0
func (r *MessageReaction) String() string
func (*MessageReaction) Type ¶ added in v1.9.0
func (r *MessageReaction) Type() string
func (*MessageReaction) UnmarshalJSON ¶ added in v1.9.0
func (r *MessageReaction) UnmarshalJSON(b []byte) error
func (*MessageReaction) Verify ¶ added in v1.9.0
func (r *MessageReaction) Verify() error
type MessageReactionCountUpdated ¶ added in v1.9.0
type MessageReactionCountUpdated struct { // Chat is the chat containing the message. Chat Chat `json:"chat"` // MessageID is the unique message identifier inside the chat. ID int `json:"message_id"` // Date is the date of the change in Unix time. Date int64 `json:"date"` // Reactions is the list of reactions that are present on the message. Reactions []ReactionCount `json:"reactions"` }
func (*MessageReactionCountUpdated) MarshalJSON ¶ added in v1.9.0
func (r *MessageReactionCountUpdated) MarshalJSON() ([]byte, error)
func (*MessageReactionCountUpdated) ReflectType ¶ added in v1.9.0
func (r *MessageReactionCountUpdated) ReflectType() string
func (*MessageReactionCountUpdated) String ¶ added in v1.9.0
func (r *MessageReactionCountUpdated) String() string
func (*MessageReactionCountUpdated) Type ¶ added in v1.9.0
func (r *MessageReactionCountUpdated) Type() string
func (*MessageReactionCountUpdated) UnmarshalJSON ¶ added in v1.9.0
func (r *MessageReactionCountUpdated) UnmarshalJSON(b []byte) error
func (*MessageReactionCountUpdated) Verify ¶ added in v1.9.0
func (r *MessageReactionCountUpdated) Verify() error
type MessageThreadID ¶ added in v1.9.0
type MessageThreadID int
func (*MessageThreadID) String ¶ added in v1.9.0
func (d *MessageThreadID) String() string
type MiddlewareFunc ¶
type MiddlewareFunc func(HandlerFunc) HandlerFunc
MiddlewareFunc represents a middleware processing function, which get called before the endpoint group or specific handler.
type MiddlewarePoller ¶
MiddlewarePoller is a special kind of poller that acts like a filter for updates. It could be used for spam handling, banning or whatever.
For heavy middleware, use increased capacity.
func NewMiddlewarePoller ¶
func NewMiddlewarePoller(original Poller, filter func(*Update) bool) *MiddlewarePoller
NewMiddlewarePoller wait for it... constructs a new middleware poller.
func (*MiddlewarePoller) Poll ¶
func (p *MiddlewarePoller) Poll(b Bot, dest chan Update, stop chan struct{})
Poll sieves updates through middleware filter.
type OpeningHours ¶ added in v1.10.9
type Option ¶
type Option int
const ( Silent Option = iota Protected HasSpoiler RemoveCaption DisableContentTypeDetection Streamable ResizeKeyboard OneTimeKeyboard PersistentKeyboard Selective IsAnonymousPoll AllowMultipleAnswers IsClosedPoll RevokeMessages StickerNeedsRepainting InlineQueryIsPersonal InvoiceNeedName InvoiceNeedPhoneNumber InvoiceNeedEmail InvoiceNeedShippingAddress InvoiceSendPhoneNumberToProvider InvoiceSendEmailToProvider InvoiceIsFlexible ForceGameScoreUpdate DisableGameEditMessage )
type OrderInfo ¶ added in v1.9.0
type OrderInfo struct { // Name is the user's name (optional). Name string `json:"name,omitempty"` // PhoneNumber is the user's phone number (optional). PhoneNumber string `json:"phone_number,omitempty"` // Email is the user's email (optional). Email string `json:"email,omitempty"` // ShippingAddress is the user's shipping address (optional). ShippingAddress ShippingAddress `json:"shipping_address,omitempty"` }
OrderInfo represents information about an order.
func (*OrderInfo) MarshalJSON ¶ added in v1.9.0
func (*OrderInfo) ReflectType ¶ added in v1.9.0
func (*OrderInfo) UnmarshalJSON ¶ added in v1.9.0
type PassportData ¶ added in v1.9.0
type PassportData struct { // Data is an array with information about documents and other Telegram Passport elements that were shared with the bot. Data []EncryptedPassportElement `json:"data"` // Credentials encrypted credentials required to decrypt the data. Credentials EncryptedCredentials `json:"credentials"` }
PassportData describes Telegram Passport data shared with the bot by the user.
func (*PassportData) MarshalJSON ¶ added in v1.9.0
func (c *PassportData) MarshalJSON() ([]byte, error)
func (*PassportData) ReflectType ¶ added in v1.9.0
func (c *PassportData) ReflectType() string
func (*PassportData) String ¶ added in v1.9.0
func (f *PassportData) String() string
func (*PassportData) Type ¶ added in v1.9.0
func (c *PassportData) Type() string
func (*PassportData) UnmarshalJSON ¶ added in v1.9.0
func (c *PassportData) UnmarshalJSON(data []byte) error
func (*PassportData) Verify ¶ added in v1.9.0
func (c *PassportData) Verify() error
type PassportElementError ¶ added in v1.9.0
type PassportElementError struct { }
func (*PassportElementError) MarshalJSON ¶ added in v1.9.0
func (c *PassportElementError) MarshalJSON() ([]byte, error)
func (*PassportElementError) ReflectType ¶ added in v1.9.0
func (c *PassportElementError) ReflectType() string
func (*PassportElementError) String ¶ added in v1.9.0
func (f *PassportElementError) String() string
func (*PassportElementError) Type ¶ added in v1.9.0
func (c *PassportElementError) Type() string
func (*PassportElementError) UnmarshalJSON ¶ added in v1.9.0
func (c *PassportElementError) UnmarshalJSON(data []byte) error
func (*PassportElementError) Verify ¶ added in v1.9.0
func (c *PassportElementError) Verify() error
type PassportFile ¶ added in v1.9.0
type PassportFile struct { // FileID is the identifier for this file, which can be used to download or reuse the file. FileID string `json:"file_id"` // FileUniqueID is a unique identifier for this file, supposed to be the same over time and for different bots. // It can't be used to download or reuse the file. FileUniqueID string `json:"file_unique_id"` // FileSize is the file size in bytes. FileSize int64 `json:"file_size"` // FileDate is the Unix time when the file was uploaded. FileDate int `json:"file_date"` }
PassportFile represents a file uploaded to Telegram Passport. Currently, all Telegram Passport files are in JPEG format when decrypted and don't exceed 10MB.
func (*PassportFile) File ¶ added in v1.9.0
func (c *PassportFile) File() *File
func (*PassportFile) MarshalJSON ¶ added in v1.9.0
func (c *PassportFile) MarshalJSON() ([]byte, error)
func (*PassportFile) ReflectType ¶ added in v1.9.0
func (c *PassportFile) ReflectType() string
func (*PassportFile) String ¶ added in v1.9.0
func (f *PassportFile) String() string
func (*PassportFile) Type ¶ added in v1.9.0
func (c *PassportFile) Type() string
func (*PassportFile) UnmarshalJSON ¶ added in v1.9.0
func (c *PassportFile) UnmarshalJSON(data []byte) error
func (*PassportFile) Verify ¶ added in v1.9.0
func (c *PassportFile) Verify() error
type PhotoSize ¶ added in v1.9.0
type PhotoSize struct { FileID string `json:"file_id"` FileUniqueID string `json:"file_unique_id"` Width int `json:"width"` Height int `json:"height"` FileSize int64 `json:"file_size,omitempty"` }
func (*PhotoSize) MarshalJSON ¶ added in v1.9.0
func (*PhotoSize) ReflectType ¶ added in v1.9.0
func (*PhotoSize) UnmarshalJSON ¶ added in v1.9.0
type PhotoSizes ¶ added in v1.9.0
type PhotoSizes []PhotoSize
func (*PhotoSizes) HighRes ¶ added in v1.9.0
func (p *PhotoSizes) HighRes() *PhotoSize
type PictureSize ¶ added in v1.9.0
type PictureSize int
type Poll ¶
type Poll struct { // ID is the unique poll identifier. ID string `json:"id"` // Question is the poll question (1-300 characters). Question string `json:"question"` // Options is the list of poll options. Options []PollOption `json:"options"` // TotalVoterCount is the total number of users that voted in the poll. TotalVoterCount int `json:"total_voter_count"` // IsClosed is true if the poll is closed. IsClosed bool `json:"is_closed"` // IsAnonymous is true if the poll is anonymous. IsAnonymous bool `json:"is_anonymous"` // Type is the poll type, currently can be “regular” or “quiz”. PollType PollType `json:"type"` // AllowsMultipleAnswers is true if the poll allows multiple answers. AllowsMultipleAnswers bool `json:"allows_multiple_answers"` // CorrectOptionID is the 0-based identifier of the correct answer option (optional). // Available only for polls in quiz mode, which are closed, or was sent (not forwarded) by the bot or to the private chat with the bot. CorrectOptionID int `json:"correct_option_id,omitempty"` // Explanation is the text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll (optional, 0-200 characters). Explanation string `json:"explanation,omitempty"` // ExplanationEntities is the list of special entities like usernames, URLs, bot commands, etc. that appear in the explanation (optional). ExplanationEntities []Entity `json:"explanation_entities,omitempty"` // OpenPeriod is the amount of time in seconds the poll will be active after creation (optional). OpenPeriod int `json:"open_period,omitempty"` // CloseDate is the point in time (Unix timestamp) when the poll will be automatically closed (optional). CloseDate int `json:"close_date,omitempty"` QuestionEntities []Entity `json:"question_entities,omitempty"` }
Poll contains information about a poll.
func (*Poll) MarshalJSON ¶ added in v1.9.0
func (*Poll) ReflectType ¶ added in v1.9.0
func (*Poll) UnmarshalJSON ¶ added in v1.9.0
type PollAnswer ¶
type PollAnswer struct { // PollID is the unique poll identifier. ID string `json:"poll_id"` // VoterChat is the chat that changed the answer to the poll, if the voter is anonymous (optional). VoterChat *Chat `json:"voter_chat,omitempty"` // User is the user that changed the answer to the poll, if the voter isn't anonymous (optional). User *User `json:"user,omitempty"` // OptionIDs is the 0-based identifiers of chosen answer options. // May be empty if the vote was retracted. OptionIDs []int `json:"option_ids"` }
PollAnswer represents an answer of a user in a non-anonymous poll.
func (*PollAnswer) MarshalJSON ¶ added in v1.9.0
func (c *PollAnswer) MarshalJSON() ([]byte, error)
func (*PollAnswer) ReflectType ¶ added in v1.9.0
func (c *PollAnswer) ReflectType() string
func (*PollAnswer) String ¶ added in v1.9.0
func (c *PollAnswer) String() string
func (*PollAnswer) Type ¶ added in v1.9.0
func (c *PollAnswer) Type() string
func (*PollAnswer) UnmarshalJSON ¶ added in v1.9.0
func (c *PollAnswer) UnmarshalJSON(b []byte) error
func (*PollAnswer) Verify ¶ added in v1.9.0
func (c *PollAnswer) Verify() error
type PollOption ¶
type PollOption struct { // Text is the text of the option. Text string `json:"text"` TextEntities []Entity `json:"text_entities,omitempty"` // VoterCount is the number of users who voted for this option. VoterCount int `json:"voter_count"` }
PollOption represents an option in a poll.
func (*PollOption) MarshalJSON ¶ added in v1.9.0
func (p *PollOption) MarshalJSON() ([]byte, error)
func (*PollOption) ReflectType ¶ added in v1.9.0
func (p *PollOption) ReflectType() string
func (*PollOption) String ¶ added in v1.9.0
func (p *PollOption) String() string
func (*PollOption) Type ¶ added in v1.9.0
func (p *PollOption) Type() string
func (*PollOption) UnmarshalJSON ¶ added in v1.9.0
func (p *PollOption) UnmarshalJSON(data []byte) error
func (*PollOption) Verify ¶ added in v1.9.0
func (p *PollOption) Verify() error
type Poller ¶
type Poller interface { // Poll is supposed to take the bot object // subscription channel and start polling // for Updates immediately. // // Poller must listen for stop constantly and close // it as soon as it's done polling. Poll(b Bot, updates chan Update, stop chan struct{}) }
Poller is a provider of Updates.
All pollers must implement Poll(), which accepts bot pointer and subscription channel and start polling synchronously straight away.
type PreCheckoutQuery ¶
type PreCheckoutQuery struct { // ID is the unique query identifier. ID string `json:"id"` // From is the user who sent the query. From User `json:"from"` // Currency is the three-letter ISO 4217 currency code. Currency string `json:"currency"` // TotalAmount is the 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). TotalAmount int `json:"total_amount"` // InvoicePayload is the bot-specified invoice payload. InvoicePayload string `json:"invoice_payload"` // ShippingOptionID is the identifier of the shipping option chosen by the user (optional). ShippingOptionID string `json:"shipping_option_id,omitempty"` // OrderInfo is the order information provided by the user (optional). OrderInfo OrderInfo `json:"order_info,omitempty"` }
PreCheckoutQuery contains information about an incoming pre-checkout query.
func (*PreCheckoutQuery) MarshalJSON ¶ added in v1.9.0
func (c *PreCheckoutQuery) MarshalJSON() ([]byte, error)
func (*PreCheckoutQuery) ReflectType ¶ added in v1.9.0
func (c *PreCheckoutQuery) ReflectType() string
func (*PreCheckoutQuery) String ¶ added in v1.9.0
func (c *PreCheckoutQuery) String() string
func (*PreCheckoutQuery) Type ¶ added in v1.9.0
func (c *PreCheckoutQuery) Type() string
func (*PreCheckoutQuery) UnmarshalJSON ¶ added in v1.9.0
func (c *PreCheckoutQuery) UnmarshalJSON(b []byte) error
func (*PreCheckoutQuery) Verify ¶ added in v1.9.0
func (c *PreCheckoutQuery) Verify() error
type ProviderData ¶ added in v1.9.0
type ProviderData string
type ProximityAlertTriggered ¶ added in v1.9.0
type ProximityAlertTriggered struct { // Traveler is the user that triggered the alert. Traveler User `json:"traveler"` // Watcher is the user that set the alert. Watcher User `json:"watcher"` // Distance is the distance between the users. Distance int `json:"distance"` }
ProximityAlertTriggered represents the content of a service message, sent whenever a user in the chat triggers a proximity alert set by another user.
func (*ProximityAlertTriggered) MarshalJSON ¶ added in v1.9.0
func (f *ProximityAlertTriggered) MarshalJSON() ([]byte, error)
func (*ProximityAlertTriggered) ReflectType ¶ added in v1.9.0
func (c *ProximityAlertTriggered) ReflectType() string
func (*ProximityAlertTriggered) String ¶ added in v1.9.0
func (f *ProximityAlertTriggered) String() string
func (*ProximityAlertTriggered) Type ¶ added in v1.9.0
func (c *ProximityAlertTriggered) Type() string
func (*ProximityAlertTriggered) UnmarshalJSON ¶ added in v1.9.0
func (f *ProximityAlertTriggered) UnmarshalJSON(data []byte) error
func (*ProximityAlertTriggered) Verify ¶ added in v1.9.0
func (f *ProximityAlertTriggered) Verify() error
type QueryResult ¶ added in v1.9.0
type QueryResult struct { // Type of the result QueryType InlineQueryResultType `json:"type"` // Unique identifier for this result, 1-64 Bytes ID string `json:"id"` // Title of the result (For those results that require a Title) Title *string `json:"title,omitempty"` // MessageContent Content of the message to be sent MessageContent InputMessageContent `json:"input_message_content,omitempty"` // ReplyMarkup Optional. Inline keyboard attached to the message. ReplyMarkup ReplyMarkup `json:"reply_markup,omitempty"` // URL of the result URL *string `json:"url,omitempty"` // HideURL True if you don't want the URL to be shown in the message. HideURL *bool `json:"hide_url,omitempty"` // Short description of the result Description *string `json:"description,omitempty"` // ThumbnailURL of the thumbnail for the result ThumbnailURL *string `json:"thumbnail_url,omitempty"` // ThumbnailWidth width ThumbnailWidth *int `json:"thumbnail_width,omitempty"` // ThumbnailHeight height ThumbnailHeight *int `json:"thumbnail_height,omitempty"` }
func (*QueryResult) MarshalJSON ¶ added in v1.9.0
func (q *QueryResult) MarshalJSON() ([]byte, error)
func (*QueryResult) ReflectType ¶ added in v1.9.0
func (q *QueryResult) ReflectType() string
func (*QueryResult) String ¶ added in v1.9.0
func (q *QueryResult) String() string
func (*QueryResult) Type ¶ added in v1.9.0
func (q *QueryResult) Type() string
func (*QueryResult) UnmarshalJSON ¶ added in v1.9.0
func (q *QueryResult) UnmarshalJSON(data []byte) error
func (*QueryResult) Verify ¶ added in v1.9.0
func (q *QueryResult) Verify() error
type QueryResults ¶ added in v1.9.0
type QueryResults []QueryResult
type ReactionCount ¶ added in v1.9.0
type ReactionCount struct { // ReactionType is the type of reaction. ReactionType ReactionType `json:"type"` // Count is the count of reactions of the specified type. Count int `json:"count"` }
ReactionCount represents the count of a specific reaction on a message.
func (*ReactionCount) MarshalJSON ¶ added in v1.9.0
func (c *ReactionCount) MarshalJSON() ([]byte, error)
func (*ReactionCount) ReflectType ¶ added in v1.9.0
func (c *ReactionCount) ReflectType() string
func (*ReactionCount) String ¶ added in v1.9.0
func (c *ReactionCount) String() string
func (*ReactionCount) Type ¶ added in v1.9.0
func (c *ReactionCount) Type() string
func (*ReactionCount) UnmarshalJSON ¶ added in v1.9.0
func (c *ReactionCount) UnmarshalJSON(data []byte) error
func (*ReactionCount) Verify ¶ added in v1.9.0
func (c *ReactionCount) Verify() error
type ReactionType ¶ added in v1.9.0
type ReactionType struct { ReactionType ReactionTypeType `json:"type"` Emoji Emoji `json:"emoji,omitempty"` CustomEmojiID string `json:"custom_emoji_id,omitempty"` }
ReactionType represents the type of a reaction.
func (*ReactionType) MarshalJSON ¶ added in v1.9.0
func (c *ReactionType) MarshalJSON() ([]byte, error)
func (*ReactionType) ReflectType ¶ added in v1.9.0
func (c *ReactionType) ReflectType() string
func (*ReactionType) String ¶ added in v1.9.0
func (c *ReactionType) String() string
func (*ReactionType) Type ¶ added in v1.9.0
func (c *ReactionType) Type() string
func (*ReactionType) UnmarshalJSON ¶ added in v1.9.0
func (c *ReactionType) UnmarshalJSON(data []byte) error
func (*ReactionType) Verify ¶ added in v1.9.0
func (c *ReactionType) Verify() error
type ReactionTypeType ¶ added in v1.9.0
type ReactionTypeType string
const ( ReactionTypeTypeEmoji ReactionTypeType = "emoji" ReactionTypeTypeCustomEmoji ReactionTypeType = "custom_emoji" )
type ReplyKeyboardMarkup ¶ added in v1.9.0
type ReplyKeyboardMarkup struct { // Keyboard is an array of button rows, each represented by an array of KeyboardButton objects. Keyboard []Row `json:"keyboard"` // IsPersistent 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 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 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 to be shown in the input field when the keyboard is active; 1-64 characters. InputFieldPlaceholder *string `json:"input_field_placeholder,omitempty"` // Selective is used if you want to show the keyboard to specific users only. // Targets: // 1) Users that are @mentioned in the text of the AccessibleMessage object. // 2) If the bot's message is a reply to a message in the same chat and forum topic, the sender of the original message. Selective *bool `json:"selective,omitempty"` }
ReplyKeyboardMarkup represents a custom keyboard with reply options.
func (*ReplyKeyboardMarkup) MarshalJSON ¶ added in v1.9.0
func (m *ReplyKeyboardMarkup) MarshalJSON() ([]byte, error)
func (*ReplyKeyboardMarkup) ReflectType ¶ added in v1.9.0
func (m *ReplyKeyboardMarkup) ReflectType() string
func (*ReplyKeyboardMarkup) String ¶ added in v1.9.0
func (m *ReplyKeyboardMarkup) String() string
func (*ReplyKeyboardMarkup) Type ¶ added in v1.9.0
func (m *ReplyKeyboardMarkup) Type() string
func (*ReplyKeyboardMarkup) UnmarshalJSON ¶ added in v1.9.0
func (m *ReplyKeyboardMarkup) UnmarshalJSON(data []byte) error
func (*ReplyKeyboardMarkup) Verify ¶ added in v1.9.0
func (m *ReplyKeyboardMarkup) Verify() error
type ReplyKeyboardRemove ¶ added in v1.9.0
type ReplyKeyboardRemove struct { // RemoveKeyboard Requests clients to remove the custom keyboard RemoveKeyboard bool `json:"remove_keyboard"` // Selective Use this parameter to remove the keyboard for specific users only Selective *bool `json:"selective,omitempty"` }
ReplyKeyboardRemove removes the current custom keyboard and displays the default letter-keyboard.
func (*ReplyKeyboardRemove) MarshalJSON ¶ added in v1.9.0
func (m *ReplyKeyboardRemove) MarshalJSON() ([]byte, error)
func (*ReplyKeyboardRemove) ReflectType ¶ added in v1.9.0
func (m *ReplyKeyboardRemove) ReflectType() string
func (*ReplyKeyboardRemove) String ¶ added in v1.9.0
func (m *ReplyKeyboardRemove) String() string
func (*ReplyKeyboardRemove) Type ¶ added in v1.9.0
func (m *ReplyKeyboardRemove) Type() string
func (*ReplyKeyboardRemove) UnmarshalJSON ¶ added in v1.9.0
func (m *ReplyKeyboardRemove) UnmarshalJSON(data []byte) error
func (*ReplyKeyboardRemove) Verify ¶ added in v1.9.0
func (m *ReplyKeyboardRemove) Verify() error
type ReplyMarkup ¶
type ReplyMarkup interface { ReplyMarkup() AddRow(row ...Button) AddRows(rows ...Row) Inline() Keyboard(opts ...any) Remove(opts ...any) ForceReply(opts ...any) MarshalJSON() ([]byte, error) UnmarshalJSON(data []byte) error // contains filtered or unexported methods }
func NewMarkup ¶ added in v1.9.0
func NewMarkup() ReplyMarkup
type ReplyParameters ¶ added in v1.9.0
type ReplyParameters struct { MessageID int64 `json:"message_id"` ChatID any `json:"chat_id,omitempty"` AllowSendingWithoutReply *bool `json:"allow_sending_without_reply,omitempty"` Quote *string `json:"quote,omitempty"` QuoteParseMode *string `json:"quote_parse_mode,omitempty"` QuoteEntities []Entity `json:"quote_entities,omitempty"` QuotePosition *int `json:"quote_position,omitempty"` }
func (*ReplyParameters) MarshalJSON ¶ added in v1.9.0
func (r *ReplyParameters) MarshalJSON() ([]byte, error)
func (*ReplyParameters) ReflectType ¶ added in v1.9.0
func (r *ReplyParameters) ReflectType() string
func (*ReplyParameters) String ¶ added in v1.9.0
func (r *ReplyParameters) String() string
func (*ReplyParameters) Type ¶ added in v1.9.0
func (r *ReplyParameters) Type() string
func (*ReplyParameters) UnmarshalJSON ¶ added in v1.9.0
func (r *ReplyParameters) UnmarshalJSON(data []byte) error
func (*ReplyParameters) Verify ¶ added in v1.9.0
func (r *ReplyParameters) Verify() error
type RequestContact ¶ added in v1.9.0
type RequestContact bool
type RequestLocation ¶ added in v1.9.0
type RequestLocation bool
type Rights ¶
type Rights struct { IsAnonymous bool `json:"is_anonymous"` CanManageChat bool `json:"can_manage_chat" yaml:"can_manage_chat"` CanDeleteMessages bool `json:"can_delete_messages" yaml:"can_delete_messages"` CanManageVideoChats bool `json:"can_manage_video_chats" yaml:"can_manage_video_chats"` CanRestrictMembers bool `json:"can_restrict_members" yaml:"can_restrict_members"` CanPromoteMembers bool `json:"can_promote_members" yaml:"can_promote_members"` CanChangeInfo bool `json:"can_change_info" yaml:"can_change_info"` CanInviteUsers bool `json:"can_invite_users" yaml:"can_invite_users"` CanPostMessages *bool `json:"can_post_messages,omitempty" yaml:"can_post_messages"` CanEditMessages *bool `json:"can_edit_messages,omitempty" yaml:"can_edit_messages"` CanPinMessages *bool `json:"can_pin_messages,omitempty" yaml:"can_pin_messages"` CanPostStories *bool `json:"can_post_stories,omitempty" yaml:"can_post_stories"` CanEditStories *bool `json:"can_edit_stories,omitempty" yaml:"can_edit_stories"` CanDeleteStories *bool `json:"can_delete_stories,omitempty" yaml:"can_delete_stories"` CanManageTopics *bool `json:"can_manage_topics,omitempty" yaml:"can_manage_topics"` }
func (*Rights) MarshalJSON ¶ added in v1.9.0
func (*Rights) ReflectType ¶ added in v1.9.0
func (*Rights) UnmarshalJSON ¶ added in v1.9.0
type Row ¶
type Row []Button
Row Represents a row of Buttons Maximum number of Buttons in a ReplyMarkup is 100 (telegram limits).
func (*Row) UnmarshalJSON ¶ added in v1.9.0
UnmarshalJSON implements json.Unmarshaler. It supports both InlineKeyboardButton and KeyboardButton. It is a bit complicated to unmarshal into interface types, believe me. this thing works perfectly for our goal, if you have a better idea, a PR is appreciated.
type SentWebAppMessage ¶ added in v1.9.0
type SentWebAppMessage struct {
InlineMessageID *string `json:"inline_message_id,omitempty"`
}
func (*SentWebAppMessage) MarshalJSON ¶ added in v1.9.0
func (s *SentWebAppMessage) MarshalJSON() ([]byte, error)
func (*SentWebAppMessage) ReflectType ¶ added in v1.9.0
func (s *SentWebAppMessage) ReflectType() string
func (*SentWebAppMessage) String ¶ added in v1.9.0
func (s *SentWebAppMessage) String() string
func (*SentWebAppMessage) Type ¶ added in v1.9.0
func (s *SentWebAppMessage) Type() string
func (*SentWebAppMessage) UnmarshalJSON ¶ added in v1.9.0
func (s *SentWebAppMessage) UnmarshalJSON(data []byte) error
func (*SentWebAppMessage) Verify ¶ added in v1.9.0
func (s *SentWebAppMessage) Verify() error
type SharedUser ¶ added in v1.10.9
type SharedUser struct {}
type ShippingAddress ¶
type ShippingAddress struct { // CountryCode is the two-letter ISO 3166-1 alpha-2 country code. CountryCode string `json:"country_code"` // State is the state, if applicable. State string `json:"state"` // City is the city. City string `json:"city"` // StreetLine1 is the first line for the address. StreetLine1 string `json:"street_line1"` // StreetLine2 is the second line for the address. StreetLine2 string `json:"street_line2"` // PostCode is the address post code. PostCode string `json:"post_code"` }
ShippingAddress represents a shipping address.
func (*ShippingAddress) MarshalJSON ¶ added in v1.9.0
func (c *ShippingAddress) MarshalJSON() ([]byte, error)
func (*ShippingAddress) ReflectType ¶ added in v1.9.0
func (c *ShippingAddress) ReflectType() string
func (*ShippingAddress) String ¶ added in v1.9.0
func (f *ShippingAddress) String() string
func (*ShippingAddress) Type ¶ added in v1.9.0
func (c *ShippingAddress) Type() string
func (*ShippingAddress) UnmarshalJSON ¶ added in v1.9.0
func (c *ShippingAddress) UnmarshalJSON(data []byte) error
func (*ShippingAddress) Verify ¶ added in v1.9.0
func (c *ShippingAddress) Verify() error
type ShippingOption ¶
type ShippingOption struct { ID string `json:"id"` Title string `json:"title"` Prices []LabeledPrice `json:"prices"` }
type ShippingQuery ¶
type ShippingQuery struct { // ID is the unique query identifier. ID string `json:"id"` // From is the user who sent the query. From User `json:"from"` // InvoicePayload is the bot-specified invoice payload. InvoicePayload string `json:"invoice_payload"` // ShippingAddress is the user-specified shipping address. ShippingAddress ShippingAddress `json:"shipping_address"` }
ShippingQuery contains information about an incoming shipping query.
func (*ShippingQuery) MarshalJSON ¶ added in v1.9.0
func (sh *ShippingQuery) MarshalJSON() ([]byte, error)
func (*ShippingQuery) ReflectType ¶ added in v1.9.0
func (sh *ShippingQuery) ReflectType() string
func (*ShippingQuery) String ¶ added in v1.9.0
func (sh *ShippingQuery) String() string
func (*ShippingQuery) Type ¶ added in v1.9.0
func (sh *ShippingQuery) Type() string
func (*ShippingQuery) UnmarshalJSON ¶ added in v1.9.0
func (sh *ShippingQuery) UnmarshalJSON(b []byte) error
func (*ShippingQuery) Verify ¶ added in v1.9.0
func (sh *ShippingQuery) Verify() error
type StartParameter ¶ added in v1.9.0
type StartParameter string
type Status ¶ added in v1.9.0
type Status string
Status represents the possible statuses of a chat member.
type Sticker ¶
type Sticker struct { FileID string `json:"file_id"` FileUniqueID string `json:"file_unique_id"` StickerType string `json:"type"` Width int `json:"width"` Height int `json:"height"` IsAnimated bool `json:"is_animated"` IsVideo bool `json:"is_video"` Thumbnail *PhotoSize `json:"thumbnail,omitempty"` Emoji string `json:"emoji,omitempty"` SetName string `json:"set_name,omitempty"` PremiumAnimation *File `json:"premium_animation,omitempty"` MaskPosition *MaskPosition `json:"mask_position,omitempty"` CustomEmojiID *string `json:"custom_emoji_id,omitempty"` NeedsRepainting *bool `json:"needs_repainting,omitempty"` FileSize int64 `json:"file_size,omitempty"` }
func (*Sticker) MarshalJSON ¶ added in v1.9.0
func (*Sticker) ReflectType ¶ added in v1.9.0
func (*Sticker) UnmarshalJSON ¶ added in v1.9.0
type StickerEmoji ¶ added in v1.9.0
type StickerEmoji string
func (*StickerEmoji) String ¶ added in v1.9.0
func (d *StickerEmoji) String() string
type StickerFormat ¶ added in v1.9.0
type StickerFormat string
const ( StickerFormatStatic StickerFormat = "static" StickerFormatAnimated StickerFormat = "animated" StickerFormatVideo StickerFormat = "video" )
func (*StickerFormat) String ¶ added in v1.9.0
func (s *StickerFormat) String() string
type StickerSet ¶
type StickerSet struct { // Name represents the sticker set name. Name string `json:"name"` // Title represents the sticker set title. Title string `json:"title"` // StickerType represents the type of stickers in the set, currently one of "regular", "mask", "custom_emoji". StickerType string `json:"sticker_type"` // Stickers is a list of all set stickers. Stickers []Sticker `json:"stickers"` // Thumbnail is an optional sticker set thumbnail in the .WEBP, .TGS, or .WEBM format. Thumbnail *PhotoSize `json:"thumbnail,omitempty"` }
StickerSet represents a sticker set.
func (*StickerSet) MarshalJSON ¶ added in v1.9.0
func (f *StickerSet) MarshalJSON() ([]byte, error)
func (*StickerSet) ReflectType ¶ added in v1.9.0
func (c *StickerSet) ReflectType() string
func (*StickerSet) String ¶ added in v1.9.0
func (f *StickerSet) String() string
func (*StickerSet) Type ¶
func (c *StickerSet) Type() string
func (*StickerSet) UnmarshalJSON ¶ added in v1.9.0
func (f *StickerSet) UnmarshalJSON(data []byte) error
func (*StickerSet) Verify ¶ added in v1.9.0
func (f *StickerSet) Verify() error
type StickerType ¶ added in v1.9.0
type StickerType string
const ( StickerTypeRegular StickerType = "regular" StickerTypeMask StickerType = "mask" StickerTypeCustomEmoji StickerType = "custom_emoji" )
func (*StickerType) String ¶ added in v1.9.0
func (s *StickerType) String() string
type Story ¶ added in v1.1.1
Story object represents a message about a forwarded story in the chat
func (*Story) MarshalJSON ¶ added in v1.9.0
func (*Story) ReflectType ¶ added in v1.9.0
func (*Story) UnmarshalJSON ¶ added in v1.9.0
type SuccessfulPayment ¶ added in v1.9.0
type SuccessfulPayment struct { // Currency is the three-letter ISO 4217 currency code. Currency string `json:"currency"` // TotalAmount is the 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). TotalAmount int `json:"total_amount"` // InvoicePayload is the bot-specified invoice payload. InvoicePayload string `json:"invoice_payload"` // ShippingOptionID is an optional field representing the identifier of the shipping option chosen by the user. ShippingOptionID string `json:"shipping_option_id,omitempty"` // OrderInfo is an optional field representing order information provided by the user. OrderInfo OrderInfo `json:"order_info,omitempty"` // TelegramPaymentChargeID is the Telegram payment identifier. TelegramPaymentChargeID string `json:"telegram_payment_charge_id"` // ProviderPaymentChargeID is the provider payment identifier. ProviderPaymentChargeID string `json:"provider_payment_charge_id"` }
SuccessfulPayment contains basic information about a successful payment.
func (*SuccessfulPayment) MarshalJSON ¶ added in v1.9.0
func (c *SuccessfulPayment) MarshalJSON() ([]byte, error)
func (*SuccessfulPayment) ReflectType ¶ added in v1.9.0
func (c *SuccessfulPayment) ReflectType() string
func (*SuccessfulPayment) String ¶ added in v1.9.0
func (f *SuccessfulPayment) String() string
func (*SuccessfulPayment) Type ¶ added in v1.9.0
func (c *SuccessfulPayment) Type() string
func (*SuccessfulPayment) UnmarshalJSON ¶ added in v1.9.0
func (c *SuccessfulPayment) UnmarshalJSON(data []byte) error
func (*SuccessfulPayment) Verify ¶ added in v1.9.0
func (c *SuccessfulPayment) Verify() error
type SuggestedTopAmounts ¶ added in v1.9.0
type SuggestedTopAmounts []int
type SwitchInlineQueryChosenChat ¶
type SwitchInlineQueryChosenChat struct { // Query is the default inline query to be inserted in the input field. // If left empty, only the bot's username will be inserted. Query *string `json:"query,omitempty" yaml:"query,omitempty"` // AllowUserChats, if true, allows private chats with users to be chosen. AllowUserChats *bool `json:"allow_user_chats,omitempty" yaml:"allow_user_chats,omitempty"` // AllowBotChats, if true, allows private chats with bots to be chosen. AllowBotChats *bool `json:"allow_bot_chats,omitempty" yaml:"allow_bot_chats,omitempty"` // AllowGroupChats, if true, allows group and supergroup chats to be chosen. AllowGroupChats *bool `json:"allow_group_chats,omitempty" yaml:"allow_group_chats,omitempty"` // AllowChannelChats, if true, allows channel chats to be chosen. AllowChannelChats *bool `json:"allow_channel_chats,omitempty" yaml:"allow_channel_chats,omitempty"` }
SwitchInlineQueryChosenChat represents an inline button that switches the current user to inline mode in a chosen chat, with an optional default inline query.
func (*SwitchInlineQueryChosenChat) MarshalJSON ¶ added in v1.9.0
func (i *SwitchInlineQueryChosenChat) MarshalJSON() ([]byte, error)
func (*SwitchInlineQueryChosenChat) ReflectType ¶ added in v1.9.0
func (i *SwitchInlineQueryChosenChat) ReflectType() string
func (*SwitchInlineQueryChosenChat) String ¶ added in v1.9.0
func (i *SwitchInlineQueryChosenChat) String() string
func (*SwitchInlineQueryChosenChat) Type ¶ added in v1.9.0
func (i *SwitchInlineQueryChosenChat) Type() string
func (*SwitchInlineQueryChosenChat) UnmarshalJSON ¶ added in v1.9.0
func (i *SwitchInlineQueryChosenChat) UnmarshalJSON(data []byte) error
func (*SwitchInlineQueryChosenChat) Verify ¶ added in v1.9.0
func (i *SwitchInlineQueryChosenChat) Verify() error
type SwitchInlineQueryChosenChatStringType ¶ added in v1.9.0
type SwitchInlineQueryChosenChatStringType string
type SwitchInlineQueryStringType ¶ added in v1.9.0
type SwitchInlineQueryStringType string
type TType ¶ added in v1.9.0
type TType interface { Verify() error String() string MarshalJSON() ([]byte, error) UnmarshalJSON([]byte) error Type() string ReflectType() string }
TType is an interface for all `telebot` types, every Type should implement TType.
type TextQuote ¶ added in v1.9.0
type TextQuote struct { Text string `json:"text"` Entities []Entity `json:"entities,omitempty"` Position int `json:"position"` IsManual *bool `json:"is_manual,omitempty"` }
func (*TextQuote) MarshalJSON ¶ added in v1.9.0
func (*TextQuote) ReflectType ¶ added in v1.9.0
func (*TextQuote) UnmarshalJSON ¶ added in v1.9.0
type Update ¶
type Update struct { // ID is the update's a unique identifier. // Update identifiers start from a certain positive number and increase sequentially. // This identifier becomes handy if you're using webhooks, allowing you to ignore repeated updates or restore the correct update sequence if they get out of order. // If there are no new updates for at least a week, then the identifier of the next update will be chosen randomly instead of sequentially. ID int `json:"update_id" verify:"nonzero"` // Message is the new incoming message of any kind – text, photo, sticker, etc. (optional). Message *AccessibleMessage `json:"message,omitempty"` // EditedMessage is the new version of a message that is known to the bot and was edited (optional). EditedMessage *AccessibleMessage `json:"edited_message,omitempty"` // BusinessConnection is the new incoming business connection (optional). BusinessConnection *BusinessConnection `json:"business_connection,omitempty"` // BusinessMessage is the new incoming business message (optional). BusinessMessage *AccessibleMessage `json:"business_message,omitempty"` // BusinessEditedMessage is the new version of a business message that is known to the bot and was edited (optional). BusinessEditedMessage *AccessibleMessage `json:"edited_business_message,omitempty"` // BusinessDeletedMessage is the new version of a business message that is known to the bot and was deleted (optional). BusinessDeletedMessage *BusinessMessagesDeleted `json:"deleted_business_messages,omitempty"` // ChannelPost is the new incoming channel post of any kind – text, photo, sticker, etc. (optional). ChannelPost *AccessibleMessage `json:"channel_post,omitempty"` // EditedChannelPost is the new version of a channel post that is known to the bot and was edited (optional). EditedChannelPost *AccessibleMessage `json:"edited_channel_post,omitempty"` // Reaction is the reaction to a message changed by a user (optional). Reaction *MessageReaction `json:"message_reaction,omitempty"` // ReactionCount is the reactions to a message with anonymous reactions that were changed (optional). ReactionCount *MessageReactionCountUpdated `json:"message_reaction_count,omitempty"` // InlineQuery is the new incoming inline query (optional). Query *InlineQuery `json:"inline_query,omitempty"` // InlineResult is the result of an inline query that was chosen by a user and sent to their chat partner (optional). InlineResult *ChosenInlineResult `json:"chosen_inline_result,omitempty"` // CallbackQuery is the new incoming callback query (optional). CallbackQuery *Callback `json:"callback_query,omitempty"` // ShippingQuery is the new incoming shipping query (optional, only for invoices with flexible price). ShippingQuery *ShippingQuery `json:"shipping_query,omitempty"` // PreCheckoutQuery is the new incoming pre-checkout query. Contains full information about checkout (optional). PreCheckoutQuery *PreCheckoutQuery `json:"pre_checkout_query,omitempty"` // Poll is the new poll state. Bots receive only updates about manually stopped polls and polls sent by the bot (optional). Poll *Poll `json:"poll,omitempty"` // PollAnswer is the user changed their answer in a non-anonymous poll. Bots receive new votes only in polls sent by the bot itself (optional). PollAnswer *PollAnswer `json:"poll_answer,omitempty"` // MyChatMember is the bot's chat member status updated in a chat (optional, for private chats, this update is received only when the bot is blocked or unblocked by the user). MyChatMember *ChatMemberUpdated `json:"my_chat_member,omitempty"` // ChatMember is a chat member's status updated in a chat (optional, the bot must be an administrator in the chat and must explicitly specify "chat_member" in the list of allowed_updates to receive these updates). ChatMember *ChatMemberUpdated `json:"chat_member,omitempty"` // ChatJoinRequest is a request to join the chat that has been sent (optional, the bot must have the can_invite_users administrator right in the chat to receive these updates). ChatJoinRequest *ChatJoinRequest `json:"chat_join_request,omitempty"` // ChatBoost is a chat boost added or changed (optional, the bot must be an administrator in the chat to receive these updates). ChatBoost *BoostUpdated `json:"chat_boost,omitempty"` // RemovedChatBoost is a boost removed from a chat (optional, the bot must be an administrator in the chat to receive these updates). RemovedChatBoost *BoostRemoved `json:"removed_chat_boost,omitempty"` }
Update represents an incoming update.
func (*Update) MarshalJSON ¶ added in v1.9.0
func (*Update) ReflectType ¶ added in v1.9.0
func (*Update) UnmarshalJSON ¶ added in v1.9.0
func (*Update) UpdateType ¶ added in v1.9.0
func (u *Update) UpdateType() UpdateType
UpdateType returns the type of the Update.
type UpdateHandlerOn ¶ added in v1.9.0
type UpdateHandlerOn int
const ( OnMessage UpdateHandlerOn = iota OnText OnPinnedMessage OnForwardedMessage OnServiceMessage OnPhoto OnVideo OnVoice OnAudio OnDocument OnStory OnAnimation OnVideoNote OnMedia OnSticker OnLocation OnVenue OnContact OnGame OnDice OnInvoice OnPayment OnEditedMessage OnChannelPost OnEditedChannelPost OnCallback OnInlineQuery OnChosenInlineResult OnShippingQuery OnPreCheckoutQuery OnPoll OnPollAnswer OnMyChatMember OnChatMember OnChatJoinRequest OnChatBoost OnChatBoostRemoved OnMessageReaction OnMessageReactionCount OnAny )
type UpdateType ¶ added in v1.9.0
type UpdateType string
UpdateType represents the type of update.
const ( UpdateTypeMessage UpdateType = "message" UpdateTypeEditedMessage UpdateType = "edited_message" UpdateTypeChannelPost UpdateType = "channel_post" UpdateTypeEditedChannelPost UpdateType = "edited_channel_post" UpdateTypeBusinessConnection UpdateType = "business_connection" UpdateTypeBusinessMessage UpdateType = "business_message" UpdateTypeBusinessEditedMessage UpdateType = "edited_business_message" UpdateTypeBusinessDeletedMessage UpdateType = "deleted_business_message" UpdateTypeMessageReaction UpdateType = "message_reaction" UpdateTypeMessageReactionCount UpdateType = "message_reaction_count" UpdateTypeInlineQuery UpdateType = "inline_query" UpdateTypeChosenInlineResult UpdateType = "chosen_inline_result" UpdateTypeCallbackQuery UpdateType = "callback_query" UpdateTypeShippingQuery UpdateType = "shipping_query" UpdateTypePreCheckoutQuery UpdateType = "pre_checkout_query" UpdateTypePoll UpdateType = "poll" UpdateTypePollAnswer UpdateType = "poll_answer" UpdateTypeMyChatMember UpdateType = "my_chat_member" UpdateTypeChatMember UpdateType = "chat_member" UpdateTypeChatJoinRequest UpdateType = "chat_join_request" UpdateTypeChatBoost UpdateType = "chat_boost" UpdateTypeChatBoostRemoved UpdateType = "chat_boost_removed" UpdateTypeUnknown UpdateType = "unknown" )
Update types.
func (UpdateType) IsValid ¶ added in v1.9.0
func (ut UpdateType) IsValid() bool
func (UpdateType) String ¶ added in v1.9.0
func (ut UpdateType) String() string
String returns the string representation of the UpdateType.
type User ¶
type User struct { // ID is the unique identifier for this user or bot. ID int64 `json:"id"` // IsBot indicates whether this user is a bot. IsBot bool `json:"is_bot"` // FirstName is the user's or bot's first name. FirstName string `json:"first_name"` // LastName is the optional last name of the user or bot. LastName *string `json:"last_name,omitempty"` // Username is the optional username of the user or bot. Username *string `json:"username,omitempty"` // LanguageCode is the optional IETF language tag of the user's language. LanguageCode *string `json:"language_code,omitempty"` // IsPremium is optional and indicates whether this user is a Telegram Premium user. IsPremium *bool `json:"is_premium,omitempty"` CanConnectToBusiness *bool `json:"can_connect_to_businesscp,omitempty"` // AddedToAttachmentMenu is optional and indicates whether this user added // the bot to the attachment menu. AddedToAttachmentMenu *bool `json:"added_to_attachment_menu,omitempty"` // CanJoinGroups is optional and indicates whether the bot can be invited to groups. // This field is returned only in getMe. CanJoinGroups *bool `json:"can_join_groups,omitempty"` // CanReadAllGroupMessages is optional and indicates whether privacy mode // is disabled for the bot. This field is returned only in getMe. CanReadAllGroupMessages *bool `json:"can_read_all_group_messages,omitempty"` // SupportsInlineQueries is optional and indicates whether the bot supports // inline queries. This field is returned only in getMe. SupportsInlineQueries *bool `json:"supports_inline_queries,omitempty"` }
User represents a Telegram user or bot.
func (*User) MarshalJSON ¶ added in v1.9.0
func (*User) ReflectType ¶ added in v1.9.0
func (*User) UnmarshalJSON ¶ added in v1.9.0
type UserChatBoosts ¶ added in v1.9.0
type UserChatBoosts struct { // Boosts The list of boosts added to the chat by the user Boosts []ChatBoost `json:"boosts"` }
UserChatBoosts represents a list of boosts added to a chat by a user. <a href="https://core.telegram.org/bots/api#userchatboosts">/bots/api#userchatboosts</a>
func (*UserChatBoosts) MarshalJSON ¶ added in v1.9.0
func (boost *UserChatBoosts) MarshalJSON() ([]byte, error)
func (*UserChatBoosts) ReflectType ¶ added in v1.9.0
func (boost *UserChatBoosts) ReflectType() string
ReflectType returns the type of the struct
func (*UserChatBoosts) String ¶ added in v1.9.0
func (boost *UserChatBoosts) String() string
func (*UserChatBoosts) Type ¶ added in v1.9.0
func (boost *UserChatBoosts) Type() string
Type returns the type of the struct
func (*UserChatBoosts) UnmarshalJSON ¶ added in v1.9.0
func (boost *UserChatBoosts) UnmarshalJSON(data []byte) error
func (*UserChatBoosts) Verify ¶ added in v1.9.0
func (boost *UserChatBoosts) Verify() error
type UserProfilePhotos ¶ added in v1.9.0
type UserProfilePhotos struct { TotalCount int `json:"total_count"` Photos []PhotoSizes `json:"photos"` }
func (*UserProfilePhotos) MarshalJSON ¶ added in v1.9.0
func (u *UserProfilePhotos) MarshalJSON() ([]byte, error)
func (*UserProfilePhotos) ReflectType ¶ added in v1.9.0
func (u *UserProfilePhotos) ReflectType() string
func (*UserProfilePhotos) String ¶ added in v1.9.0
func (u *UserProfilePhotos) String() string
func (*UserProfilePhotos) Type ¶ added in v1.9.0
func (u *UserProfilePhotos) Type() string
func (*UserProfilePhotos) UnmarshalJSON ¶ added in v1.9.0
func (u *UserProfilePhotos) UnmarshalJSON(data []byte) error
func (*UserProfilePhotos) Verify ¶ added in v1.9.0
func (u *UserProfilePhotos) Verify() error
type UsersShared ¶ added in v1.9.0
type UsersShared struct { int `json:"request_id"` Users []SharedUser `json:"user_ids"` }RequestID
UsersShared contains information about the users whose identifiers were shared with the bot using a KeyboardButtonRequestUsers button.
func (*UsersShared) MarshalJSON ¶ added in v1.9.0
func (f *UsersShared) MarshalJSON() ([]byte, error)
func (*UsersShared) ReflectType ¶ added in v1.9.0
func (c *UsersShared) ReflectType() string
func (*UsersShared) String ¶ added in v1.9.0
func (f *UsersShared) String() string
func (*UsersShared) Type ¶ added in v1.9.0
func (c *UsersShared) Type() string
func (*UsersShared) UnmarshalJSON ¶ added in v1.9.0
func (f *UsersShared) UnmarshalJSON(data []byte) error
func (*UsersShared) Verify ¶ added in v1.9.0
func (f *UsersShared) Verify() error
type Venue ¶
type Venue struct { // Location is the Venue location. It can't be a live location. Location Location `json:"location"` // Title is the name of the venue. Title string `json:"title"` // Address is the address of the venue. Address string `json:"address"` // FoursquareID is an optional field representing the Foursquare identifier of the venue. FoursquareID string `json:"foursquare_id,omitempty"` // FoursquareType is an optional field representing the Foursquare type of the venue. // For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”. FoursquareType string `json:"foursquare_type,omitempty"` // GooglePlaceID is an optional field representing the Google Places identifier of the venue. GooglePlaceID string `json:"google_place_id,omitempty"` // GooglePlaceType is an optional field representing the Google Places type of the venue. // See supported types for more information. GooglePlaceType string `json:"google_place_type,omitempty"` }
Venue represents a venue.
func (*Venue) MarshalJSON ¶ added in v1.9.0
func (*Venue) ReflectType ¶ added in v1.9.0
func (*Venue) UnmarshalJSON ¶ added in v1.9.0
type Verifiable ¶ added in v1.9.0
type Verifiable interface {
Verify() error
}
type Video ¶
type Video struct { // FileID is the identifier for this file, which can be used to download or reuse the file. FileID string `json:"file_id"` // FileUniqueID is the unique identifier for this file, which is supposed to be the same over time and for different bots. // It can't be used to download or reuse the file. FileUniqueID string `json:"file_unique_id"` // Width is the video width as defined by the sender. Width int `json:"width"` // Height is the video height as defined by the sender. Height int `json:"height"` // Duration is the duration of the video in seconds as defined by the sender. Duration int `json:"duration"` // Thumbnail is the video thumbnail (optional). Thumbnail *PhotoSize `json:"thumbnail,omitempty"` // FileName is the original filename as defined by the sender (optional). FileName string `json:"file_name,omitempty"` // MimeType is the MIME type of the file as defined by the sender (optional). MimeType string `json:"mime_type,omitempty"` // FileSize is the file size in bytes. It can be bigger than 2^31, 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 is safe for storing this value (optional). FileSize int64 `json:"file_size,omitempty"` }
Video represents a video file.
func (*Video) MarshalJSON ¶ added in v1.9.0
func (*Video) ReflectType ¶ added in v1.9.0
func (*Video) UnmarshalJSON ¶ added in v1.9.0
type VideoChatEnded ¶
type VideoChatEnded struct { // Duration is the video chat duration in seconds. Duration int `json:"duration"` }
VideoChatEnded represents a service message about a video chat ended in the chat.
func (*VideoChatEnded) MarshalJSON ¶ added in v1.9.0
func (f *VideoChatEnded) MarshalJSON() ([]byte, error)
func (*VideoChatEnded) ReflectType ¶ added in v1.9.0
func (c *VideoChatEnded) ReflectType() string
func (*VideoChatEnded) String ¶ added in v1.9.0
func (f *VideoChatEnded) String() string
func (*VideoChatEnded) Type ¶ added in v1.9.0
func (c *VideoChatEnded) Type() string
func (*VideoChatEnded) UnmarshalJSON ¶ added in v1.9.0
func (f *VideoChatEnded) UnmarshalJSON(data []byte) error
func (*VideoChatEnded) Verify ¶ added in v1.9.0
func (f *VideoChatEnded) Verify() error
type VideoChatParticipantsInvited ¶ added in v1.9.0
type VideoChatParticipantsInvited struct { // Users is the list of new members that were invited to the video chat. Users []User `json:"users"` }
VideoChatParticipantsInvited represents a service message about new members invited to a video chat.
func (*VideoChatParticipantsInvited) MarshalJSON ¶ added in v1.9.0
func (f *VideoChatParticipantsInvited) MarshalJSON() ([]byte, error)
func (*VideoChatParticipantsInvited) ReflectType ¶ added in v1.9.0
func (c *VideoChatParticipantsInvited) ReflectType() string
func (*VideoChatParticipantsInvited) String ¶ added in v1.9.0
func (f *VideoChatParticipantsInvited) String() string
func (*VideoChatParticipantsInvited) Type ¶ added in v1.9.0
func (c *VideoChatParticipantsInvited) Type() string
func (*VideoChatParticipantsInvited) UnmarshalJSON ¶ added in v1.9.0
func (f *VideoChatParticipantsInvited) UnmarshalJSON(data []byte) error
func (*VideoChatParticipantsInvited) Verify ¶ added in v1.9.0
func (f *VideoChatParticipantsInvited) Verify() error
type VideoChatScheduled ¶
type VideoChatScheduled struct { // StartDate is the point in time (Unix timestamp) when the video chat is supposed to be started by a chat administrator. StartDate int `json:"start_date"` }
VideoChatScheduled represents a service message about a video chat scheduled in the chat.
func (*VideoChatScheduled) MarshalJSON ¶ added in v1.9.0
func (f *VideoChatScheduled) MarshalJSON() ([]byte, error)
func (*VideoChatScheduled) ReflectType ¶ added in v1.9.0
func (c *VideoChatScheduled) ReflectType() string
func (*VideoChatScheduled) String ¶ added in v1.9.0
func (f *VideoChatScheduled) String() string
func (*VideoChatScheduled) Type ¶ added in v1.9.0
func (c *VideoChatScheduled) Type() string
func (*VideoChatScheduled) UnmarshalJSON ¶ added in v1.9.0
func (f *VideoChatScheduled) UnmarshalJSON(data []byte) error
func (*VideoChatScheduled) Verify ¶ added in v1.9.0
func (f *VideoChatScheduled) Verify() error
type VideoChatStarted ¶
type VideoChatStarted struct{}
VideoChatStarted represents a service message about a video chat started in the chat. Currently holds no information.
func (*VideoChatStarted) MarshalJSON ¶ added in v1.9.0
func (f *VideoChatStarted) MarshalJSON() ([]byte, error)
func (*VideoChatStarted) ReflectType ¶ added in v1.9.0
func (c *VideoChatStarted) ReflectType() string
func (*VideoChatStarted) String ¶ added in v1.9.0
func (f *VideoChatStarted) String() string
func (*VideoChatStarted) Type ¶ added in v1.9.0
func (c *VideoChatStarted) Type() string
func (*VideoChatStarted) UnmarshalJSON ¶ added in v1.9.0
func (f *VideoChatStarted) UnmarshalJSON(data []byte) error
func (*VideoChatStarted) Verify ¶ added in v1.9.0
func (f *VideoChatStarted) Verify() error
type VideoNote ¶
type VideoNote struct { // FileID is the identifier for this file, which can be used to download or reuse the file. FileID string `json:"file_id"` // FileUniqueID is a unique identifier for this file, supposed to be the same over time and for different bots. // It can't be used to download or reuse the file. FileUniqueID string `json:"file_unique_id"` // Length represents the video width and height (diameter of the video message) as defined by the sender. Length int `json:"length"` // Duration is the duration of the video in seconds as defined by the sender. Duration int `json:"duration"` // Thumbnail is an optional field representing the video thumbnail (PhotoSize). Thumbnail *PhotoSize `json:"thumbnail,omitempty"` // FileSize is an optional field representing the file size in bytes. FileSize int64 `json:"file_size,omitempty"` }
VideoNote objects represent video messages, available in Telegram apps as of v.4.0.
func (*VideoNote) MarshalJSON ¶ added in v1.9.0
func (*VideoNote) ReflectType ¶ added in v1.9.0
func (*VideoNote) UnmarshalJSON ¶ added in v1.9.0
type Voice ¶
type Voice struct { // FileID is the identifier for this file, which can be used to download or reuse the file. FileID string `json:"file_id"` // FileUniqueID is a unique identifier for this file, supposed to be the same over time and for different bots. // It can't be used to download or reuse the file. FileUniqueID string `json:"file_unique_id"` // Duration is the duration of the audio in seconds as defined by the sender. Duration int `json:"duration"` // MimeType is an optional field representing the MIME type of the file as defined by the sender. MimeType *string `json:"mime_type,omitempty"` // FileSize is an optional field representing the file size in bytes. // It can be bigger than 2^31, 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 is safe for storing this value. FileSize int64 `json:"file_size,omitempty"` }
Voice represents a voice note.
func (*Voice) MarshalJSON ¶ added in v1.9.0
func (*Voice) ReflectType ¶ added in v1.9.0
func (*Voice) UnmarshalJSON ¶ added in v1.9.0
type WebAppData ¶
type WebAppData struct { // Data is the data sent from the Web App. Be aware that a bad client can send arbitrary data in this field. Data string `json:"data"` // ButtonText is the text of the web_app keyboard button from which the Web App was opened. // Be aware that a bad client can send arbitrary data in this field. ButtonText string `json:"button_text"` }
WebAppData describes data sent from a Web App to the bot.
func (*WebAppData) MarshalJSON ¶ added in v1.9.0
func (w *WebAppData) MarshalJSON() ([]byte, error)
func (*WebAppData) ReflectType ¶ added in v1.9.0
func (w *WebAppData) ReflectType() string
func (*WebAppData) String ¶ added in v1.9.0
func (w *WebAppData) String() string
func (*WebAppData) Type ¶ added in v1.9.0
func (w *WebAppData) Type() string
func (*WebAppData) UnmarshalJSON ¶ added in v1.9.0
func (w *WebAppData) UnmarshalJSON(data []byte) error
func (*WebAppData) Verify ¶ added in v1.9.0
func (w *WebAppData) Verify() error
type WebAppInfo ¶ added in v1.9.0
type WebAppInfo struct { // URL is an HTTPS URL of a Web App to be opened with additional data as specified in Initializing Web Apps. URL string `json:"url" yaml:"url"` }
WebAppInfo describes a Web App.
func (*WebAppInfo) MarshalJSON ¶ added in v1.9.0
func (w *WebAppInfo) MarshalJSON() ([]byte, error)
func (*WebAppInfo) ReflectType ¶ added in v1.9.0
func (w *WebAppInfo) ReflectType() string
func (*WebAppInfo) String ¶ added in v1.9.0
func (w *WebAppInfo) String() string
func (*WebAppInfo) Type ¶ added in v1.9.0
func (w *WebAppInfo) Type() string
func (*WebAppInfo) UnmarshalJSON ¶ added in v1.9.0
func (w *WebAppInfo) UnmarshalJSON(data []byte) error
func (*WebAppInfo) Verify ¶ added in v1.9.0
func (w *WebAppInfo) Verify() error
type WriteAccessAllowed ¶
type WriteAccessAllowed struct { // FromRequest is an optional field indicating if the access was granted after the user accepted an explicit request from a Web App sent by the method requestWriteAccess. FromRequest *bool `json:"from_request,omitempty"` // WebAppName is an optional field representing the name of the Web App if the access was granted when the Web App was launched from a link. WebAppName *string `json:"web_app_name,omitempty"` // FromAttachmentMenu is an optional field indicating if the access was granted when the bot was added to the attachment or side menu. FromAttachmentMenu *bool `json:"from_attachment_menu,omitempty"` }
WriteAccessAllowed represents a service message about a user allowing a bot to write messages after adding it to the attachment menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method requestWriteAccess.
func (*WriteAccessAllowed) MarshalJSON ¶ added in v1.9.0
func (f *WriteAccessAllowed) MarshalJSON() ([]byte, error)
func (*WriteAccessAllowed) ReflectType ¶ added in v1.9.0
func (c *WriteAccessAllowed) ReflectType() string
func (*WriteAccessAllowed) String ¶ added in v1.9.0
func (f *WriteAccessAllowed) String() string
func (*WriteAccessAllowed) Type ¶ added in v1.9.0
func (c *WriteAccessAllowed) Type() string
func (*WriteAccessAllowed) UnmarshalJSON ¶ added in v1.9.0
func (f *WriteAccessAllowed) UnmarshalJSON(data []byte) error
func (*WriteAccessAllowed) Verify ¶ added in v1.9.0
func (f *WriteAccessAllowed) Verify() error
Source Files
¶
- animation.go
- animation_func.go
- animation_type.go
- audio.go
- audio_func.go
- audio_type.go
- auto_delete_timer_changed.go
- birthdate.go
- boosts.go
- boosts_func.go
- boosts_type.go
- business_connection.go
- business_connection_func.go
- business_connection_type.go
- business_intro.go
- business_location.go
- business_messages_deleted.go
- business_opening_hours.go
- button.go
- button_func.go
- button_type.go
- callback.go
- callback_func.go
- callback_game.go
- callback_type.go
- chat.go
- chat_action.go
- chat_action_func.go
- chat_action_type.go
- chat_boost_added.go
- chat_func.go
- chat_location.go
- chat_member.go
- chat_member_type.go
- chat_permissions.go
- chat_photo.go
- chat_shared.go
- chat_type.go
- command_type.go
- contact.go
- contact_func.go
- contact_type.go
- context.go
- context_func.go
- context_type.go
- debug.go
- dice.go
- dice_func.go
- dice_type.go
- document.go
- document_func.go
- document_type.go
- edit_message.go
- edit_message_func.go
- edit_message_type.go
- equal.go
- equal_func.go
- errors.go
- file.go
- files.go
- files_func.go
- files_type.go
- formatting_options.go
- forum.go
- forward.go
- forward_func.go
- forward_type.go
- game.go
- game_func.go
- game_type.go
- giveaway.go
- http_client.go
- http_client_type.go
- inline.go
- input_message_content.go
- invite_link.go
- invoice.go
- invoice_func.go
- invoice_type.go
- join_request.go
- json.go
- location.go
- location_func.go
- location_type.go
- login_url.go
- markup.go
- markup_type.go
- media_group.go
- media_group_func.go
- media_group_type.go
- menu.go
- message.go
- message_func.go
- message_type.go
- methods.go
- middleware.go
- options.go
- passport_data.go
- passport_func.go
- photo.go
- photo_func.go
- photo_type.go
- poll.go
- poll_answer.go
- poll_func.go
- poll_type.go
- poller.go
- proximity_alert_triggerd.go
- query.go
- query_func.go
- query_type.go
- quote.go
- reaction.go
- reaction_func.go
- reaction_type.go
- recipient.go
- reply.go
- reply_type.go
- rights.go
- schedule.go
- self.go
- self_type.go
- send.go
- shipping.go
- shipping_func.go
- shipping_type.go
- sticker.go
- sticker_func.go
- sticker_type.go
- story.go
- string.go
- successful_payment.go
- telebot.go
- telebot_type.go
- topic.go
- topic_func.go
- topic_type.go
- tt_types.go
- types.go
- update.go
- update_func.go
- update_handler.go
- update_handler_func.go
- update_type.go
- user.go
- user_func.go
- user_profile_photo.go
- user_profile_photo_func.go
- user_profile_photo_type.go
- users_shared.go
- util.go
- venue.go
- venue_func.go
- venue_type.go
- verify.go
- verify_func.go
- video.go
- video_func.go
- video_note.go
- video_note_func.go
- video_note_type.go
- video_type.go
- voice.go
- voice_func.go
- voice_type.go
- web_app.go
- web_app_func.go
- write_access_allowed.go