tgbot

package module
v0.0.0-...-f535400 Latest Latest
Warning

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

Go to latest
Published: May 25, 2018 License: MIT Imports: 13 Imported by: 0

README

tgbot

GoDoc Go Report Card Travis CI

Go language Telegram Bot API wrapper

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddStickerToSetConfig

type AddStickerToSetConfig struct {
	UserID       int           `option:"user_id"`
	Name         string        `option:"name"`
	PNGSticker   *InputFile    `option:"png_sticker"`
	Emojis       string        `option:"emojis"`
	MaskPosition *MaskPosition `option:"mask_position"`
}

AddStickerToSetConfig represents parameters for AddStickerToSet method

type Animation

type Animation struct {
	FileID   string     `json:"file_id"`
	Thumb    *PhotoSize `json:"thumb"`
	FileName string     `json:"file_name"`
	MimeType string     `json:"mime_type"`
	FileSize int        `json:"file_size"`
}

Animation represents an animation file to be displayed in the message containing a game

type AnswerCallbackQueryConfig

type AnswerCallbackQueryConfig struct {
	CallbackQueryID string `option:"callback_query_id"`
	Text            string `option:"text"`
	ShowAlert       bool   `option:"show_alert"`
	URL             string `option:"url"`
	CacheTime       int    `option:"cache_time"`
}

AnswerCallbackQueryConfig represents parameters for AnswerCallbackQuery method

type AnswerInlineQueryConfig

type AnswerInlineQueryConfig struct {
	InlineQueryID     string              `option:"inline_query_id"`
	Results           []InlineQueryResult `option:"results"`
	CacheTime         int                 `option:"cache_time"`
	IsPersonal        bool                `option:"is_personal"`
	NextOffset        string              `option:"next_offset"`
	SwitchPmText      string              `option:"switch_pm_text"`
	SwitchPmParameter string              `option:"switch_pm_parameter"`
}

AnswerInlineQueryConfig represents parameters for AnswerInlineQuery method

type Audio

type Audio struct {
	FileID    string `json:"file_id"`
	Duration  int    `json:"duration"`
	Performer string `json:"performer"`
	Title     string `json:"title"`
	MimeType  string `json:"mime_type"`
	FileSize  int    `json:"file_size"`
}

Audio represents an audio file to be treated as music by the Telegram clients

type CallbackGame

type CallbackGame struct{}

CallbackGame is a placeholder, currently holds no information. Use BotFather to set up your game.

type CallbackQuery

type CallbackQuery struct {
	ID              string   `json:"id"`
	From            *User    `json:"from"`
	Message         *Message `json:"message"`
	InlineMessageID string   `json:"inline_message_id"`
	ChatInstance    string   `json:"chat_instance"`
	Data            string   `json:"data"`
	GameShortName   string   `json:"game_short_name"`
}

CallbackQuery represents an incoming callback query from a callback button in an inline keyboard. If the button that originated the query was attached to a message sent by the bot, the field message will be present.

type Chat

type Chat struct {
	ID                          int64      `json:"id"`
	Type                        string     `json:"type"`
	Title                       string     `json:"title"`
	Username                    string     `json:"username"`
	FirstName                   string     `json:"first_name"`
	LastName                    string     `json:"last_name"`
	AllMembersAreAdministrators bool       `json:"all_members_are_administrators"`
	Photo                       *ChatPhoto `json:"photo"`
	Description                 string     `json:"description"`
	InviteLink                  string     `json:"invite_link"`
	PinnedMessage               *Message   `json:"pinned_message"`
	StickerSetName              string     `json:"sticker_set_name"`
	CanSetStickerSet            bool       `json:"can_set_sticker_set"`
}

Chat represents a chat

type ChatAction

type ChatAction struct {
	// contains filtered or unexported fields
}

ChatAction represents chat action

func ChatActionFindLocation

func ChatActionFindLocation() *ChatAction

ChatActionFindLocation creates ChatAction with "find_location" option

func ChatActionTyping

func ChatActionTyping() *ChatAction

ChatActionTyping creates ChatAction with "typing" option

func ChatActionUploadAudio

func ChatActionUploadAudio() *ChatAction

ChatActionUploadAudio creates ChatAction with "upload_audio" option

func ChatActionUploadDocument

func ChatActionUploadDocument() *ChatAction

ChatActionUploadDocument creates ChatAction with "upload_document" option

func ChatActionUploadPhoto

func ChatActionUploadPhoto() *ChatAction

ChatActionUploadPhoto creates ChatAction with "upload_photo" option

func ChatActionUploadVideo

func ChatActionUploadVideo() *ChatAction

ChatActionUploadVideo creates ChatAction with "upload_video" option

func ChatActionUploadVideoNote

func ChatActionUploadVideoNote() *ChatAction

ChatActionUploadVideoNote creates ChatAction with "upload_video_note" option

type ChatIdentifier

type ChatIdentifier struct {
	// contains filtered or unexported fields
}

ChatIdentifier represents unique identifier of chat

func ChatID

func ChatID(id int64) *ChatIdentifier

ChatID creates new ChatIdentifier by chat ID

func Username

func Username(username string) *ChatIdentifier

Username creates new ChatIdentifier by chat username

type ChatMember

type ChatMember struct {
	User                  *User  `json:"user"`
	Status                string `json:"status"`
	UntilDate             int    `json:"until_date"`
	CanBeEdited           bool   `json:"can_be_edited"`
	CanChangeInfo         bool   `json:"can_change_info"`
	CanPostMessages       bool   `json:"can_post_messages"`
	CanEditMessages       bool   `json:"can_edit_messages"`
	CanDeleteMessages     bool   `json:"can_delete_messages"`
	CanInviteUsers        bool   `json:"can_invite_users"`
	CanRestrictMembers    bool   `json:"can_restrict_members"`
	CanPinMessages        bool   `json:"can_pin_messages"`
	CanPromoteMembers     bool   `json:"can_promote_members"`
	CanSendMessages       bool   `json:"can_send_messages"`
	CanSendMediaMessages  bool   `json:"can_send_media_messages"`
	CanSendOtherMessages  bool   `json:"can_send_other_messages"`
	CanAddWebPagePreviews bool   `json:"can_add_web_page_previews"`
}

ChatMember represents information about one member of a chat

type ChatPhoto

type ChatPhoto struct {
	SmallFileID string `json:"small_file_id"`
	BigFileID   string `json:"big_file_id"`
}

ChatPhoto represents a chat photo

type ChosenInlineResult

type ChosenInlineResult struct {
	ResultID        string    `json:"result_id"`
	From            *User     `json:"from"`
	Location        *Location `json:"location"`
	InlineMessageID string    `json:"inline_message_id"`
	Query           string    `json:"query"`
}

