telegram

package
v0.0.0-...-8e049b4 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Animation

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

type AnimationSender

type AnimationSender interface {
	SendAnimation(SendAnimationRequest) (*Message, error)
}

type AnswerCallbackQueryRequest

type AnswerCallbackQueryRequest struct {
	CallbackQueryID string `json:"callback_query_id"`
	Text            string `json:"text,omitempty"`
	ShowAlert       bool   `json:"show_alert,omitempty"`
	Url             string `json:"url,omitempty"`
	CacheTime       int    `json:"cache_time,omitempty"`
}

type AnswerInlineQueryRequest

type AnswerInlineQueryRequest struct {
	InlineQueryId     string        `json:"inline_query_id"`
	Results           []interface{} `json:"results"`
	CacheTime         int           `json:"cache_time"`
	IsPersonal        bool          `json:"is_personal"`
	NextOffset        string        `json:"next_offset"`
	SwitchPmText      string        `json:"switch_pm_text"`
	SwitchPmParameter string        `json:"switch_pm_parameter"`
}

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"`
	Thumb     *PhotoSize `json:"thumb"`
}

type AudioSender

type AudioSender interface {
	SendAudio(SendAudioRequest) (*Message, error)
}

type BaseClient

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

func NewClient

func NewClient(apiToken string, longPollingTimeout int) *BaseClient

func (BaseClient) AnswerCallbackQuery

func (c BaseClient) AnswerCallbackQuery(request AnswerCallbackQueryRequest) error

func (BaseClient) AnswerInlineQuery

func (c BaseClient) AnswerInlineQuery(request AnswerInlineQueryRequest) (bool, error)

func (BaseClient) DeleteMessage

func (c BaseClient) DeleteMessage(request DeleteMessageRequest) (bool, error)

func (BaseClient) DownloadFile

func (c BaseClient) DownloadFile(filePath string) ([]byte, error)

func (BaseClient) EditMessageReplyMarkup

func (c BaseClient) EditMessageReplyMarkup(request EditMessageReplyMarkupRequest) (*Message, error)

func (BaseClient) EditMessageText

func (c BaseClient) EditMessageText(request EditMessageTextRequest) (*Message, error)

func (BaseClient) ForwardMessage

func (c BaseClient) ForwardMessage(request ForwardMessageRequest) (*Message, error)

func (BaseClient) GetFile

func (c BaseClient) GetFile(request GetFileRequest) (*File, error)

func (BaseClient) GetMe

func (c BaseClient) GetMe() (*User, error)

func (BaseClient) GetUpdates

func (c BaseClient) GetUpdates(request GetUpdatesRequest) (*[]Update, error)

func (BaseClient) SendAudio

func (c BaseClient) SendAudio(request SendAudioRequest) (interface{}, error)

func (BaseClient) SendMessage

func (c BaseClient) SendMessage(request SendMessageRequest) (*Message, error)

func (BaseClient) SendPhoto

func (c BaseClient) SendPhoto(request SendPhotoRequest) (interface{}, error)

type CallbackGame

type CallbackGame struct {
}

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

type CaptionSource

type CaptionSource struct {
	Caption string `json:"caption,omitempty"`
}

func (CaptionSource) FillFormData

func (c CaptionSource) FillFormData(m *map[string]io.Reader, reader io.Reader) *map[string]io.Reader

type Chat

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

type ChatAction

type ChatAction string
const (
	ChatActionTyping          ChatAction = "typing"
	ChatActionUploadPhoto     ChatAction = "upload_photo"
	ChatActionRecordVideo     ChatAction = "record_video"
	ChatActionUploadVideo     ChatAction = "upload_video"
	ChatActionRecordAudio     ChatAction = "record_audio"
	ChatActionUploadAudio     ChatAction = "upload_audio"
	ChatActionUploadDocument  ChatAction = "upload_document"
	ChatActionFindLocation    ChatAction = "find_location"
	ChatActionRecordVideoNote ChatAction = "record_video_note"
	ChatActionUploadVideoNote ChatAction = "upload_video_note"
)

