ext

package
v0.0.0-...-8830661 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2019 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const ApiUrl = "https://api.telegram.org/bot"

Variables

View Source
var DefaultTgBotGetter = TgBotGetter{
	Client: &http.Client{
		Transport:     nil,
		CheckRedirect: nil,
		Jar:           nil,
		Timeout:       time.Millisecond * 1500,
	},
	ApiUrl: ApiUrl,
}

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

type BasePassportError

type BasePassportError struct {
	Source  string
	Type    string
	Message string
}

type Bot

type Bot struct {
	Token             string
	Id                int
	FirstName         string
	UserName          string
	Logger            *logrus.Logger `json:"-"`
	DisableWebPreview bool
}

func (Bot) AddStickerToSetPath

func (b Bot) AddStickerToSetPath(userId int, name string, path string, emojis string) (bool, error)

func (Bot) AddStickerToSetReader

func (b Bot) AddStickerToSetReader(userId int, name string, reader io.Reader, emojis string) (bool, error)

func (Bot) AddStickerToSetStr

func (b Bot) AddStickerToSetStr(userId int, name string, pngStickerId string, emojis string) (bool, error)

func (Bot) AnswerCallbackQuery

func (b Bot) AnswerCallbackQuery(callbackQueryId string) (bool, error)

AnswerCallbackQuery answer a callback query

func (Bot) AnswerCallbackQueryText

func (b Bot) AnswerCallbackQueryText(callbackQueryId string, text string, alert bool) (bool, error)

AnswerCallbackQueryText answer a callback query with text

func (Bot) AnswerCallbackQueryURL

func (b Bot) AnswerCallbackQueryURL(callbackQueryId string, url string) (bool, error)

AnswerCallbackQueryURL answer a callback query with a URL

func (Bot) AnswerInlineQuery

func (b Bot) AnswerInlineQuery(inlineQueryId string, results []InlineQueryResult) (bool, error)

func (Bot) AnswerPreCheckoutQuery

func (b Bot) AnswerPreCheckoutQuery(preCheckoutQueryId string, ok bool) (bool, error)

func (Bot) AnswerShippingQuery

func (b Bot) AnswerShippingQuery(shippingQueryId string, ok bool) (bool, error)

func (Bot) CreateNewStickerSetPath

func (b Bot) CreateNewStickerSetPath(userId int, name string, title string, path string, emojis string) (bool, error)

func (Bot) CreateNewStickerSetReader

func (b Bot) CreateNewStickerSetReader(userId int, name string, title string, reader io.Reader, emojis string) (bool, error)

func (Bot) CreateNewStickerSetStr

func (b Bot) CreateNewStickerSetStr(userId int, name string, title string, pngStickerid string, emojis string) (bool, error)

func (Bot) DeleteChatPhoto

func (b Bot) DeleteChatPhoto(chatId int) (bool, error)

func (Bot) DeleteChatStickerSet

func (b Bot) DeleteChatStickerSet(chatId int) (bool, error)

func (Bot) DeleteMessage

func (b Bot) DeleteMessage(chatId int, messageId int) (bool, error)

TODO: ensure not a private chat! cant delete in private chats.

func (Bot) DeleteStickerFromSet

func (b Bot) DeleteStickerFromSet(sticker string) (bool, error)

func (Bot) DemoteChatMember

func (b Bot) DemoteChatMember(chatId int, userId int) (bool, error)

func (Bot) EditMessage

func (b Bot) EditMessage(chatId int, messageId int, text string, parseMode string) (*Message, error)

func (Bot) EditMessageCaption

func (b Bot) EditMessageCaption(chatId int, messageId int, caption string) (*Message, error)

func (Bot) EditMessageCaptionInline

func (b Bot) EditMessageCaptionInline(inlineMessageId string, caption string) (*Message, error)

func (Bot) EditMessageCaptionMarkup

func (b Bot) EditMessageCaptionMarkup(chatId int, messageId int, caption string, markup ReplyMarkup) (*Message, error)

func (Bot) EditMessageHTML

func (b Bot) EditMessageHTML(chatId int, messageId int, text string) (*Message, error)

func (Bot) EditMessageHTMLInline

func (b Bot) EditMessageHTMLInline(inlineMessageId string, text string) (*Message, error)

func (Bot) EditMessageInline

func (b Bot) EditMessageInline(inlineMessageId string, text string, parseMode string) (*Message, error)

func (Bot) EditMessageMarkdown

func (b Bot) EditMessageMarkdown(chatId int, messageId int, text string) (*Message, error)

func (Bot) EditMessageMarkdownInline

func (b Bot) EditMessageMarkdownInline(inlineMessageId string, text string) (*Message, error)

func (Bot) EditMessageReplyMarkup

func (b Bot) EditMessageReplyMarkup(chatId int, messageId int, replyMarkup InlineKeyboardMarkup) (*Message, error)

func (Bot) EditMessageReplyMarkupInline

func (b Bot) EditMessageReplyMarkupInline(inlineMessageId string, replyMarkup InlineKeyboardMarkup) (*Message, error)

func (Bot) EditMessageText

func (b Bot) EditMessageText(chatId int, messageId int, text string) (*Message, error)

func (Bot) EditMessageTextInline

func (b Bot) EditMessageTextInline(inlineMessageId string, text string) (*Message, error)

func (Bot) EditMessageTextMarkup

func (b Bot) EditMessageTextMarkup(chatId int, messageId int, text string, parseMode string, markup ReplyMarkup) (*Message, error)
func (b Bot) ExportChatInviteLink(chatId int) (string, error)

func (Bot) ForwardMessage

func (b Bot) ForwardMessage(chatId int, fromChatId int, messageId int) (*Message, error)

func (Bot) GetChat

func (b Bot) GetChat(chatId int) (*Chat, error)