ChosenInlineResult represents a result of an inline query that was chosen by the user and sent to their chat partner

type Contact

type Contact struct {
	PhoneNumber string `json:"phone_number"`
	FirstName   string `json:"first_name"`
	LastName    string `json:"last_name"`
	UserID      int    `json:"user_id"`
}

Contact represents a phone contact

type CreateNewStickerSetConfig

type CreateNewStickerSetConfig struct {
	UserID       int           `option:"user_id"`
	Name         string        `option:"name"`
	Title        string        `option:"title"`
	PNGSticker   *InputFile    `option:"png_sticker"`
	Emojis       string        `option:"emojis"`
	ContainsMask bool          `option:"contains_masks"`
	MaskPosition *MaskPosition `option:"mask_position"`
}

CreateNewStickerSetConfig represents parameters for CreateNewStickerSet method

type DeleteChatPhotoConfig

type DeleteChatPhotoConfig struct {
	ChatID *ChatIdentifier `option:"chat_id"`
}

DeleteChatPhotoConfig represents parameters for DeleteChatPhoto method

type DeleteStickerFromSetConfig

type DeleteStickerFromSetConfig struct {
	Sticker string `option:"sticker"`
}

DeleteStickerFromSetConfig represents parameters for DeleteStickerFromSet method

type Document

type Document struct {
	FileID   string     `json:"file_id"`
	Thumb    *PhotoSize `json:"thumb"`
	FileName string     `json:"file_name"`
	MimeType string     `json:"mime_type"`
	FileSize int        `json:"file_size"`
}

Document represents a general file (as opposed to photos, voice messages and audio files)

type EditMessageCaptionConfig

type EditMessageCaptionConfig struct {
	ChatID          *ChatIdentifier `option:"chat_id"`
	MessageID       int             `option:"message_id"`
	InlineMessageID string          `option:"inline_message_id"`
	Caption         string          `option:"caption"`
	ReplyMarkup     *ReplyMarkup    `option:"reply_markup"`
}

EditMessageCaptionConfig represents parameters for EditMessageCaption method

type EditMessageTextConfig

type EditMessageTextConfig struct {
	ChatID                *ChatIdentifier `option:"chat_id"`
	MessageID             int             `option:"message_id"`
	InlineMessageID       string          `option:"inline_message_id"`
	Text                  string          `option:"text"`
	ParseMode             *ParseMode      `option:"parse_mode"`
	DisableWebPagePreview bool            `option:"disable_web_page_preview"`
	ReplyMarkup           *ReplyMarkup    `option:"reply_markup"`
}

EditMessageTextConfig represents parameters for EditMessageText method

type ExportChatInviteLinkConfig

type ExportChatInviteLinkConfig struct {
	ChatID *ChatIdentifier `option:"chat_id"`
}

ExportChatInviteLinkConfig represents parameters for ExportChatInviteLink method

type File

type File struct {
	FileID   string `json:"file_id"`
	FileSize int    `json:"file_size"`
	FilePath string `json:"file_path"`
}

File represents a file ready to be downloaded

type ForwardMessageConfig

type ForwardMessageConfig struct {
	ChatID              *ChatIdentifier `option:"chat_id"`
	FromChatID          *ChatIdentifier `option:"from_chat_id"`
	DisableNotification bool            `option:"disable_notification"`
	MessageID           int             `option:"message_id"`
}

ForwardMessageConfig represents parameters for ForwardMessage method

type Game

type Game struct {
	Title        string           `json:"title"`
	Description  string           `json:"description"`
	Photo        []*PhotoSize     `json:"photo"`
	Text         string           `json:"text"`
	TextEntities []*MessageEntity `json:"text_entities"`
	Animation    *Animation       `json:"animation"`
}

Game represents a game. Use BotFather to create and edit games, their short names will act as unique identifiers.

type GetChatAdministratorsConfig

type GetChatAdministratorsConfig struct {
	ChatID *ChatIdentifier `option:"chat_id"`
}

GetChatAdministratorsConfig represents parameters for GetChatAdministrators method

type GetChatConfig

type GetChatConfig struct {
	ChatID *ChatIdentifier `option:"chat_id"`
}

GetChatConfig represents parameters for GetChat method

type GetChatMemberConfig

type GetChatMemberConfig struct {
	ChatID *ChatIdentifier `option:"chat_id"`
	UserID int             `option:"user_id"`
}

GetChatMemberConfig represents parameters for GetChatMember method

type GetChatMembersCountConfig

type GetChatMembersCountConfig struct {
	ChatID *ChatIdentifier `option:"chat_id"`
}

GetChatMembersCountConfig represents parameters for GetChatMembersCount method

type GetFileConfig

type GetFileConfig struct {
	FileID string `option:"file_id"`
}

GetFileConfig represents parameters for GetFile method

type GetStickerSetConfig

type GetStickerSetConfig struct {
	Name string `option:"name"`
}

GetStickerSetConfig represents parameters for GetStickerSet method

type GetUpdatesConfig

type GetUpdatesConfig struct {
	Offset  int `option:"offset"`
	Limit   int `option:"limit"`
	Timeout int `option:"timeout"`
}

GetUpdatesConfig represents parameters for GetUpdates method

type GetUserProfilePhotosConfig

type GetUserProfilePhotosConfig struct {
	UserID int `option:"user_id"`
	Offset int `option:"offset"`
	Limit  int `option:"limit"`
}

GetUserProfilePhotosConfig represents parameters for GetUserProfilePhotos method

type InlineKeyboardButton

type InlineKeyboardButton struct {
	Text                         string        `json:"text"`
	URL                          string        `json:"url"`
	CallbackData                 string        `json:"callback_data"`
	SwitchInlineQuery            string        `json:"switch_inline_query"`
	SwitchInlineQueryCurrentChat string        `json:"switch_inline_query_current_chat"`
	CallbackGame                 *CallbackGame `json:"callback_game"`
	Pay                          bool          `json:"pay"`
}

InlineKeyboardButton represents one button of an inline keyboard. You must use exactly one of the optional fields.

type InlineQuery

type InlineQuery struct {
	ID       string    `json:"id"`
	From     *User     `json:"from"`
	Location *Location `json:"location"`
	Query    string    `json:"query"`
	Offset   string    `json:"offset"`
}

InlineQuery represents an incoming inline query. When the user sends an empty query, your bot could return some default or trending results.

type InlineQueryResult

type InlineQueryResult interface {
	// contains filtered or unexported methods
}

InlineQueryResult represents one result of an inline query

type InlineQueryResultArticle