type ChatMember

type ChatMember struct {
	ChatPermissions
	User               *User  `json:"user"`
	Status             string `json:"status"`
	UntilDate          int    `json:"until_date"`
	CanBeEdited        bool   `json:"can_be_edited"`
	CanPostMessages    bool   `json:"can_post_messages"`
	CanEditMessages    bool   `json:"can_edit_messages"`
	CanDeleteMessages  bool   `json:"can_delete_messages"`
	CanRestrictMembers bool   `json:"can_restrict_members"`
	CanPromoteMembers  bool   `json:"can_promote_members"`
	IsMember           bool   `json:"is_member"`
}

type ChatOperations

type ChatOperations interface {
	SetChatPhoto(SetChatPhotoRequest) bool
	DeleteChatPhoto(ChatRequest) bool
	SetChatTitle(SetChatTitleRequest) bool
	SetChatDescription(SetChatDescriptionRequest) bool
	PinChatMessage(PinChatMessageRequest) bool
	UnpinChatMessage(ChatRequest) bool
	LeaveChat(ChatRequest) bool
	GetChat(ChatRequest) Chat
	GetChatAdministrators(ChatRequest) []ChatMember
	GetChatMembersCount(ChatRequest) int
	GetChatMember(GetChatMemberRequest) ChatMember
	SetChatStickerSet(SetChatStickerSetRequest) bool
	DeleteChatStickerSet(ChatRequest) bool
}

type ChatPermissions

type ChatPermissions struct {
	CanSendMessages       bool `json:"can_send_messages"`
	CanSendMediaMessages  bool `json:"can_send_media_messages"`
	CanSendPolls          bool `json:"can_send_polls"`
	CanSendOtherMessages  bool `json:"can_send_other_messages"`
	CanAddWebPagePreviews bool `json:"can_add_web_page_previews"`
	CanChangeInfo         bool `json:"can_change_info"`
	CanInviteUsers        bool `json:"can_invite_users"`
	CanPinMessages        bool `json:"can_pin_messages"`
}

type ChatPhoto

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

type ChatRequest

type ChatRequest struct {
	ChatID int `json:"chat_id"`
}

func (ChatRequest) FillFormData

func (c ChatRequest) FillFormData(m *map[string]io.Reader, reader io.Reader)

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

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"`
	VCard       string `json:"v_card"`
}

type ContactSender

type ContactSender interface {
	SendContact(SendContactRequest) (*Message, error)
}

type DeleteMessageRequest

type DeleteMessageRequest struct {
	ChatRequest
	MessageID int `json:"message_id,omitempty"`
}

type DescriptionSource

type DescriptionSource struct {
	Description string `json:"description"`
}

type DisableNotificationsSource

type DisableNotificationsSource struct {
	DisableNotification bool `json:"disable_notification,omitempty"`
}

func (DisableNotificationsSource) FillFormData

func (c DisableNotificationsSource) FillFormData(m *map[string]io.Reader, reader io.Reader) *map[string]io.Reader

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

type DocumentSender

type DocumentSender interface {
	SendDocument(SendDocumentRequest) (*Message, error)
}

type EditMessageReplyMarkupRequest

type EditMessageReplyMarkupRequest struct {
	ChatRequest
	MessageID       int         `json:"message_id"`
	InlineMessageID int         `json:"inline_message_id"`
	ReplyMarkup     interface{} `json:"reply_markup"`
}

type EditMessageTextRequest

type EditMessageTextRequest struct {
	ChatRequest
	ParseModeSource
	ReplyMarkupSource
	MessageID             int    `json:"message_id"`
	InlineMessageID       int    `json:"inline_message_id"`
	Text                  string `json:"text"`
	DisableWebPagePreview bool   `json:"disable_web_page_preview"`
}

type EncryptedCredentials