func (Bot) GetChatAdministrators

func (b Bot) GetChatAdministrators(chatId int) ([]ChatMember, error)

func (Bot) GetChatMember

func (b Bot) GetChatMember(chatId int, userId int) (*ChatMember, error)

func (Bot) GetChatMembersCount

func (b Bot) GetChatMembersCount(chatId int) (int, error)

func (Bot) GetFile

func (b Bot) GetFile(fileId string) (*File, error)

GetFile Retrieve a file from the bot api

func (Bot) GetGameHighScores

func (b Bot) GetGameHighScores(userId int, chatId int, messageId int) ([]GameHighScore, error)

func (Bot) GetGameHighScoresInline

func (b Bot) GetGameHighScoresInline(userId int, inlineMessageId string) ([]GameHighScore, error)

func (Bot) GetMe

func (b Bot) GetMe() (*User, error)

GetMe get the bot info

func (Bot) GetStickerSet

func (b Bot) GetStickerSet(name string) (*StickerSet, error)

func (Bot) GetUserProfilePhotos

func (b Bot) GetUserProfilePhotos(userId int) (*UserProfilePhotos, error)

GetUserProfilePhotos Retrieves a user's profile pictures

func (Bot) KickChatMember

func (b Bot) KickChatMember(chatId int, userId int) (bool, error)

func (Bot) KickChatMemberUntil

func (b Bot) KickChatMemberUntil(chatId int, userId int, untilDate int64) (bool, error)

func (Bot) LeaveChat

func (b Bot) LeaveChat(chatId int) (bool, error)

func (Bot) Message

func (b Bot) Message(chatId int, text string) Message

func (Bot) NewSendableAddStickerToSet

func (b Bot) NewSendableAddStickerToSet(userId int, name string, emojis string) *sendableAddStickerToSet

func (Bot) NewSendableAnimation

func (b Bot) NewSendableAnimation(chatId int, caption string) *sendableAnimation

NewSendableAnimation creates a new animation struct to send

func (Bot) NewSendableAnswerCallbackQuery

func (b Bot) NewSendableAnswerCallbackQuery(queryId string) *sendableCallbackQuery

NewSendablePoll creates a new callbackQuery struct to send.

func (Bot) NewSendableAnswerInlineQuery

func (b Bot) NewSendableAnswerInlineQuery(inlineQueryId string, results []InlineQueryResult) *sendableAnswerInlineQuery

func (Bot) NewSendableAnswerPreCheckoutQuery

func (b Bot) NewSendableAnswerPreCheckoutQuery(shippingQueryId string, ok bool) *sendableAnswerPreCheckoutQuery

func (Bot) NewSendableAnswerShippingQuery

func (b Bot) NewSendableAnswerShippingQuery(shippingQueryId string, ok bool) *sendableAnswerShippingQuery

func (Bot) NewSendableAudio

func (b Bot) NewSendableAudio(chatId int, caption string) *sendableAudio

NewSendableAudio creates a new audio struct to send

func (Bot) NewSendableChatAction

func (b Bot) NewSendableChatAction(chatId int) *sendableChatAction

NewSendableChatAction creates a new chat action struct to send

func (Bot) NewSendableContact

func (b Bot) NewSendableContact(chatId int) *sendableContact

NewSendableContact creates a new contact struct to send

func (Bot) NewSendableCreateNewSticker

func (b Bot) NewSendableCreateNewSticker(userId int, name string, title string, emojis string) *sendableCreateNewSticker

func (Bot) NewSendableDocument

func (b Bot) NewSendableDocument(chatId int, caption string) *sendableDocument

NewSendableDocument creates a new document struct to send

func (Bot) NewSendableEditMessageCaption

func (b Bot) NewSendableEditMessageCaption(chatId int, messageId int, caption string) *sendableEditMessageCaption

NewSendableEditMessageCaption create a new caption editing struct to send

func (Bot) NewSendableEditMessageMedia

func (b Bot) NewSendableEditMessageMedia(chatId int, messageId int) *sendableEditMessageMedia

NewSendableEditMessageMedia creates a new editmessage media struct to send

func (Bot) NewSendableEditMessageReplyMarkup

func (b Bot) NewSendableEditMessageReplyMarkup(chatId int, messageId int, markup ReplyMarkup) *sendableEditMessageReplyMarkup

NewSendableEditMessageReplyMarkup creates a new markup editing struct to send

func (Bot) NewSendableEditMessageText

func (b Bot) NewSendableEditMessageText(chatId int, messageId int, text string) *sendableEditMessageText

NewSendableEditMessageText create a new message editing struct to send

func (Bot) NewSendableGame

func (b Bot) NewSendableGame(chatId int, gameShortName string) *sendableGame

func (Bot) NewSendableGetGameHighScore

func (b Bot) NewSendableGetGameHighScore(userId int, chatId int, messageId int) *sendableGetGameHighScores

func (Bot) NewSendableGetGameHighScoreInline

func (b Bot) NewSendableGetGameHighScoreInline(userId int, inlineMessageId string) *sendableGetGameHighScores

func (Bot) NewSendableInvoice

func (b Bot) NewSendableInvoice(chatId int, title string, description string, payload string, providerToken string, startParameter string, currency string, prices []LabeledPrice) *sendableInvoice

func (Bot) NewSendableKickChatMember

func (b Bot) NewSendableKickChatMember(chatId int, userId int) *sendableKickChatMember

func (Bot) NewSendableLocation

func (b Bot) NewSendableLocation(chatId int) *sendableLocation

func (Bot) NewSendableMediaGroup

func (b Bot) NewSendableMediaGroup(chatId int) *sendableMediaGroup

NewSendableMediaGroup creates a new mediagroup struct to send

func (Bot) NewSendableMessage