type InlineQueryResultArticle struct {
	ID                  string               `json:"id"`
	Title               string               `json:"title"`
	InputMessageContent *InputMessageContent `json:"input_message_content"`
	ReplyMarkup         *ReplyMarkup         `json:"reply_markup"`
	URL                 string               `json:"url"`
	HideURL             bool                 `json:"hide_url"`
	Description         string               `json:"description"`
	ThumbURL            string               `json:"thumb_url"`
	ThumbWidth          string               `json:"thumb_width"`
	ThumbHeight         string               `json:"thumb_height"`
}

InlineQueryResultArticle represents a link to an article or web page

type InlineQueryResultAudio

type InlineQueryResultAudio struct {
	ID                  string               `json:"id"`
	AudioURL            string               `json:"audio_url"`
	Title               string               `json:"title"`
	Caption             string               `json:"caption"`
	Performer           string               `json:"performer"`
	AudioDuration       int                  `json:"audio_duration"`
	ReplyMarkup         *ReplyMarkup         `json:"reply_markup"`
	InputMessageContent *InputMessageContent `json:"input_message_content"`
}

InlineQueryResultAudio represents a link to a voice recording in an .ogg container encoded with OPUS

type InlineQueryResultContact

type InlineQueryResultContact struct {
	ID                  string               `json:"id"`
	PhoneNumber         string               `json:"phone_number"`
	FirstName           string               `json:"first_name"`
	LastName            string               `json:"last_name"`
	ReplyMarkup         *ReplyMarkup         `json:"reply_markup"`
	InputMessageContent *InputMessageContent `json:"input_message_content"`
	ThumbURL            string               `json:"thumb_url"`
	ThumbWidth          int                  `json:"thumb_width"`
	ThumbHeight         int                  `json:"thumb_height"`
}

InlineQueryResultContact represents a contact with a phone number

type InlineQueryResultDocument

type InlineQueryResultDocument struct {
	ID                  string               `json:"id"`
	Title               string               `json:"title"`
	Caption             string               `json:"caption"`
	DocumentURL         string               `json:"document_url"`
	MimeType            string               `json:"mime_type"`
	Description         string               `json:"description"`
	ReplyMarkup         *ReplyMarkup         `json:"reply_markup"`
	InputMessageContent *InputMessageContent `json:"input_message_content"`
	ThumbURL            string               `json:"thumb_url"`
	ThumbWidth          int                  `json:"thumb_width"`
	ThumbHeight         int                  `json:"thumb_height"`
}

InlineQueryResultDocument represents a link to a file

type InlineQueryResultGame

type InlineQueryResultGame struct {
	ID            string `json:"id"`
	GameShortName string `json:"game_short_name"`
}

InlineQueryResultGame represents a Game

type InlineQueryResultGif

type InlineQueryResultGif struct {
	ID                  string               `json:"id"`
	GifURL              string               `json:"gif_url"`
	GifWidth            int                  `json:"gif_width"`
	GifHeight           int                  `json:"gif_height"`
	GifDuration         int                  `json:"gif_duration"`
	ThumbURL            string               `json:"thumb_url"`
	Title               string               `json:"title"`
	Caption             string               `json:"caption"`
	ReplyMarkup         *ReplyMarkup         `json:"reply_markup"`
	InputMessageContent *InputMessageContent `json:"input_message_content"`
}

InlineQueryResultGif represents a link to an animated GIF file

type InlineQueryResultLocation

type InlineQueryResultLocation struct {
	ID                  string               `json:"id"`
	Latitude            float64              `json:"latitude"`
	Longitude           float64              `json:"longitude"`
	Title               string               `json:"title"`
	LivePeriod          int                  `json:"live_period"`
	ReplyMarkup         *ReplyMarkup         `json:"reply_markup"`
	InputMessageContent *InputMessageContent `json:"input_message_content"`
	ThumbURL            string               `json:"thumb_url"`
	ThumbWidth          int                  `json:"thumb_width"`
	ThumbHeight         int                  `json:"thumb_height"`
}

InlineQueryResultLocation represents a location on a map

type InlineQueryResultMpeg4Gif

type InlineQueryResultMpeg4Gif struct {
	ID                  string               `json:"id"`
	Mpeg4URL            string               `json:"mpeg4_url"`
	Mpeg4Width          int                  `json:"mpeg4_width"`
	Mpeg4Height         int                  `json:"mpeg4_height"`
	Mpeg4Duration       int                  `json:"mpeg4_duration"`
	ThumbURL            string               `json:"thumb_url"`
	Title               string               `json:"title"`
	Caption             string               `json:"caption"`
	ReplyMarkup         *ReplyMarkup         `json:"reply_markup"`
	InputMessageContent *InputMessageContent `json:"input_message_content"`
}

InlineQueryResultMpeg4Gif represents a link to a video animation (H.264/MPEG-4 AVC video without sound)

type InlineQueryResultPhoto

type InlineQueryResultPhoto struct {
	ID                  string               `json:"id"`
	PhotoURL            string               `json:"photo_url"`
	ThumbURL            string               `json:"thumb_url"`
	PhotoWidth          int                  `json:"photo_width"`
	PhotoHeight         int                  `json:"photo_height"`
	Title               string               `json:"title"`
	Description         string               `json:"description"`
	Caption             string               `json:"caption"`
	ReplyMarkup         *ReplyMarkup         `json:"reply_markup"`
	InputMessageContent *InputMessageContent `json:"input_message_content"`
}

InlineQueryResultPhoto represents a link to a photo

type InlineQueryResultVenue

type InlineQueryResultVenue struct {
	ID                  string               `json:"id"`
	Latitude            float64              `json:"latitude"`
	Longitude           float64              `json:"longitude"`
	Title               string               `json:"title"`
	Address             string               `json:"address"`
	FoursquareID        string               `json:"foursquare_id"`
	ReplyMarkup         *ReplyMarkup         `json:"reply_markup"`
	InputMessageContent *InputMessageContent `json:"input_message_content"`
	ThumbURL            string               `json:"thumb_url"`
	ThumbWidth          int                  `json:"thumb_width"`
	ThumbHeight         int                  `json:"thumb_height"`
}

InlineQueryResultVenue represents a venue

type InlineQueryResultVideo

type InlineQueryResultVideo struct {
	ID                  string               `json:"id"`
	VideoURL            string               `json:"video_url"`
	MimeType            string               `json:"mime_type"`
	ThumbURL            string               `json:"thumb_url"`
	Title               string               `json:"title"`
	Caption             string               `json:"caption"`
	VideoWidth          int                  `json:"video_width"`
	VideoHeight         int                  `json:"video_height"`
	VideoDuration       int                  `json:"video_duration"`
	Description         string               `json:"description"`
	ReplyMarkup         *ReplyMarkup         `json:"reply_markup"`
	InputMessageContent *InputMessageContent `json:"input_message_content"`
}

InlineQueryResultVideo represents a link to a page containing an embedded video player or a video file