type EncryptedCredentials struct {
	Data   string `json:"data"`
	Hash   string `json:"hash"`
	Secret string `json:"secret"`
}

type EncryptedPassportElement

type EncryptedPassportElement struct {
	Type        string         `json:"type"`
	Data        string         `json:"data"`
	PhoneNumber string         `json:"phone_number"`
	Email       string         `json:"email"`
	Files       []PassportFile `json:"files"`
	FrontSide   *PassportFile  `json:"front_side"`
	ReverseSide *PassportFile  `json:"reverse_side"`
	Selfie      *PassportFile  `json:"selfie"`
	Translation []PassportFile `json:"translation"`
	Hash        string         `json:"hash"`
}

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"
	EntityTypeCode        EntityType = "code"
	EntityTypePre         EntityType = "pre"
	EntityTypeTextLink    EntityType = "text_link"
	EntityTypeTextMention EntityType = "text_mention"
)

type File

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

type FileGetter

type FileGetter interface {
	GetFile(GetFileRequest) (*File, error)
}

type FormDataFiller

type FormDataFiller interface {
	FillFormData(multipartReaders *map[string]io.Reader, contentReader io.Reader) *map[string]io.Reader
}

type ForwardMessageRequest

type ForwardMessageRequest struct {
	ChatRequest
	DisableNotificationsSource
	FromChatID int `json:"from_chat_id"`
	MessageID  int `json:"message_id"`
}

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

type GetChatMemberRequest

type GetChatMemberRequest struct {
	ChatRequest
	UserID int `json:"user_id"`
}

type GetFileRequest

type GetFileRequest struct {
	FileID string `json:"file_id"`
}

type GetFileResponse

type GetFileResponse struct {
	Ok     bool `json:"ok"`
	Result File `json:"result"`
}

type GetUpdatesRequest

type GetUpdatesRequest struct {
	Offset         int          `json:"offset"`
	Limit          int          `json:"limit"`
	Timeout        int          `json:"timeout"`
	AllowedUpdates []UpdateType `json:"allowed_updates"`
}

type GetUserProfilePhotosRequest

type GetUserProfilePhotosRequest struct {
	UserID int `json:"user_id"`
	Offset int `json:"offset"`
	Limit  int `json:"limit"`
}

type IDAndTypeSource

type IDAndTypeSource struct {
	Type InlineQueryResultType `json:"type"`
	ID   string                `json:"id"`
}

type InlineKeyboardButton

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

type InlineKeyboardMarkup

type InlineKeyboardMarkup struct {
	InlineKeyboard [][]InlineKeyboardButton `json:"inline_keyboard"`
}

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

type InlineQueryAnswerer

type InlineQueryAnswerer interface {
	AnswerInlineQuery(AnswerInlineQueryRequest) (bool, error)
}

type InlineQueryResultArticle

type InlineQueryResultArticle struct {
	IDAndTypeSource
	InputMessageContentSource
	ReplyMarkupSource
	TitleSource
	Url     string `json:"url"`
	HideUrl bool   `json:"hide_url"`
	DescriptionSource
	ThumbUrl    string `json:"thumb_url"`
	ThumbWidth  int    `json:"thumb_width"`
	ThumbHeight int    `json:"thumb_height"`
}

type InlineQueryResultAudio

type InlineQueryResultAudio struct {
	IDAndTypeSource
	InputMessageContentSource
	ReplyMarkupSource
	AudioUrl string `json:"audio_url"`
	TitleSource
	CaptionSource
	ParseModeSource
	Performer     string `json:"performer"`
	AudioDuration int    `json:"audio_duration"`
}

type InlineQueryResultCachedAudio

type InlineQueryResultCachedAudio struct {
	IDAndTypeSource
	InputMessageContentSource
	ReplyMarkupSource
	AudioFileID string `json:"audio_file_id"`
	CaptionSource
	ParseModeSource
}

type InlineQueryResultCachedDocument