func (b Bot) NewSendableMessage(chatId int, text string) *sendableTextMessage

NewSendableMessage create a new message struct to send

func (Bot) NewSendablePhoto

func (b Bot) NewSendablePhoto(chatId int, caption string) *sendablePhoto

NewSendablePhoto creates a new photo struct to send

func (Bot) NewSendablePinChatMessage

func (b Bot) NewSendablePinChatMessage(chatId int, messageId int) *sendablePinChatMessage

func (Bot) NewSendablePoll

func (b Bot) NewSendablePoll(chatId int, question string, options []string) *sendablePoll

NewSendablePoll creates a new poll struct to send.

func (Bot) NewSendablePromoteChatMember

func (b Bot) NewSendablePromoteChatMember(chatId int, userId int) *sendablePromoteChatMember

note: set all as true for promotion by default

func (Bot) NewSendableRestrictChatMember

func (b Bot) NewSendableRestrictChatMember(chatId int, userId int) *sendableRestrictChatMember

func (Bot) NewSendableSetChatPermissions

func (b Bot) NewSendableSetChatPermissions(chatId int, perms ChatPermissions) *sendableSetChatPermissions

note: set all as true for promotion by default

func (Bot) NewSendableSetChatPhoto

func (b Bot) NewSendableSetChatPhoto(chatId int) *sendableSetChatPhoto

func (Bot) NewSendableSetGameScore

func (b Bot) NewSendableSetGameScore(userId int, score int, chatId int, messageId int) *sendableSetGameScore

func (Bot) NewSendableSetGameScoreInline

func (b Bot) NewSendableSetGameScoreInline(userId int, score int, inlineMessageId string) *sendableSetGameScore

func (Bot) NewSendableSticker

func (b Bot) NewSendableSticker(chatId int) *sendableSticker

func (Bot) NewSendableUploadStickerFile

func (b Bot) NewSendableUploadStickerFile(userId int) *sendableUploadStickerFile

func (Bot) NewSendableVenue

func (b Bot) NewSendableVenue(chatId int) *sendableVenue

NewSendableVenue creates a new venue struct to send

func (Bot) NewSendableVideo

func (b Bot) NewSendableVideo(chatId int, caption string) *sendableVideo

NewSendableVideo creates a new video struct to send

func (Bot) NewSendableVideoNote

func (b Bot) NewSendableVideoNote(chatId int) *sendableVideoNote

NewSendableVideoNote creates a new videonote struct to send

func (Bot) NewSendableVoice

func (b Bot) NewSendableVoice(chatId int, caption string) *sendableVoice

NewSendableVoice creates a new voice struct to send

func (Bot) ParseMessage

func (b Bot) ParseMessage(message json.RawMessage) (mess *Message, err error)

func (Bot) PinChatMessage

func (b Bot) PinChatMessage(chatId int, messageId int) (bool, error)

func (Bot) PinChatMessageQuiet

func (b Bot) PinChatMessageQuiet(chatId int, messageId int) (bool, error)

func (Bot) PromoteChatMember

func (b Bot) PromoteChatMember(chatId int, userId int) (bool, error)

func (Bot) ReplyAudioStr

func (b Bot) ReplyAudioStr(chatId int, audio string, replyToMessageId int) (*Message, error)

func (Bot) ReplyContact

func (b Bot) ReplyContact(chatId int, phoneNumber string, firstName string, replyToMessageId int) (*Message, error)

func (Bot) ReplyDocumentCaptionPath

func (b Bot) ReplyDocumentCaptionPath(chatId int, path string, caption string, replyToMessageId int) (*Message, error)

func (Bot) ReplyDocumentCaptionStr

func (b Bot) ReplyDocumentCaptionStr(chatId int, document string, caption string, replyToMessageId int) (*Message, error)

func (Bot) ReplyDocumentPath

func (b Bot) ReplyDocumentPath(chatId int, path string, replyToMessageId int) (*Message, error)

func (Bot) ReplyDocumentStr

func (b Bot) ReplyDocumentStr(chatId int, document string, replyToMessageId int) (*Message, error)

func (Bot) ReplyHTML

func (b Bot) ReplyHTML(chatId int, text string, replyToMessageId int) (*Message, error)

func (Bot) ReplyLocation

func (b Bot) ReplyLocation(chatId int, latitude float64, longitude float64, replyToMessageId int) (*Message, error)

func (Bot) ReplyMarkdown

func (b Bot) ReplyMarkdown(chatId int, text string, replyToMessageId int) (*Message, error)

func (Bot) ReplyPhotoCaptionPath

func (b Bot) ReplyPhotoCaptionPath(chatId int, path string, caption string, replyToMessageId int) (*Message, error)

func (Bot) ReplyPhotoCaptionReader

func (b Bot) ReplyPhotoCaptionReader(chatId int, reader io.Reader, caption string, replyToMessageId int) (*Message, error)

func (Bot) ReplyPhotoCaptionStr

func (b Bot) ReplyPhotoCaptionStr(chatId int, photoId string, caption string, replyToMessageId int) (*Message, error)

func (Bot) ReplyPhotoStr

func (b Bot) ReplyPhotoStr(chatId int, photoId string, replyToMessageId int) (*Message, error)

func (Bot) ReplyPoll

func (b Bot) ReplyPoll(chatId int, question string, options []string, replyToMessageId int) (*Message, error)

func (Bot) ReplyStickerPath

func (b Bot) ReplyStickerPath(chatId int, path string, replyToMessageId int) (*Message, error)

func (Bot) ReplyStickerReader

func (b Bot) ReplyStickerReader(chatId int, reader io.Reader, replyToMessageId int) (*Message, error)

func (Bot) ReplyStickerStr

func (b Bot) ReplyStickerStr(chatId int, stickerId string, replyToMessageId int) (*Message, error)