type InlineQueryResultVoice

type InlineQueryResultVoice struct {
	ID                  string               `json:"id"`
	VoiceURL            string               `json:"voice_url"`
	Title               string               `json:"title"`
	Caption             string               `json:"caption"`
	VoiceDuration       int                  `json:"voice_duration"`
	ReplyMarkup         *ReplyMarkup         `json:"reply_markup"`
	InputMessageContent *InputMessageContent `json:"input_message_content"`
}

InlineQueryResultVoice represents a link to a voice recording in an .ogg container encoded with OPUS

type InputContactMessageContent

type InputContactMessageContent struct {
	InputMessageContent
	PhoneNumber string `json:"phone_number"`
	FirstName   string `json:"first_name"`
	LastName    string `json:"last_name"`
}

InputContactMessageContent represents the content of a contact message to be sent as the result of an inline query

type InputFile

type InputFile struct {
	// contains filtered or unexported fields
}

InputFile represents file to send

func FileBytes

func FileBytes(fileData []byte, filename string) *InputFile

FileBytes creates new InputFile by array of bytes and filename

func FileID

func FileID(fileID string) *InputFile

FileID creates new InputFile by file id

func FilePath

func FilePath(filePath string) *InputFile

FilePath creates new InputFile by file path

type InputLocationMessageContent

type InputLocationMessageContent struct {
	Latitude   float64 `json:"latitude"`
	Longitude  float64 `json:"longitude"`
	LivePeriod int     `json:"live_period"`
}

InputLocationMessageContent represents the content of a location message to be sent as the result of an inline query

type InputMessageContent

type InputMessageContent interface {
	// contains filtered or unexported methods
}

InputMessageContent represents the content of a message to be sent as a result of an inline query

type InputTextMessageContent

type InputTextMessageContent struct {
	MessageText           string `json:"message_text"`
	ParseMode             string `json:"parse_mode"`
	DisableWebPagePreview bool   `json:"disable_web_page_preview"`
}

InputTextMessageContent represents the content of a text message to be sent as the result of an inline query

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"`
}

InputVenueMessageContent represents the content of a venue message to be sent as the result of an inline query

type Invoice

type Invoice struct {
	Title          string `json:"title"`
	Description    string `json:"description"`
	StartParameter string `json:"start_parameter"`
	Currency       string `json:"currency"`
	TotalAmount    int    `json:"total_amount"`
}

Invoice contains basic information about a invoice

type KeyboardButton

type KeyboardButton struct {
	Text            string `json:"text"`
	RequestContact  bool   `json:"request_contact"`
	RequestLocation bool   `json:"request_location"`
}

KeyboardButton represents one button of the reply keyboard

type KickChatMemberConfig

type KickChatMemberConfig struct {
	ChatID    *ChatIdentifier `option:"chat_id"`
	UserID    int             `option:"user_id"`
	UntilDate int             `option:"until_date"`
}

KickChatMemberConfig represents parameters for KickChatMember method

type LeaveChatConfig

type LeaveChatConfig struct {
	ChatID *ChatIdentifier `option:"chat_id"`
}

LeaveChatConfig represents parameters for LeaveChat method

type ListenConfig

type ListenConfig struct {
	Callback       func([]Update)
	Host           string
	Port           uint16
	KeyFilename    string
	CertFilename   string
	MaxConnections int
	AllowedUpdates []string
}

ListenConfig represents bot's webhook configuration

type Location

type Location struct {
	Longitude float32 `json:"longitude"`
	Latitude  float32 `json:"latitude"`
}

Location represents a point on the map

type MaskPosition

type MaskPosition struct {
	Point  string  `json:"point"`
	XShift float32 `json:"x_shift"`
	YShift float32 `json:"y_shift"`
	Scale  float32 `json:"scale"`
}

MaskPosition describes the position on faces where a mask should be placed by default. TODO: Turn it into a method.

type Message

type Message struct {
	MessageID             int                `json:"message_id"`
	From                  *User              `json:"from"`
	Date                  int                `json:"date"`
	Chat                  *Chat              `json:"chat"`
	ForwardFrom           *User              `json:"forward_from"`
	ForwardFromChat       *Chat              `json:"forward_from_chat"`
	ForwardFromMessageID  int                `json:"forward_from_message_id"`
	ForwardSignature      string             `json:"forward_signature"`
	ForwardDate           int                `json:"forward_date"`
	ReplyToMessage        *Message           `json:"reply_to_message"`
	EditDate              int                `json:"edit_date"`
	MediaGroupID          string             `json:"media_group_id"`
	AuthorSignature       string             `json:"author_signature"`
	Text                  string             `json:"text"`
	Entities              []*MessageEntity   `json:"entities"`
	CaptionEntities       []*MessageEntity   `json:"caption_entities"`
	Audio                 *Audio             `json:"audio"`
	Document              *Document          `json:"document"`
	Game                  *Game              `json:"game"`
	Photo                 []*PhotoSize       `json:"photo"`
	Sticker               *Sticker           `json:"sticker"`
	Video                 *Video             `json:"video"`
	Voice                 *Voice             `json:"voice"`
	VideoNote             *VideoNote         `json:"video_note"`
	Caption               string             `json:"caption"`
	Contact               *Contact           `json:"contact"`
	Location              *Location          `json:"location"`
	Venue                 *Venue             `json:"venue"`
	NewChatMembers        []*User            `json:"new_chat_members"`
	LeftChatMember        *User              `json:"left_chat_member"`
	NewChatTitle          string             `json:"new_chat_title"`
	NewChatPhoto          []*PhotoSize       `json:"new_chat_photo"`
	DeleteChatPhoto       bool               `json:"delete_chat_photo"`
	GroupChatCreated      bool               `json:"group_chat_created"`
	SupergroupChatCreated bool               `json:"supergroup_chat_created"`
	ChannelChatCreated    bool               `json:"channel_chat_created"`
	MigrateToChatID       int64              `json:"migrate_to_chat_id"`
	MigrateFromChatID     int64              `json:"migrate_from_chat_id"`
	PinnedMessage         *Message           `json:"pinned_message"`
	Invoice               *Invoice           `json:"invoice"`
	SuccessfulPayment     *SuccessfulPayment `json:"successful_payment"`
}

Message represents a message

type MessageEntity

type MessageEntity struct {
	Type   string `json:"type"`
	Offset int    `json:"offset"`
	Length int    `json:"length"`
	URL    string `json:"url"`
	User   *User  `json:"user"`
}

MessageEntity represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.

type OrderInfo

type OrderInfo struct {
	Name            string           `json:"name"`
	PhoneNumber     string           `json:"phone_number"`
	Email           string           `json:"email"`
	ShippingAddress *ShippingAddress `json:"shipping_address"`
}