type InlineQueryResultCachedDocument struct {
	IDAndTypeSource
	InputMessageContentSource
	ReplyMarkupSource
	TitleSource
	DocumentFileID string `json:"document_file_id"`
	DescriptionSource
	CaptionSource
	ParseModeSource
}

type InlineQueryResultCachedGif

type InlineQueryResultCachedGif struct {
	IDAndTypeSource
	InputMessageContentSource
	ReplyMarkupSource
	GifFileID string `json:"gif_file_id"`
	TitleSource
	CaptionSource
	ParseModeSource
}

type InlineQueryResultCachedMpeg4Gif

type InlineQueryResultCachedMpeg4Gif struct {
	IDAndTypeSource
	InputMessageContentSource
	ReplyMarkupSource
	Mpeg4FileID string `json:"mpeg4_file_id"`
	TitleSource
	CaptionSource
	ParseModeSource
}

type InlineQueryResultCachedSticker

type InlineQueryResultCachedSticker struct {
	IDAndTypeSource
	InputMessageContentSource
	ReplyMarkupSource
	StickerFileID string `json:"sticker_file_id"`
}

type InlineQueryResultCachedVoice

type InlineQueryResultCachedVoice struct {
	ReplyMarkupSource
	IDAndTypeSource
	InputMessageContentSource
	VoiceFileID string `json:"voice_file_id"`
	TitleSource
	CaptionSource
	ParseModeSource
}

type InlineQueryResultContact

type InlineQueryResultContact struct {
	IDAndTypeSource
	InputMessageContentSource
	ReplyMarkupSource
	PhoneNumber string `json:"phone_number"`
	FirstName   string `json:"first_name"`
	LastName    string `json:"last_name"`
	Vcard       string `json:"vcard"`
	ThumbUrl    string `json:"thumb_url"`
	ThumbWidth  int    `json:"thumb_width"`
	ThumbHeight int    `json:"thumb_height"`
}

type InlineQueryResultDocument

type InlineQueryResultDocument struct {
	IDAndTypeSource
	InputMessageContentSource
	ReplyMarkupSource
	TitleSource
	CaptionSource
	ParseModeSource
	DocumentUrl string `json:"document_url"`
	MimeType    string `json:"mime_type"`
	DescriptionSource
	ThumbUrl    string `json:"thumb_url"`
	ThumbWidth  int    `json:"thumb_width"`
	ThumbHeight int    `json:"thumb_height"`
}

type InlineQueryResultGame

type InlineQueryResultGame struct {
	IDAndTypeSource
	ReplyMarkupSource
	GameShortName string `json:"game_short_name"`
}

type InlineQueryResultGif

type InlineQueryResultGif struct {
	IDAndTypeSource
	InputMessageContentSource
	ReplyMarkupSource
	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"`
	TitleSource
	CaptionSource
	ParseModeSource
}

type InlineQueryResultLocation

type InlineQueryResultLocation struct {
	IDAndTypeSource
	InputMessageContentSource
	ReplyMarkupSource
	Latitude    float64 `json:"latitude"`
	Longitude   float64 `json:"longitude"`
	Title       string  `json:"title"`
	LivePeriod  int     `json:"live_period"`
	ThumbUrl    string  `json:"thumb_url"`
	ThumbWidth  int     `json:"thumb_width"`
	ThumbHeight int     `json:"thumb_height"`
}

type InlineQueryResultMpeg4Gif

type InlineQueryResultMpeg4Gif struct {
	IDAndTypeSource
	InputMessageContentSource
	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"`
	TitleSource
	CaptionSource
	ParseModeSource
	ReplyMarkupSource
}

type InlineQueryResultPhoto

type InlineQueryResultPhoto struct {
	IDAndTypeSource
	InputMessageContentSource
	ReplyMarkupSource
	PhotoUrl    string `json:"photo_url"`
	ThumbUrl    string `json:"thumb_url"`
	PhotoWidth  int    `json:"photo_width"`
	PhotoHeight int    `json:"photo_height"`
	TitleSource
	DescriptionSource
	CaptionSource
	ParseModeSource
}