func (Bot) ReplyText

func (b Bot) ReplyText(chatId int, text string, replyToMessageId int) (*Message, error)

func (Bot) ReplyVenue

func (b Bot) ReplyVenue(chatId int, latitude float64, longitude float64, title string, address string, replyToMessageId int) (*Message, error)

func (Bot) ReplyVideoNoteStr

func (b Bot) ReplyVideoNoteStr(chatId int, videoNote string, replyToMessageId int) (*Message, error)

func (Bot) ReplyVideoStr

func (b Bot) ReplyVideoStr(chatId int, video string, replyToMessageId int) (*Message, error)

func (Bot) ReplyVoiceStr

func (b Bot) ReplyVoiceStr(chatId int, voice string, replyToMessageId int) (*Message, error)

func (Bot) RestrictChatMember

func (b Bot) RestrictChatMember(chatId int, userId int) (bool, error)

func (Bot) SendAudioStr

func (b Bot) SendAudioStr(chatId int, audio string) (*Message, error)

func (Bot) SendChatAction

func (b Bot) SendChatAction(chatId int, action string) (bool, error)

func (Bot) SendContact

func (b Bot) SendContact(chatId int, phoneNumber string, firstName string) (*Message, error)

func (Bot) SendDocumentCaptionStr

func (b Bot) SendDocumentCaptionStr(chatId int, document string, caption string) (*Message, error)

func (Bot) SendDocumentStr

func (b Bot) SendDocumentStr(chatId int, document string) (*Message, error)

func (Bot) SendGame

func (b Bot) SendGame(chatId int, gameShortName string) (*Message, error)

func (Bot) SendInvoice

func (b Bot) SendInvoice(chatId int, title string, description string, payload string,
	providerToken string, startParameter string, currency string,
	prices []LabeledPrice) (*Message, error)

TODO: all the optionals here. Best option is probably to use a builder.

func (Bot) SendLocation

func (b Bot) SendLocation(chatId int, latitude float64, longitude float64) (*Message, error)

func (Bot) SendMessage

func (b Bot) SendMessage(chatId int, text string) (*Message, error)

func (Bot) SendMessageHTML

func (b Bot) SendMessageHTML(chatId int, text string) (*Message, error)

func (Bot) SendMessageMarkdown

func (b Bot) SendMessageMarkdown(chatId int, text string) (*Message, error)

func (Bot) SendPhotoCaptionStr

func (b Bot) SendPhotoCaptionStr(chatId int, photoId string, caption string) (*Message, error)

func (Bot) SendPhotoStr

func (b Bot) SendPhotoStr(chatId int, photoId string) (*Message, error)

func (Bot) SendPoll

func (b Bot) SendPoll(chatId int, question string, options []string) (*Message, error)

func (Bot) SendStickerPath

func (b Bot) SendStickerPath(chatId int, path string) (*Message, error)

func (Bot) SendStickerReader

func (b Bot) SendStickerReader(chatId int, reader io.Reader) (*Message, error)

func (Bot) SendStickerStr

func (b Bot) SendStickerStr(chatId int, stickerId string) (*Message, error)

func (Bot) SendVenue

func (b Bot) SendVenue(chatId int, latitude float64, longitude float64, title string, address string) (*Message, error)

func (Bot) SendVideoNoteStr

func (b Bot) SendVideoNoteStr(chatId int, videoNote string) (*Message, error)

func (Bot) SendVideoStr

func (b Bot) SendVideoStr(chatId int, video string) (*Message, error)

func (Bot) SendVoiceStr

func (b Bot) SendVoiceStr(chatId int, voice string) (*Message, error)

func (Bot) SetChatDescription

func (b Bot) SetChatDescription(chatId int, description string) (bool, error)

func (Bot) SetChatPermissions

func (b Bot) SetChatPermissions(chatId int, perms ChatPermissions) (bool, error)

func (Bot) SetChatPhotoPath

func (b Bot) SetChatPhotoPath(chatId int, path string) (bool, error)

func (Bot) SetChatPhotoReader

func (b Bot) SetChatPhotoReader(chatId int, reader io.Reader) (bool, error)

func (Bot) SetChatPhotoStr

func (b Bot) SetChatPhotoStr(chatId int, photoId string) (bool, error)

func (Bot) SetChatStickerSet

func (b Bot) SetChatStickerSet(chatId int, stickerSetName string) (bool, error)

func (Bot) SetChatTitle

func (b Bot) SetChatTitle(chatId int, title string) (bool, error)

func (Bot) SetGameScore

func (b Bot) SetGameScore(userId int, score int, chatId int, messageId int) (bool, error)

func (Bot) SetGameScoreInline

func (b Bot) SetGameScoreInline(userId int, score int, inlineMessageId string) (bool, error)

func (Bot) SetPassportDataErrors

func (b Bot) SetPassportDataErrors(userId int, errors ...PassportElementError)

func (Bot) SetStickerPositionInSet

func (b Bot) SetStickerPositionInSet(sticker string, position int) (bool, error)

func (Bot) StopPoll

func (b Bot) StopPoll(chatId int, messageId int) (*Poll, error)

func (Bot) StopPollMarkup

func (b Bot) StopPollMarkup(chatId int, messageId int, replyMarkup InlineKeyboardMarkup) (*Poll, error)

func (Bot) UnRestrictChatMember

func (b Bot) UnRestrictChatMember(chatId int, userId int) (bool, error)

func (Bot) UnbanChatMember

func (b Bot) UnbanChatMember(chatId int, userId int) (bool, error)

func (Bot) UnpinChatMessage

func (b Bot) UnpinChatMessage(chatId int) (bool, error)

func (Bot) UploadStickerFilePath

func (b Bot) UploadStickerFilePath(userId int, path string) (*File, error)