OrderInfo represents information about an order

type ParseMode

type ParseMode struct {
	// contains filtered or unexported fields
}

ParseMode represents message parse mode

func ParseModeHTML

func ParseModeHTML() *ParseMode

ParseModeHTML creates new ParseMode with HTML option

func ParseModeMarkdown

func ParseModeMarkdown() *ParseMode

ParseModeMarkdown creates new ParseMode with Markdown option

type PhotoSize

type PhotoSize struct {
	FileID   string `json:"file_id"`
	Width    int    `json:"width"`
	Height   int    `json:"height"`
	FileSize int    `json:"file_size"`
}

PhotoSize represents one size of a photo or a file / sticker thumbnail

type PinChatMessageConfig

type PinChatMessageConfig struct {
	ChatID              *ChatIdentifier `option:"chat_id"`
	MessageID           int             `option:"message_id"`
	DisableNotification bool            `option:"disable_notification"`
}

PinChatMessageConfig represents parameters for PinChatMessage method

type PollConfig

type PollConfig struct {
	Callback func([]Update)
	Delay    int
}

PollConfig represents bot's polling configuration

type PreCheckoutQuery

type PreCheckoutQuery struct {
	ID               string     `json:"id"`
	From             *User      `json:"from"`
	Currency         string     `json:"currency"`
	TotalAmount      int        `json:"total_amount"`
	InvoicePayload   string     `json:"invoice_payload"`
	ShippingOptionID string     `json:"shipping_option_id"`
	OrderInfo        *OrderInfo `json:"order_info"`
}

PreCheckoutQuery represents information about an incoming pre-checkout query

type PromoteChatMemberConfig

type PromoteChatMemberConfig struct {
	ChatID             *ChatIdentifier `option:"chat_id"`
	UserID             int             `option:"user_id"`
	CanChangeInfo      bool            `option:"can_change_info"`
	CanPostMessages    bool            `option:"can_post_messages"`
	CanEditMessages    bool            `option:"can_edit_messages"`
	CanDeleteMessages  bool            `option:"can_delete_messages"`
	CanInviteUsers     bool            `option:"can_invite_users"`
	CanRestrictMembers bool            `option:"can_restrict_members"`
	CanPinMessages     bool            `option:"can_pin_messages"`
	CanPromoteMembers  bool            `option:"can_promote_members"`
}

PromoteChatMemberConfig represents parameters for PromoteChatMember method

type ReplyKeyboardMarkupConfig

type ReplyKeyboardMarkupConfig struct {
	Keyboard        [][]KeyboardButton `json:"keyboard"`
	ResizeKeyboard  bool               `json:"resize_keyboard,omitempty"`
	OneTimeKeyboard bool               `json:"one_time_keyboard,omitempty"`
	Selective       bool               `json:"selective,omitempty"`
}

ReplyKeyboardMarkupConfig represents parameters for ReplyKeyboardMarkup method

type ReplyMarkup

type ReplyMarkup struct {
	// contains filtered or unexported fields
}

ReplyMarkup represents message reply markup

func ForceReply

func ForceReply() *ReplyMarkup

ForceReply shows reply interface to user, as if they manually selected the bot‘s message and tapped ’Reply'

func ForceReplySelective

func ForceReplySelective() *ReplyMarkup

ForceReplySelective selectively shows reply interface to user, as if they manually selected the bot‘s message and tapped ’Reply'

func InlineKeyboardMarkup

func InlineKeyboardMarkup(inlineKeyboard [][]InlineKeyboardButton) *ReplyMarkup

InlineKeyboardMarkup represents an inline keyboard that appears right next to the message it belongs to

func ReplyKeyboardMarkup

func ReplyKeyboardMarkup(config ReplyKeyboardMarkupConfig) *ReplyMarkup

ReplyKeyboardMarkup represents a custom keyboard with reply options

func ReplyKeyboardRemove

func ReplyKeyboardRemove() *ReplyMarkup

ReplyKeyboardRemove represents reply markup with removal option

func ReplyKeyboardRemoveSelective

func ReplyKeyboardRemoveSelective() *ReplyMarkup

ReplyKeyboardRemoveSelective represents reply markup with selective removal option

type RestrictChatMemberConfig

type RestrictChatMemberConfig struct {
	ChatID                *ChatIdentifier `option:"chat_id"`
	UserID                int             `option:"user_id"`
	UntilDate             int             `option:"until_date"`
	CanSendMessages       bool            `option:"can_send_messages"`
	CanSendMediaMessages  bool            `option:"can_send_media_messages"`
	CanSendOtherMessages  bool            `option:"can_send_other_messages"`
	CanAddWebPagePreviews bool            `option:"can_add_web_page_previews"`
}

RestrictChatMemberConfig represents parameters for RestrictChatMember method

type SendAudioConfig

type SendAudioConfig struct {
	ChatID              *ChatIdentifier `option:"chat_id"`
	Audio               *InputFile      `option:"audio"`
	Caption             string          `option:"caption"`
	Duration            int             `option:"duration"`
	Performer           string          `option:"performer"`
	Title               string          `option:"title"`
	DisableNotification bool            `option:"disable_notification"`
	ReplyToMessageID    int             `option:"reply_to_message_id"`
	ReplyMarkup         *ReplyMarkup    `option:"reply_markup"`
}

SendAudioConfig represents parameters for SendAudio method

type SendChatActionConfig

type SendChatActionConfig struct {
	ChatID *ChatIdentifier `option:"chat_id"`
	Action *ChatAction     `option:"action"`
}

SendChatActionConfig represents parameters for SendChatAction method

type SendContactConfig

type SendContactConfig struct {
	ChatID              *ChatIdentifier `option:"chat_id"`
	PhoneNumber         string          `option:"phone_number"`
	FirstName           string          `option:"first_name"`
	LastName            string          `option:"last_name"`
	DisableNotification bool            `option:"disable_notification"`
	ReplyToMessageID    int             `option:"reply_to_message_id"`
	ReplyMarkup         *ReplyMarkup    `option:"reply_markup"`
}

SendContactConfig represents parameters for SendContact method

type SendDocumentConfig

type SendDocumentConfig struct {
	ChatID              *ChatIdentifier `option:"chat_id"`
	Document            *InputFile      `option:"document"`
	Caption             string          `option:"caption"`
	DisableNotification bool            `option:"disable_notification"`
	ReplyToMessageID    int             `option:"reply_to_message_id"`
	ReplyMarkup         *ReplyMarkup    `option:"reply_markup"`
}

SendDocumentConfig represents parameters for SendDocument method

type SendLocationConfig