type InlineQueryResultType

type InlineQueryResultType string
const (
	InlineQueryResultTypeArticle  InlineQueryResultType = "article"
	InlineQueryResultTypePhoto    InlineQueryResultType = "photo"
	InlineQueryResultTypeGif      InlineQueryResultType = "gif"
	InlineQueryResultTypeMpeg4Gif InlineQueryResultType = "mpeg4_gif"
	InlineQueryResultTypeVideo    InlineQueryResultType = "video"
	InlineQueryResultTypeAudio    InlineQueryResultType = "audio"
	InlineQueryResultTypeVoice    InlineQueryResultType = "voice"
	InlineQueryResultTypeDocument InlineQueryResultType = "document"
	InlineQueryResultTypeLocation InlineQueryResultType = "location"
	InlineQueryResultTypeVenue    InlineQueryResultType = "venue"
	InlineQueryResultTypeContact  InlineQueryResultType = "contact"
	InlineQueryResultTypeGame     InlineQueryResultType = "game"
	InlineQueryResultTypeSticker  InlineQueryResultType = "sticker"
)

type InlineQueryResultVenue

type InlineQueryResultVenue struct {
	IDAndTypeSource
	InputMessageContentSource
	ReplyMarkupSource
	Latitude  float64 `json:"latitude"`
	Longitude float64 `json:"longitude"`
	TitleSource
	Address        string `json:"address"`
	FoursquareID   string `json:"foursquare_id"`
	FoursquareType string `json:"foursquare_type"`
	ThumbUrl       string `json:"thumb_url"`
	ThumbWidth     int    `json:"thumb_width"`
	ThumbHeight    int    `json:"thumb_height"`
}

type InlineQueryResultVideo

type InlineQueryResultVideo struct {
	IDAndTypeSource
	InputMessageContentSource
	ReplyMarkupSource
	VideoUrl string `json:"video_url"`
	MimeType string `json:"mime_type"`
	ThumbUrl string `json:"thumb_url"`
	TitleSource
	CaptionSource
	ParseModeSource
	VideoWidth    int `json:"video_width"`
	VideoHeight   int `json:"video_height"`
	VideoDuration int `json:"video_duration"`
	DescriptionSource
}

type InlineQueryResultVoice

type InlineQueryResultVoice struct {
	IDAndTypeSource
	InputMessageContentSource
	ReplyMarkupSource
	VoiceUrl string `json:"voice_url"`
	TitleSource
	CaptionSource
	ParseModeSource
	VoiceDuration int `json:"voice_duration"`
}

type InputContactMessageContent

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

type InputLocationMessageContent

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

type InputMessageContentSource

type InputMessageContentSource struct {
	InputMessageContent interface{} `json:"input_message_content"`
}

type InputTextMessageContent

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

type InputVenueMessageContent

type InputVenueMessageContent struct {
	Latitude  float64 `json:"latitude"`
	Longitude float64 `json:"longitude"`
	TitleSource
	Address        string `json:"address"`
	FoursquareId   string `json:"foursquare_id"`
	FoursquareType string `json:"foursquare_type"`
}

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

type KeyboardButton

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

type Location

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

type LocationSender

type LocationSender interface {
	SendLocation(SendLocationRequest) (*Message, error)
}

type LoginUrl

type LoginUrl struct {
	Url                string `json:"url,omitempty"`
	ForwardText        string `json:"forward_text,omitempty"`
	BotUsername        string `json:"bot_username,omitempty"`
	RequestWriteAccess bool   `json:"request_write_access,omitempty"`
}

type MaskPosition

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

type MeGetter

type MeGetter interface {
	GetMe() (*User, error)
}

type MediaGroupSender