func (Bot) UploadStickerFileReader

func (b Bot) UploadStickerFileReader(userId int, reader io.Reader) (*File, error)

func (Bot) UploadStickerFileStr

func (b Bot) UploadStickerFileStr(userId int, pngStickerId string) (*File, error)

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 Chat

type Chat struct {
	Bot              Bot              `json:"-"`
	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"`
}

func (Chat) DeleteMessage

func (chat Chat) DeleteMessage(messageId int) (bool, error)

func (Chat) DeletePhoto

func (chat Chat) DeletePhoto() (bool, error)

func (Chat) DeleteStickerSet

func (chat Chat) DeleteStickerSet() (bool, error)

func (Chat) DemoteMember

func (chat Chat) DemoteMember(userId int) (bool, error)
func (chat Chat) ExportInviteLink() (string, error)

func (Chat) Get

func (chat Chat) Get() (*Chat, error)

func (Chat) GetAdministrators

func (chat Chat) GetAdministrators() ([]ChatMember, error)

func (Chat) GetMember

func (chat Chat) GetMember(userId int) (*ChatMember, error)

func (Chat) GetMembersCount

func (chat Chat) GetMembersCount() (int, error)

func (Chat) KickMember

func (chat Chat) KickMember(userId int) (bool, error)

func (Chat) Leave

func (chat Chat) Leave(description string) (bool, error)

func (Chat) PinMessage

func (chat Chat) PinMessage(messageId int) (bool, error)

func (Chat) PinMessageQuiet

func (chat Chat) PinMessageQuiet(messageId int) (bool, error)

func (Chat) PromoteMember

func (chat Chat) PromoteMember(userId int) (bool, error)

func (Chat) RestrictMember

func (chat Chat) RestrictMember(userId int) (bool, error)

func (Chat) SendAction

func (chat Chat) SendAction(action string) (bool, error)

func (Chat) SetChatPermissions

func (chat Chat) SetChatPermissions(perms ChatPermissions) (bool, error)

func (Chat) SetChatPhotoPath

func (chat Chat) SetChatPhotoPath(path string) (bool, error)

func (Chat) SetChatPhotoReader

func (chat Chat) SetChatPhotoReader(reader io.Reader) (bool, error)

func (Chat) SetChatPhotoStr

func (chat Chat) SetChatPhotoStr(photoId string) (bool, error)

func (Chat) SetDescription

func (chat Chat) SetDescription(description string) (bool, error)

func (Chat) SetStickerSet

func (chat Chat) SetStickerSet(stickerSetName string) (bool, error)

func (Chat) SetTitle

func (chat Chat) SetTitle(title string) (bool, error)

func (Chat) UnbanMember

func (chat Chat) UnbanMember(userId int) (bool, error)

func (Chat) UnpinMessage

func (chat Chat) UnpinMessage() (bool, error)

type ChatMember

type ChatMember struct {
	User                  *User  `json:"user"`
	Status                string `json:"status"`
	UntilDate             int64  `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"`
	CanChangeInfo         bool   `json:"can_change_info"`
	CanInviteUsers        bool   `json:"can_invite_users"`
	CanPinMessages        bool   `json:"can_pin_messages"`
	IsMember              bool   `json:"is_member"`
	CanSendMessages       bool   `json:"can_send_messages"`
	CanSendMediaMessages  bool   `json:"can_send_media_messages"`
	CanSendPolls          bool   `json:"can_send_media_messages"`
	CanSendOtherMessages  bool   `json:"can_send_other_messages"`
	CanAddWebPagePreviews bool   `json:"can_add_web_page_previews"`
}

type ChatPermissions

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

type ChatPhoto

type ChatPhoto struct {
	SmallFileId string `json:"small_file_id"`
	BigFileId   string `json:"big_file_id"`
}

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

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 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 File

type File struct {
	FileId   string `json:"file_id"`
	FileSize int    `json:"file_size"`
	FilePath string `json:"file_path"`
	// contains filtered or unexported fields
}

type ForceReply

type ForceReply struct {
	ForceReply bool `json:"force_reply"`
	Selective  bool `json:"selective"`
}

func (*ForceReply) Marshal

func (rkm *ForceReply) Marshal() ([]byte, error)

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 GameHighScore

type GameHighScore struct {
	Position int  `json:"position"`
	User     User `json:"user"`
	Score    int  `json:"score"`
}

type InlineKeyboardButton

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

type InlineKeyboardMarkup

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

func (*InlineKeyboardMarkup) Marshal

func (rkm *InlineKeyboardMarkup) Marshal() ([]byte, error)

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 InlineQueryResult

type InlineQueryResult struct{}

type InlineQueryResultArticle

type InlineQueryResultArticle struct {
	InlineQueryResult
	Type                string               `json:"type"`
	Id                  string               `json:"id"`
	Title               string               `json:"title"`
	InputMessageContent InputMessageContent  `json:"input_message_content"`
	ReplyMarkup         InlineKeyboardMarkup `json:"reply_markup"`
	Url                 string               `json:"url"`
	HideUrl             bool                 `json:"hide_url"`
	Description         string               `json:"description"`
	ThumbUrl            string               `json:"thumb_url"`
	ThumbWidth          int                  `json:"thumb_width"`
	ThumbHeight         int                  `json:"thumb_height"`
}

type InlineQueryResultAudio

type InlineQueryResultAudio struct {
	InlineQueryResult
	Type                string               `json:"type"`
	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         InlineKeyboardMarkup `json:"reply_markup"`
	InputMessageContent InputMessageContent  `json:"input_message_content"`
}

type InlineQueryResultCachedAudio