type SendLocationConfig struct {
	ChatID              *ChatIdentifier `option:"chat_id"`
	Latitude            float64         `option:"latitude"`
	Longitude           float64         `option:"longitude"`
	DisableNotification bool            `option:"disable_notification"`
	ReplyToMessageID    int             `option:"reply_to_message_id"`
	ReplyMarkup         *ReplyMarkup    `option:"reply_markup"`
}

SendLocationConfig represents parameters for SendLocation method

type SendMessageConfig

type SendMessageConfig struct {
	ChatID                *ChatIdentifier `option:"chat_id"`
	Text                  string          `option:"text"`
	ParseMode             *ParseMode      `option:"parse_mode"`
	DisableWebPagePreview bool            `option:"disable_web_page_preview"`
	DisableNotification   bool            `option:"disable_notification"`
	ReplyToMessageID      int             `option:"reply_to_message_id"`
	ReplyMarkup           *ReplyMarkup    `option:"reply_markup"`
}

SendMessageConfig represents parameters for SendMessage method

type SendPhotoConfig

type SendPhotoConfig struct {
	ChatID              *ChatIdentifier `option:"chat_id"`
	Photo               *InputFile      `option:"photo"`
	Caption             string          `option:"caption"`
	DisableNotification bool            `option:"disable_notification"`
	ReplyToMessageID    int             `option:"reply_to_message_id"`
	ReplyMarkup         *ReplyMarkup    `option:"reply_markup"`
}

SendPhotoConfig represents parameters for SendPhoto method

type SendStickerConfig

type SendStickerConfig struct {
	ChatID              *ChatIdentifier `option:"chat_id"`
	Sticker             *InputFile      `option:"sticker"`
	DisableNotification bool            `option:"disable_notification"`
	ReplyToMessageID    int             `option:"reply_to_message_id"`
	ReplyMarkup         *ReplyMarkup    `option:"reply_markup"`
}

SendStickerConfig represents parameters for SendSticker method

type SendVenueConfig

type SendVenueConfig struct {
	ChatID              *ChatIdentifier `option:"chat_id"`
	Latitude            float64         `option:"latitude"`
	Longitude           float64         `option:"longitude"`
	Title               string          `option:"title"`
	Address             string          `option:"address"`
	FoursquareID        string          `option:"foursquare_id"`
	DisableNotification bool            `option:"disable_notification"`
	ReplyToMessageID    int             `option:"reply_to_message_id"`
	ReplyMarkup         *ReplyMarkup    `option:"reply_markup"`
}

SendVenueConfig represents parameters for SendVenue method

type SendVideoConfig

type SendVideoConfig struct {
	ChatID              *ChatIdentifier `option:"chat_id"`
	Video               *InputFile      `option:"video"`
	Duration            int             `option:"duration"`
	Width               int             `option:"width"`
	Height              int             `option:"height"`
	Caption             string          `option:"caption"`
	DisableNotification bool            `option:"disable_notification"`
	ReplyToMessageID    int             `option:"reply_to_message_id"`
	ReplyMarkup         *ReplyMarkup    `option:"reply_markup"`
}

SendVideoConfig represents parameters for SendVideo method

type SendVideoNoteConfig

type SendVideoNoteConfig struct {
	ChatID              *ChatIdentifier `option:"chat_id"`
	VideoNote           *InputFile      `option:"video_note"`
	Duration            int             `option:"duration"`
	Length              int             `option:"length"`
	Caption             string          `option:"caption"`
	DisableNotification bool            `option:"disable_notification"`
	ReplyToMessageID    int             `option:"reply_to_message_id"`
	ReplyMarkup         *ReplyMarkup    `option:"reply_markup"`
}

SendVideoNoteConfig represents parameters for SendVideoNote method

type SendVoiceConfig

type SendVoiceConfig struct {
	ChatID              *ChatIdentifier `option:"chat_id"`
	Voice               *InputFile      `option:"voice"`
	Duration            int             `option:"duration"`
	Caption             string          `option:"caption"`
	DisableNotification bool            `option:"disable_notification"`
	ReplyToMessageID    int             `option:"reply_to_message_id"`
	ReplyMarkup         *ReplyMarkup    `option:"reply_markup"`
}

SendVoiceConfig represents parameters for SendVoice method

type SetChatDescriptionConfig

type SetChatDescriptionConfig struct {
	ChatID      *ChatIdentifier `option:"chat_id"`
	Description string          `option:"description"`
}

SetChatDescriptionConfig represents parameters for SetChatDescription method

type SetChatPhotoConfig

type SetChatPhotoConfig struct {
	ChatID *ChatIdentifier `option:"chat_id"`
	Photo  *InputFile      `option:"photo"`
}

SetChatPhotoConfig represents parameters for SetChatPhoto method

type SetChatTitleConfig

type SetChatTitleConfig struct {
	ChatID *ChatIdentifier `option:"chat_id"`
	Title  string          `option:"title"`
}

SetChatTitleConfig represents parameters for SetChatTitle method

type SetStickerPositionInSetConfig

type SetStickerPositionInSetConfig struct {
	Sticker  string `option:"sticker"`
	Position int    `option:"position"`
}

SetStickerPositionInSetConfig represents parameters for SetStickerPositionInSet method

type SetWebhookConfig

type SetWebhookConfig struct {
	URL            string     `option:"url"`
	Certificate    *InputFile `option:"certificate"`
	MaxConnections int        `option:"max_connections"`
	AllowedUpdates []string   `option:"allowed_updates"`
}

SetWebhookConfig represents parameters for SetWebhook method

type ShippingAddress

type ShippingAddress struct {
	CountryCode string `json:"country_code"`
	State       string `json:"state"`
	City        string `json:"city"`
	StreetLine1 string `json:"street_line1"`
	StreetLine2 string `json:"street_line2"`
	PostCode    string `json:"post_code"`
}

ShippingAddress represents a shipping address

type ShippingQuery

type ShippingQuery struct {
	ID              string           `json:"id"`
	From            *User            `json:"from"`
	InvoicePayload  string           `json:"invoice_payload"`
	ShippingAddress *ShippingAddress `json:"shipping_address"`
}

ShippingQuery represents a shipping address

type Sticker

type Sticker struct {
	FileID       string        `json:"file_id"`
	Width        int           `json:"width"`
	Height       int           `json:"height"`
	Thumb        *PhotoSize    `json:"thumb"`
	Emoji        string        `json:"emoji"`
	SetName      string        `json:"set_name"`
	MaskPosition *MaskPosition `json:"mask_position"`
	FileSize     int           `json:"file_size"`
}

Sticker represents a sticker

type StickerSet

type StickerSet struct {
	Name          string     `json:"name"`
	Title         string     `json:"title"`
	ContainsMasks bool       `json:"contains_masks"`
	Stickers      []*Sticker `json:"stickers"`
}

StickerSet represents a sticker set