type MediaGroupSender interface {
	SendMediaGroup(SendMediaGroupRequest) (*Message, error)
}

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"`
	ForwardSenderName     string                `json:"forward_sender_name"`
	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"`
	Animation             *Animation            `json:"animation"`
	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"`
	Poll                  *Poll                 `json:"poll"`
	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       int                   `json:"migrate_to_chat_id"`
	MigrateFromChatID     int                   `json:"migrate_from_chat_id"`
	PinnedMessage         *Message              `json:"pinned_message"`
	Invoice               *Invoice              `json:"invoice"`
	SuccessfulPayment     *SuccessfulPayment    `json:"successful_payment"`
	ConnectedWebsite      string                `json:"connected_website"`
	PassportData          *PassportData         `json:"passport_data"`
	ReplyMarkup           *InlineKeyboardMarkup `json:"reply_markup"`
}

type MessageDeleter

type MessageDeleter interface {
	DeleteMessage(DeleteMessageRequest) (bool, error)
}

type MessageEntity

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

type MessageForwarder

type MessageForwarder interface {
	ForwardMessage(ForwardMessageRequest) (*Message, error)
}

type MessageReplyMarkupEditor

type MessageReplyMarkupEditor interface {
	EditMessageReplyMarkup(EditMessageReplyMarkupRequest) (*Message, error)
}

type MessageSender

type MessageSender interface {
	SendMessage(SendMessageRequest) (*Message, error)
}

type MessageTextEditor

type MessageTextEditor interface {
	EditMessageText(EditMessageTextRequest) (*Message, error)
}

type OrderInfo

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

type ParseMode

type ParseMode string
const (
	ParseModeMarkdown ParseMode = "Markdown"
	ParseModeHTML     ParseMode = "HTML"
)

type ParseModeSource

type ParseModeSource struct {
	ParseMode ParseMode `json:"parse_mode,omitempty"`
}

func (ParseModeSource) FillFormData

func (c ParseModeSource) FillFormData(m *map[string]io.Reader, reader io.Reader)

type PassportData

type PassportData struct {
	Data        []EncryptedPassportElement `json:"data"`
	Credentials EncryptedCredentials       `json:"credentials"`
}

type PassportFile

type PassportFile struct {
	FileID   string `json:"file_id"`
	FileSize int    `json:"file_size"`
	FileDate int    `json:"file_date"`
}

type PhotoSender

type PhotoSender interface {
	SendPhoto(SendPhotoRequest) (*Message, error)
}

type PhotoSize

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

type PinChatMessageRequest

type PinChatMessageRequest struct {
	ChatRequest
	MessageID            int  `json:"message_id"`
	DisableNotifications bool `json:"disable_notifications"`
}

type Poll

type Poll struct {
	ID       string       `json:"id"`
	Question string       `json:"question"`
	Options  []PollOption `json:"options"`
	IsClosed bool         `json:"is_closed"`
}

type PollOption

type PollOption struct {
	Text       string `json:"text"`
	VoterCount int    `json:"voter_count"`
}

type PollSender

type PollSender interface {
	SendPoll(SendPollRequest) (*Message, error)
}

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

type ReplyKeyboardMarkup

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

type ReplyKeyboardRemove

type ReplyKeyboardRemove struct {
	RemoveKeyboard bool `json:"remove_keyboard"`
	Selective      bool `json:"selective,omitempty"`
}

type ReplyMarkupSource

type ReplyMarkupSource struct {
	ReplyMarkup interface{} `json:"reply_markup,omitempty"`
}

func (ReplyMarkupSource) FillFormData

func (c ReplyMarkupSource) FillFormData(m *map[string]io.Reader, reader io.Reader) *map[string]io.Reader

type ReplyToMessageIDSource

type ReplyToMessageIDSource struct {
	ReplyToMessageID int `json:"reply_to_message_id,omitempty"`
}

func (ReplyToMessageIDSource) FillFormData