type InlineQueryResultCachedAudio struct {
	InlineQueryResult
	Type                string               `json:"type"`
	Id                  string               `json:"id"`
	AudioFileId         string               `json:"audio_file_id"`
	Caption             string               `json:"caption"`
	ReplyMarkup         InlineKeyboardMarkup `json:"reply_markup"`
	InputMessageContent InputMessageContent  `json:"input_message_content"`
}

type InlineQueryResultCachedDocument

type InlineQueryResultCachedDocument struct {
	InlineQueryResult
	Type                string               `json:"type"`
	Id                  string               `json:"id"`
	Title               string               `json:"title"`
	DocumentFileId      string               `json:"document_file_id"`
	Description         string               `json:"description"`
	Caption             string               `json:"caption"`
	ReplyMarkup         InlineKeyboardMarkup `json:"reply_markup"`
	InputMessageContent InputMessageContent  `json:"input_message_content"`
}

type InlineQueryResultCachedGif

type InlineQueryResultCachedGif struct {
	InlineQueryResult
	Type                string               `json:"type"`
	Id                  string               `json:"id"`
	GifFileId           string               `json:"gif_file_id"`
	Title               string               `json:"title"`
	Caption             string               `json:"caption"`
	ReplyMarkup         InlineKeyboardMarkup `json:"reply_markup"`
	InputMessageContent InputMessageContent  `json:"input_message_content"`
}

type InlineQueryResultCachedMpeg4Gif

type InlineQueryResultCachedMpeg4Gif struct {
	InlineQueryResult
	Type                string               `json:"type"`
	Id                  string               `json:"id"`
	Mpeg4FileId         string               `json:"mpeg4_file_id"`
	Title               string               `json:"title"`
	Caption             string               `json:"caption"`
	ReplyMarkup         InlineKeyboardMarkup `json:"reply_markup"`
	InputMessageContent InputMessageContent  `json:"input_message_content"`
}

type InlineQueryResultCachedPhoto

type InlineQueryResultCachedPhoto struct {
	InlineQueryResult
	Type                string               `json:"type"`
	Id                  string               `json:"id"`
	PhotoFileId         string               `json:"photo_file_id"`
	Title               string               `json:"title"`
	Description         string               `json:"description"`
	Caption             string               `json:"caption"`
	ReplyMarkup         InlineKeyboardMarkup `json:"reply_markup"`
	InputMessageContent InputMessageContent  `json:"input_message_content"`
}

type InlineQueryResultCachedSticker

type InlineQueryResultCachedSticker struct {
	InlineQueryResult
	Type                string               `json:"type"`
	Id                  string               `json:"id"`
	StickerFileId       string               `json:"sticker_file_id"`
	ReplyMarkup         InlineKeyboardMarkup `json:"reply_markup"`
	InputMessageContent InputMessageContent  `json:"input_message_content"`
}

type InlineQueryResultCachedVideo

type InlineQueryResultCachedVideo struct {
	InlineQueryResult
	Type                string               `json:"type"`
	Id                  string               `json:"id"`
	VideoFileId         string               `json:"video_file_id"`
	Title               string               `json:"title"`
	Description         string               `json:"description"`
	Caption             string               `json:"caption"`
	ReplyMarkup         InlineKeyboardMarkup `json:"reply_markup"`
	InputMessageContent InputMessageContent  `json:"input_message_content"`
}

type InlineQueryResultCachedVoice

type InlineQueryResultCachedVoice struct {
	InlineQueryResult
	Type                string               `json:"type"`
	Id                  string               `json:"id"`
	VoiceFileId         string               `json:"voice_file_id"`
	Title               string               `json:"title"`
	Caption             string               `json:"caption"`
	ReplyMarkup         InlineKeyboardMarkup `json:"reply_markup"`
	InputMessageContent InputMessageContent  `json:"input_message_content"`
}

type InlineQueryResultContact

type InlineQueryResultContact struct {
	InlineQueryResult
	Type                string               `json:"type"`
	Id                  string               `json:"id"`
	PhoneNumber         string               `json:"phone_number"`
	FirstName           string               `json:"first_name"`
	LastName            string               `json:"last_name"`
	ReplyMarkup         InlineKeyboardMarkup `json:"reply_markup"`
	InputMessageContent InputMessageContent  `json:"input_message_content"`
	ThumbUrl            string               `json:"thumb_url"`
	ThumbWidth          int                  `json:"thumb_width"`
	ThumbHeight         int                  `json:"thumb_height"`
}

type InlineQueryResultDocument

type InlineQueryResultDocument struct {
	InlineQueryResult
	Type                string               `json:"type"`
	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         InlineKeyboardMarkup `json:"reply_markup"`
	InputMessageContent InputMessageContent  `json:"input_message_content"`
	ThumbUrl            string               `json:"thumb_url"`
	ThumbWidth          int                  `json:"thumb_width"`
	ThumbHeight         int                  `json:"thumb_height"`
}

type InlineQueryResultGame

type InlineQueryResultGame struct {
	InlineQueryResult
	Type          string               `json:"type"`
	Id            string               `json:"id"`
	GameShortName string               `json:"game_short_name"`
	ReplyMarkup   InlineKeyboardMarkup `json:"reply_markup"`
}

type InlineQueryResultGif

type InlineQueryResultGif struct {
	InlineQueryResult
	Type                string               `json:"type"`
	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         InlineKeyboardMarkup `json:"reply_markup"`
	InputMessageContent InputMessageContent  `json:"input_message_content"`
}

type InlineQueryResultLocation

type InlineQueryResultLocation struct {
	InlineQueryResult
	Type                string               `json:"type"`
	Id                  string               `json:"id"`
	Latitude            float64              `json:"latitude"`
	Longitude           float64              `json:"longitude"`
	Title               string               `json:"title"`
	ReplyMarkup         InlineKeyboardMarkup `json:"reply_markup"`
	InputMessageContent InputMessageContent  `json:"input_message_content"`
	ThumbUrl            string               `json:"thumb_url"`
	ThumbWidth          int                  `json:"thumb_width"`
	ThumbHeight         int                  `json:"thumb_height"`
}