type SuccessfulPayment

type SuccessfulPayment struct {
	Currency                string     `json:"currency"`
	TotalAmount             int        `json:"total_amount"`
	InvoicePayload          string     `json:"invoice_payload"`
	ShippingOptionID        string     `json:"shipping_option_id"`
	OrderInfo               *OrderInfo `json:"order_info"`
	TelegramPaymentChargeID string     `json:"telegram_payment_charge_id"`
	ProviderPaymentChargeID string     `json:"provider_payment_charge_id"`
}

SuccessfulPayment contains basic information about a successful payment

type TelegramBot

type TelegramBot struct {
	// contains filtered or unexported fields
}

TelegramBot allows to interact with Telegram Bot API

func New

func New(apiKey string) (TelegramBot, error)

New returns a new TelegramBot instance

func (TelegramBot) AddStickerToSet

func (b TelegramBot) AddStickerToSet(config AddStickerToSetConfig) (success bool, err error)

AddStickerToSet allows to add a new sticker to a set created by the bot

func (TelegramBot) AnswerCallbackQuery

func (b TelegramBot) AnswerCallbackQuery(config AnswerCallbackQueryConfig) (success bool, err error)

AnswerCallbackQuery allows to send answers to callback query

func (TelegramBot) AnswerInlineQuery

func (b TelegramBot) AnswerInlineQuery(config AnswerInlineQueryConfig) (success bool, err error)

AnswerInlineQuery allows to send answers to the inline query

func (TelegramBot) CreateNewStickerSet

func (b TelegramBot) CreateNewStickerSet(config CreateNewStickerSetConfig) (success bool, err error)

CreateNewStickerSet allows to create new sticker set owned by a user

func (TelegramBot) DeleteChatPhoto

func (b TelegramBot) DeleteChatPhoto(config DeleteChatPhotoConfig) (success bool, err error)

DeleteChatPhoto allows to delete a new profile photo for the chat

func (TelegramBot) DeleteStickerFromSet

func (b TelegramBot) DeleteStickerFromSet(config DeleteStickerFromSetConfig) (success bool, err error)

DeleteStickerFromSet allows to delete a sticker from a set created by the bot

func (TelegramBot) DeleteWebhook

func (b TelegramBot) DeleteWebhook() (success bool, err error)

DeleteWebhook used to remove webhook integration

func (TelegramBot) EditMessageCaption

func (b TelegramBot) EditMessageCaption(config EditMessageCaptionConfig) (message Message, err error)

EditMessageCaption allows to edit captions of messages sent by the bot or via the bot (for inline bots)

func (TelegramBot) EditMessageText

func (b TelegramBot) EditMessageText(config EditMessageTextConfig) (message Message, err error)

EditMessageText allows to edit text and game messages sent by the bot or via the bot (for inline bots)

func (b TelegramBot) ExportChatInviteLink(config ExportChatInviteLinkConfig) (link string, err error)

ExportChatInviteLink allows to export an invite link to a supergroup or a channel

func (TelegramBot) ForwardMessage

func (b TelegramBot) ForwardMessage(config ForwardMessageConfig) (message Message, err error)

ForwardMessage re-sends message of any type

func (TelegramBot) GetChat

func (b TelegramBot) GetChat(config GetChatConfig) (chat Chat, err error)

GetChat allows to get up to date information about the chat

func (TelegramBot) GetChatAdministrators

func (b TelegramBot) GetChatAdministrators(config GetChatAdministratorsConfig) (members []ChatMember, err error)

GetChatAdministrators allows to get a list of administrators in a chat

func (TelegramBot) GetChatMember

func (b TelegramBot) GetChatMember(config GetChatMemberConfig) (member ChatMember, err error)

GetChatMember allows to get information about a member of a chat

func (TelegramBot) GetChatMembersCount

func (b TelegramBot) GetChatMembersCount(config GetChatMembersCountConfig) (count int, err error)

GetChatMembersCount allows get the number of members in a chat

func (TelegramBot) GetFile

func (b TelegramBot) GetFile(config GetFileConfig) (file File, err error)

GetFile allows to get basic info about a file and prepare it for downloading

func (TelegramBot) GetMe

func (b TelegramBot) GetMe() (user User, err error)

GetMe returns basic information about the bot

func (TelegramBot) GetStickerSet

func (b TelegramBot) GetStickerSet(config GetStickerSetConfig) (stickerSet StickerSet, err error)

GetStickerSet allows to get a sticker set

func (TelegramBot) GetUpdates

func (b TelegramBot) GetUpdates(config GetUpdatesConfig) (updates []Update, err error)

GetUpdates allows to get new updates

func (TelegramBot) GetUserProfilePhotos

func (b TelegramBot) GetUserProfilePhotos(config GetUserProfilePhotosConfig) (photos UserProfilePhotos, err error)

GetUserProfilePhotos returns user profile photos

func (TelegramBot) GetWebhookInfo

func (b TelegramBot) GetWebhookInfo() (info WebhookInfo, err error)

GetWebhookInfo user to get current webhook status

func (TelegramBot) KickChatMember

func (b TelegramBot) KickChatMember(config KickChatMemberConfig) (success bool, err error)

KickChatMember allows to kick user from a group, a supergroup or a channel

func (TelegramBot) LeaveChat

func (b TelegramBot) LeaveChat(config LeaveChatConfig) (success bool, err error)

LeaveChat allows to leave a group, supergroup or channel

func (*TelegramBot) Listen

func (b *TelegramBot) Listen(config ListenConfig) error

Listen starts HTTPS server to receive updates

func (TelegramBot) PinChatMessage

func (b TelegramBot) PinChatMessage(config PinChatMessageConfig) (success bool, err error)

PinChatMessage allows to pin a message in a supergroup

func (*TelegramBot) Poll

func (b *TelegramBot) Poll(config PollConfig) error

Poll starts updates polling

func (TelegramBot) PromoteChatMember

func (b TelegramBot) PromoteChatMember(config PromoteChatMemberConfig) (success bool, err error)

PromoteChatMember allows to promote or demote a user in a supergroup or a channel

func (TelegramBot) RestrictChatMember

func (b TelegramBot) RestrictChatMember(config RestrictChatMemberConfig) (success bool, err error)

RestrictChatMember allows to restrict a user in a supergroup

func (TelegramBot) SendAudio

func (b TelegramBot) SendAudio(config SendAudioConfig) (message Message, err error)

SendAudio sends audio message

func (TelegramBot) SendChatAction

func (b TelegramBot) SendChatAction(config SendChatActionConfig) (success bool, err error)

SendChatAction sends phone contact

func (TelegramBot) SendContact

func (b TelegramBot) SendContact(config SendContactConfig) (message Message, err error)

SendContact sends phone contact