func (c ReplyToMessageIDSource) FillFormData(m *map[string]io.Reader, reader io.Reader) *map[string]io.Reader

type ResponseParameters

type ResponseParameters struct {
	MigrateToChatID int `json:"migrate_to_chat_id"`
	RetryAfter      int `json:"retry_after"`
}

type ResponseWrapper

type ResponseWrapper struct {
	Ok          bool               `json:"ok"`
	ErrorCode   int                `json:"error_code"`
	Parameters  ResponseParameters `json:"parameters"`
	Description string             `json:"description"`
	Result      interface{}        `json:"result"`
}

type SendAnimationRequest

type SendAnimationRequest struct {
	Animation string `json:"animation"`
	Duration  int    `json:"duration"`
	Width     int    `json:"width"`
	Height    int    `json:"height"`
	ChatRequest
	ThumbSource
	CaptionSource
	ParseModeSource
	DisableNotificationsSource
	ReplyToMessageIDSource
	ReplyMarkupSource
}

func (SendAnimationRequest) FillFormData

func (c SendAnimationRequest) FillFormData(m *map[string]io.Reader, reader io.Reader) *map[string]io.Reader

type SendAudioRequest

type SendAudioRequest struct {
	Audio     string `json:"audio"`
	Duration  int    `json:"duration"`
	Performer string `json:"performer"`
	Title     string `json:"title"`
	ChatRequest
	ThumbSource
	CaptionSource
	ParseModeSource
	DisableNotificationsSource
	ReplyToMessageIDSource
	ReplyMarkupSource
}

func (SendAudioRequest) FillFormData

func (c SendAudioRequest) FillFormData(m *map[string]io.Reader, reader io.Reader) *map[string]io.Reader

type SendChatActionRequest

type SendChatActionRequest struct {
	ChatRequest
	Action ChatAction `json:"action"`
}

type SendContactRequest

type SendContactRequest struct {
	ChatRequest
	PhoneNumber string `json:"phone_number"`
	FirstName   string `json:"first_name"`
	LastName    string `json:"last_name"`
	VCard       string `json:"v_card"`
	DisableNotificationsSource
	ReplyToMessageIDSource
	ReplyMarkupSource
}

type SendDocumentRequest

func (SendDocumentRequest) FillFormData

func (c SendDocumentRequest) FillFormData(m *map[string]io.Reader, reader io.Reader) *map[string]io.Reader

type SendLocationRequest

type SendLocationRequest struct {
	ChatRequest
	Latitude   float64 `json:"latitude"`
	Longitude  float64 `json:"longitude"`
	LivePeriod int     `json:"live_period"`
	DisableNotificationsSource
	ReplyToMessageIDSource
	ReplyMarkupSource
}

type SendMediaGroupRequest

type SendMediaGroupRequest struct {
	ChatRequest
	Media []interface{} `json:"media"`
	DisableNotificationsSource
	ReplyToMessageIDSource
}

type SendMessageRequest

type SendMessageRequest struct {
	ChatRequest
	Text                  string `json:"text"`
	DisableWebPagePreview bool   `json:"disable_web_page_preview,omitempty"`
	ParseModeSource
	DisableNotificationsSource
	ReplyToMessageIDSource
	ReplyMarkupSource
}

type SendPhotoRequest

func (SendPhotoRequest) FillFormData

func (c SendPhotoRequest) FillFormData(m *map[string]io.Reader, reader io.Reader) *map[string]io.Reader

type SendPollRequest

type SendPollRequest struct {
	ChatRequest
	Question string   `json:"question"`
	Options  []string `json:"options"`
	DisableNotificationsSource
	ReplyToMessageIDSource
	ReplyMarkupSource
}

type SendVideoNoteRequest

type SendVideoNoteRequest struct {
	ChatRequest
	VideoNote string `json:"video_note"`
	Duration  int    `json:"duration"`
	Length    int    `json:"length"`
	ThumbSource
	DisableNotificationsSource
	ReplyToMessageIDSource
	ReplyMarkupSource
}