type InlineQueryResultMpeg4Gif

type InlineQueryResultMpeg4Gif struct {
	InlineQueryResult
	Type                string               `json:"type"`
	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         InlineKeyboardMarkup `json:"reply_markup"`
	InputMessageContent InputMessageContent  `json:"input_message_content"`
}

type InlineQueryResultPhoto

type InlineQueryResultPhoto struct {
	InlineQueryResult
	Type                string               `json:"type"`
	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         InlineKeyboardMarkup `json:"reply_markup"`
	InputMessageContent InputMessageContent  `json:"input_message_content"`
}

type InlineQueryResultVenue

type InlineQueryResultVenue struct {
	InlineQueryResult
	Type                string               `json:"type"`
	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         InlineKeyboardMarkup `json:"reply_markup"`
	InputMessageContent InputMessageContent  `json:"input_message_content"`
	ThumbUrl            string               `json:"thumb_url"`
	ThumbWidth          int                  `json:"thumb_width"`
	ThumbHeight         int                  `json:"thumb_height"`
}

type InlineQueryResultVideo

type InlineQueryResultVideo struct {
	InlineQueryResult
	Type                string               `json:"type"`
	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         InlineKeyboardMarkup `json:"reply_markup"`
	InputMessageContent InputMessageContent  `json:"input_message_content"`
}

type InlineQueryResultVoice

type InlineQueryResultVoice struct {
	InlineQueryResult
	Type                string               `json:"type"`
	Id                  string               `json:"id"`
	VoiceUrl            string               `json:"voice_url"`
	Title               string               `json:"title"`
	Caption             string               `json:"caption"`
	VoiceDuration       int                  `json:"voice_duration"`
	ReplyMarkup         InlineKeyboardMarkup `json:"reply_markup"`
	InputMessageContent InputMessageContent  `json:"input_message_content"`
}

type InputContactMessageContent

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

type InputLocationMessageContent

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

type InputMedia

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

type InputMediaAnimation

type InputMediaAnimation struct {

	// TODO: sort out thumbnails
	// Thumb    file
	Width    int
	Height   int
	Duration int
	// contains filtered or unexported fields
}

type InputMediaAudio

type InputMediaAudio struct {
	Thumb     file
	Duration  int
	Performer string
	Title     string
	// contains filtered or unexported fields
}

type InputMediaDocument

type InputMediaDocument struct {
	Thumb file
	// contains filtered or unexported fields
}

type InputMediaPhoto

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

type InputMediaVideo

type InputMediaVideo struct {
	Thumb            file
	Width            int
	Height           int
	Duration         int
	SupportStreaming bool
	// contains filtered or unexported fields
}

type InputMessageContent

type InputMessageContent struct{}

type InputTextMessageContent

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

type InputVenueMessageContent

type InputVenueMessageContent struct {
	InputMessageContent
	Latitude     float64 `json:"latitude"`
	Longitude    float64 `json:"longitude"`
	Title        string  `json:"title"`
	Address      string  `json:"address"`
	FoursquareId string  `json:"foursquare_id"`
}

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"`
	RequestLocation bool   `json:"request_location"`
}

type LabeledPrice

type LabeledPrice struct {
	Label  string `json:"label"`
	Amount int    `json:"amount"`
}

type Location

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

type LoginUrl

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

type MaskPosition

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

type Message

type Message struct {
	Bot                   Bot                   `json:"-"`
	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"`
	// contains filtered or unexported fields
}

func (Message) Delete

func (m Message) Delete() (bool, error)

func (Message) EditHTML

func (m Message) EditHTML(text string) (*Message, error)

func (Message) EditHTMLf

func (m Message) EditHTMLf(format string, a ...interface{}) (*Message, error)

func (Message) EditMarkdown

func (m Message) EditMarkdown(text string) (*Message, error)

func (Message) EditMarkdownf

func (m Message) EditMarkdownf(format string, a ...interface{}) (*Message, error)

func (Message) EditText

func (m Message) EditText(text string) (*Message, error)

func (Message) EditTextf

func (m Message) EditTextf(format string, a ...interface{}) (*Message, error)

func (Message) Forward

func (m Message) Forward(chatId int) (*Message, error)

func (*Message) OriginalCaption

func (m *Message) OriginalCaption() string

func (*Message) OriginalCaptionHTML

func (m *Message) OriginalCaptionHTML() string

func (*Message) OriginalHTML

func (m *Message) OriginalHTML() string

func (*Message) OriginalText

func (m *Message) OriginalText() string

func (*Message) ParseCaptionEntities

func (m *Message) ParseCaptionEntities() (out []ParsedMessageEntity)

func (*Message) ParseCaptionEntity

func (m *Message) ParseCaptionEntity(entity MessageEntity) ParsedMessageEntity

func (*Message) ParseCaptionEntityTypes

func (m *Message) ParseCaptionEntityTypes(accepted map[string]struct{}) (out []ParsedMessageEntity)

func (*Message) ParseEntities

func (m *Message) ParseEntities() (out []ParsedMessageEntity)

func (*Message) ParseEntity

func (m *Message) ParseEntity(entity MessageEntity) ParsedMessageEntity

func (*Message) ParseEntityTypes

func (m *Message) ParseEntityTypes(accepted map[string]struct{}) (out []ParsedMessageEntity)

func (Message) ReplyAudioStr

func (m Message) ReplyAudioStr(audio string) (*Message, error)

func (Message) ReplyDocumentStr

func (m Message) ReplyDocumentStr(document string) (*Message, error)

func (Message) ReplyHTML