func (TelegramBot) SendDocument

func (b TelegramBot) SendDocument(config SendDocumentConfig) (message Message, err error)

SendDocument sends document message

func (TelegramBot) SendLocation

func (b TelegramBot) SendLocation(config SendLocationConfig) (message Message, err error)

SendLocation sends location message

func (TelegramBot) SendMessage

func (b TelegramBot) SendMessage(config SendMessageConfig) (message Message, err error)

SendMessage sends text message

func (TelegramBot) SendPhoto

func (b TelegramBot) SendPhoto(config SendPhotoConfig) (message Message, err error)

SendPhoto sends photo message

func (TelegramBot) SendSticker

func (b TelegramBot) SendSticker(config SendStickerConfig) (message Message, err error)

SendSticker sends sticker

func (TelegramBot) SendVenue

func (b TelegramBot) SendVenue(config SendVenueConfig) (message Message, err error)

SendVenue sends information about a venue

func (TelegramBot) SendVideo

func (b TelegramBot) SendVideo(config SendVideoConfig) (message Message, err error)

SendVideo sends video message

func (TelegramBot) SendVideoNote

func (b TelegramBot) SendVideoNote(config SendVideoNoteConfig) (message Message, err error)

SendVideoNote sends video note message

func (TelegramBot) SendVoice

func (b TelegramBot) SendVoice(config SendVoiceConfig) (message Message, err error)

SendVoice sends voice note message

func (TelegramBot) SetChatDescription

func (b TelegramBot) SetChatDescription(config SetChatDescriptionConfig) (success bool, err error)

SetChatDescription allows to change the description of a chat

func (TelegramBot) SetChatPhoto

func (b TelegramBot) SetChatPhoto(config SetChatPhotoConfig) (success bool, err error)

SetChatPhoto allows to set a new profile photo for the chat

func (TelegramBot) SetChatTitle

func (b TelegramBot) SetChatTitle(config SetChatTitleConfig) (success bool, err error)

SetChatTitle allows to change the title of a chat

func (TelegramBot) SetStickerPositionInSet

func (b TelegramBot) SetStickerPositionInSet(config SetStickerPositionInSetConfig) (success bool, err error)

SetStickerPositionInSet allows to move a sticker in a set created by the bot to a specific position

func (TelegramBot) SetWebhook

func (b TelegramBot) SetWebhook(config SetWebhookConfig) (success bool, err error)

SetWebhook used to specify url and receive incoming updates via an outgoing webhook

func (TelegramBot) UnbanChatMember

func (b TelegramBot) UnbanChatMember(config UnbanChatMemberConfig) (success bool, err error)

UnbanChatMember allows to unban user from a group, a supergroup or a channel

func (TelegramBot) UnpinChatMessage

func (b TelegramBot) UnpinChatMessage(config UnpinChatMessageConfig) (success bool, err error)

UnpinChatMessage allows to unpin a message in a supergroup

func (TelegramBot) UploadStickerFile

func (b TelegramBot) UploadStickerFile(config UploadStickerFileConfig) (file File, err error)

UploadStickerFile allows to upload a .png file with a sticker for later use in CreateNewStickerSet and AddStickerToSet methods

type UnbanChatMemberConfig

type UnbanChatMemberConfig struct {
	ChatID *ChatIdentifier `option:"chat_id"`
	UserID int             `option:"user_id"`
}

UnbanChatMemberConfig represents parameters for KickChatMember method

type UnpinChatMessageConfig

type UnpinChatMessageConfig struct {
	ChatID *ChatIdentifier `option:"chat_id"`
}

UnpinChatMessageConfig represents parameters for UnpinChatMessage method

type Update

type Update struct {
	UpdateID           int                 `json:"update_id"`
	Message            *Message            `json:"message"`
	EditedMessage      *Message            `json:"edited_message"`
	ChannelPost        *Message            `json:"channel_post"`
	EditedChannelPost  *Message            `json:"edited_channel_post"`
	InlineQuery        *InlineQuery        `json:"inline_query"`
	ChosenInlineResult *ChosenInlineResult `json:"chosen_inline_result"`
	CallbackQuery      *CallbackQuery      `json:"callback_query"`
	ShippingQuery      *ShippingQuery      `json:"shipping_query"`
	PreCheckoutQuery   *PreCheckoutQuery   `json:"pre_checkout_query"`
}

Update represents an incoming update

type UploadStickerFileConfig

type UploadStickerFileConfig struct {
	UserID     int        `option:"user_id"`
	PNGSticker *InputFile `option:"png_sticker"`
}

UploadStickerFileConfig represents parameters for UploadStickerFile method

type User

type User struct {
	ID           int    `json:"id"`
	IsBot        bool   `json:"is_bot"`
	FirstName    string `json:"first_name"`
	LastName     string `json:"last_name"`
	Username     string `json:"username"`
	LanguageCode string `json:"language_code"`
}

User represents a user

type UserProfilePhotos

type UserProfilePhotos struct {
	TotalCount int            `json:"total_count"`
	Photos     [][]*PhotoSize `json:"photos"`
}

UserProfilePhotos represents a user's profile pictures

type Venue

type Venue struct {
	Location     *Location `json:"location"`
	Title        string    `json:"title"`
	Address      string    `json:"address"`
	FoursquareID string    `json:"foursquare_id"`
}

Venue represents a venue

type Video

type Video struct {
	FileID   string     `json:"file_id"`
	Width    int        `json:"width"`
	Height   int        `json:"height"`
	Duration int        `json:"duration"`
	Thumb    *PhotoSize `json:"thumb"`
	MimeType string     `json:"mime_type"`
	FileSize int        `json:"file_size"`
}

Video represents a video file

type VideoNote

type VideoNote struct {
	FileID   string     `json:"file_id"`
	Length   int        `json:"length"`
	Duration int        `json:"duration"`
	Thumb    *PhotoSize `json:"thumb"`
	FileSize int        `json:"file_size"`
}

VideoNote represents a video message

type Voice

type Voice struct {
	FileID   string `json:"file_id"`
	Duration int    `json:"duration"`
	MimeType string `json:"mime_type"`
	FileSize int    `json:"file_size"`
}

Voice represents a voice note

type WebhookInfo

type WebhookInfo struct {
	URL                  string   `json:"url"`
	HasCustomCertificate bool     `json:"has_custom_certificate"`
	PendingUpdateCount   int      `json:"pending_update_count"`
	LastErrorDate        int      `json:"last_error_date"`
	LastErrorMessage     string   `json:"last_error_message"`
	MaxConnections       int      `json:"max_connections"`
	AllowedUpdates       []string `json:"allowed_updates"`
}

WebhookInfo contains information about the current status of a webhook

Jump to

Keyboard shortcuts

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