func (SendVideoNoteRequest) FillFormData

func (c SendVideoNoteRequest) FillFormData(m *map[string]io.Reader, reader io.Reader) *map[string]io.Reader

type SendVideoRequest

type SendVideoRequest struct {
	Video             string `json:"video"`
	Duration          int    `json:"duration"`
	Width             int    `json:"width"`
	Height            int    `json:"height"`
	SupportsStreaming bool   `json:"supports_streaming"`
	ChatRequest
	ThumbSource
	CaptionSource
	ParseModeSource
	DisableNotificationsSource
	ReplyToMessageIDSource
	ReplyMarkupSource
}

func (SendVideoRequest) FillFormData

func (c SendVideoRequest) FillFormData(m *map[string]io.Reader, reader io.Reader) *map[string]io.Reader

type SendVoiceRequest

type SendVoiceRequest struct {
	Voice    string `json:"voice"`
	Duration int    `json:"duration"`
	ChatRequest
	CaptionSource
	ParseModeSource
	DisableNotificationsSource
	ReplyToMessageIDSource
	ReplyMarkupSource
}

func (SendVoiceRequest) FillFormData

func (c SendVoiceRequest) FillFormData(m *map[string]io.Reader, reader io.Reader) *map[string]io.Reader

type SetChatDescriptionRequest

type SetChatDescriptionRequest struct {
	ChatRequest
	Description string `json:"description"`
}

type SetChatPhotoRequest

type SetChatPhotoRequest struct {
	ChatRequest
	Photo string `json:"photo"`
}

func (SetChatPhotoRequest) FillFormData

func (c SetChatPhotoRequest) FillFormData(m *map[string]io.Reader, reader io.Reader)

type SetChatStickerSetRequest

type SetChatStickerSetRequest struct {
	ChatRequest
	StickerSetName string `json:"sticker_set_name"`
}

type SetChatTitleRequest

type SetChatTitleRequest struct {
	ChatRequest
	Title string `json:"title"`
}

type ShippingAddress

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

type ShippingQuery

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

type Sticker

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

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

type ThumbSource

type ThumbSource struct {
	Thumb string `json:"thumb,omitempty"`
}

func (ThumbSource) FillFormData

func (c ThumbSource) FillFormData(m *map[string]io.Reader, reader io.Reader) *map[string]io.Reader

type TitleSource

type TitleSource struct {
	Title string `json:"title"`
}

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"`
	Poll               *Poll               `json:"poll"`
}

type UpdateType

type UpdateType string
const (
	UpdateTypeMessage            UpdateType = "message"
	UpdateTypeEditedMessage      UpdateType = "edited_message"
	UpdateTypeChannelPost        UpdateType = "channel_post"
	UpdateTypeEditedChannelPost  UpdateType = "edited_channel_post"
	UpdateTypeInlineResult       UpdateType = "inline_query"
	UpdateTypeChosenInlineResult UpdateType = "chosen_inline_result"
	UpdateTypeCallbackQuery      UpdateType = "callback_query"
	UpdateTypeShippingQuery      UpdateType = "shipping_query"
	UpdateTypePreCheckoutQuery   UpdateType = "pre_checkout_query"
	UpdateTypePoll               UpdateType = "poll"
)

type UpdatesGetter

type UpdatesGetter interface {
	GetUpdates(GetUpdatesRequest) (*[]Update, error)
}

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

type UserProfilePhotos

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

type Venue

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

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

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

type VideoNoteSender

type VideoNoteSender interface {
	SendVideoNote(SendVideoNoteRequest) (*Message, error)
}

type VideoSender

type VideoSender interface {
	SendVideo(SendVideoRequest) (*Message, error)
}

type Voice

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

type VoiceSender

type VoiceSender interface {
	SendVoice(SendVoiceRequest) (*Message, error)
}

Jump to

Keyboard shortcuts

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