func (m Message) ReplyHTML(text string) (*Message, error)

func (Message) ReplyHTMLf

func (m Message) ReplyHTMLf(format string, a ...interface{}) (*Message, error)

func (Message) ReplyLocation

func (m Message) ReplyLocation(latitude float64, longitude float64) (*Message, error)

func (Message) ReplyMarkdown

func (m Message) ReplyMarkdown(text string) (*Message, error)

func (Message) ReplyMarkdownf

func (m Message) ReplyMarkdownf(format string, a ...interface{}) (*Message, error)

func (Message) ReplyPhotoStr

func (m Message) ReplyPhotoStr(photo string) (*Message, error)

func (Message) ReplyStickerStr

func (m Message) ReplyStickerStr(sticker string) (*Message, error)

func (Message) ReplyText

func (m Message) ReplyText(text string) (*Message, error)

func (Message) ReplyTextf

func (m Message) ReplyTextf(format string, a ...interface{}) (*Message, error)

func (Message) ReplyVenue

func (m Message) ReplyVenue(latitude float64, longitude float64, title string, address string) (*Message, error)

func (Message) ReplyVideoNoteStr

func (m Message) ReplyVideoNoteStr(videoNote string) (*Message, error)

func (Message) ReplyVideoStr

func (m Message) ReplyVideoStr(video string) (*Message, error)

func (Message) ReplyVoiceStr

func (m Message) ReplyVoiceStr(voice string) (*Message, error)

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

type OrderInfo

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

type ParsedMessageEntity

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

type PassportData

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

type PassportElementError

type PassportElementError interface {
	Data() (url.Values, error) // return interface as url values
}

type PassportElementErrorDataField

type PassportElementErrorDataField struct {
	BasePassportError
	FieldName string
	DataHash  string
}

func (PassportElementErrorDataField) Data

type PassportElementErrorFile

type PassportElementErrorFile struct {
	BasePassportError
	FileHash string
}

func (PassportElementErrorFile) Data

type PassportElementErrorFiles

type PassportElementErrorFiles struct {
	BasePassportError
	FileHashes []string
}

func (PassportElementErrorFiles) Data

type PassportElementErrorFrontSide

type PassportElementErrorFrontSide struct {
	BasePassportError
	FileHash string
}

func (PassportElementErrorFrontSide) Data

type PassportElementErrorReverseSide

type PassportElementErrorReverseSide struct {
	BasePassportError
	FileHash string
}

func (PassportElementErrorReverseSide) Data

type PassportElementErrorSelfie

type PassportElementErrorSelfie struct {
	BasePassportError
	FileHash string
}

func (PassportElementErrorSelfie) Data

type PassportElementErrorTranslationFile

type PassportElementErrorTranslationFile struct {
	BasePassportError
	FileHash string
}

func (PassportElementErrorTranslationFile) Data

type PassportElementErrorTranslationFiles

type PassportElementErrorTranslationFiles struct {
	BasePassportError
	FileHashes []string
}

func (PassportElementErrorTranslationFiles) Data

type PassportElementErrorUnspecified

type PassportElementErrorUnspecified struct {
	BasePassportError
	ElementHash string
}

func (PassportElementErrorUnspecified) Data

type PassportFile

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

type PhotoSize

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

type Poll

type Poll struct {
	Bot      Bot          `json:"-"`
	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 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"`
	OneTimeKeyboard bool                `json:"one_time_keyboard"`
	Selective       bool                `json:"selective"`
}

func (*ReplyKeyboardMarkup) Marshal

func (rkm *ReplyKeyboardMarkup) Marshal() ([]byte, error)

type ReplyKeyboardRemove

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

func (*ReplyKeyboardRemove) Marshal

func (rkm *ReplyKeyboardRemove) Marshal() ([]byte, error)

type ReplyMarkup

type ReplyMarkup interface {
	Marshal() ([]byte, error)
}

type Response

type Response struct {
	Ok          bool
	Result      json.RawMessage
	ErrorCode   int `json:"error_code"`
	Description string
	Parameters  json.RawMessage
}

func Get

func Get(bot Bot, method string, params url.Values) (*Response, error)

func Post

func Post(bot Bot, fileType string, method string, params url.Values, file io.Reader, filename string) (*Response, error)

type ResponseParameters

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

type Sendable

type Sendable interface {
	Send() (*Message, error)
}

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

type ShippingOption

type ShippingOption struct {
	Id     string         `json:"id"`
	Title  string         `json:"title"`
	Prices []LabeledPrice `json:"prices"`
}

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 StickerSet

type StickerSet struct {
	Name          string    `json:"name"`
	Title         string    `json:"title"`
	IsAnimated    bool      `json:"is_animated"`
	ContainsMasks bool      `json:"contains_masks"`
	Stickers      []Sticker `json:"stickers"`
	// contains filtered or unexported fields
}

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 TgBotGetter

type TgBotGetter struct {
	Client *http.Client
	ApiUrl string
}

func (*TgBotGetter) Get

func (tbg *TgBotGetter) Get(bot Bot, method string, params url.Values) (*Response, error)

func (*TgBotGetter) Post

func (tbg *TgBotGetter) Post(bot Bot, fileType string, method string, params url.Values, file io.Reader, filename string) (*Response, error)

type TgBotGetterInterface

type TgBotGetterInterface interface {
	Get(bot Bot, method string, params url.Values) (*Response, error)
	Post(bot Bot, fileType string, method string, params url.Values, file io.Reader, filename string) (*Response, error)
}

type User

type User struct {
	Bot          Bot    `json:"-"`
	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"`
}

func (User) GetProfilePhotos

func (user User) GetProfilePhotos(offset int, limit int) (*UserProfilePhotos, error)

GetProfilePhotos Retrieves a user's profile pictures

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

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 Voice

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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