Documentation
¶
Index ¶
- Constants
- Variables
- type Animation
- type Audio
- type BasePassportError
- type BaseRequester
- type Bot
- func (b Bot) AddPngStickerToSet(userId int, name string, pngSticker InputFile, emojis string) (bool, error)
- func (b Bot) AddTgsStickerToSet(userId int, name string, tgsSticker InputFile, emojis string) (bool, error)
- func (b Bot) AnswerCallbackQuery(callbackQueryId string) (bool, error)
- func (b Bot) AnswerCallbackQueryText(callbackQueryId string, text string, alert bool) (bool, error)
- func (b Bot) AnswerCallbackQueryURL(callbackQueryId string, url string) (bool, error)
- func (b Bot) AnswerInlineQuery(inlineQueryId string, results []InlineQueryResult) (bool, error)
- func (b Bot) AnswerPreCheckoutQuery(preCheckoutQueryId string, ok bool) (bool, error)
- func (b Bot) AnswerShippingQuery(shippingQueryId string, ok bool) (bool, error)
- func (b Bot) Close() (bool, error)
- func (b Bot) CreateNewPngStickerSet(userId int, name string, title string, pngSticker InputFile, emojis string) (bool, error)
- func (b Bot) CreateNewTgsStickerSet(userId int, name string, title string, tgsSticker InputFile, emojis string) (bool, error)
- func (b Bot) DeleteChatPhoto(chatId int) (bool, error)
- func (b Bot) DeleteChatStickerSet(chatId int) (bool, error)
- func (b Bot) DeleteMessage(chatId int, messageId int) (bool, error)
- func (b Bot) DeleteStickerFromSet(sticker string) (bool, error)
- func (b Bot) DeleteWebhook() (bool, error)
- func (b Bot) DeleteWebhookDrop(dropUpdates bool) (bool, error)
- func (b Bot) DemoteChatMember(chatId int, userId int) (bool, error)
- func (b Bot) EditMessage(chatId int, messageId int, text string, parseMode string) (*Message, error)
- func (b Bot) EditMessageCaption(chatId int, messageId int, caption string) (*Message, error)
- func (b Bot) EditMessageCaptionInline(inlineMessageId string, caption string) (*Message, error)
- func (b Bot) EditMessageCaptionMarkup(chatId int, messageId int, caption string, markup ReplyMarkup) (*Message, error)
- func (b Bot) EditMessageCaptionParseMode(chatId int, messageId int, caption string, parseMode string) (*Message, error)
- func (b Bot) EditMessageHTML(chatId int, messageId int, text string) (*Message, error)
- func (b Bot) EditMessageHTMLInline(inlineMessageId string, text string) (*Message, error)
- func (b Bot) EditMessageInline(inlineMessageId string, text string, parseMode string) (*Message, error)
- func (b Bot) EditMessageMarkdown(chatId int, messageId int, text string) (*Message, error)
- func (b Bot) EditMessageMarkdownInline(inlineMessageId string, text string) (*Message, error)
- func (b Bot) EditMessageMarkdownV2(chatId int, messageId int, text string) (*Message, error)
- func (b Bot) EditMessageMarkdownV2Inline(inlineMessageId string, text string) (*Message, error)
- func (b Bot) EditMessageReplyMarkup(chatId int, messageId int, replyMarkup InlineKeyboardMarkup) (*Message, error)
- func (b Bot) EditMessageReplyMarkupInline(inlineMessageId string, replyMarkup InlineKeyboardMarkup) (*Message, error)
- func (b Bot) EditMessageText(chatId int, messageId int, text string) (*Message, error)
- func (b Bot) EditMessageTextInline(inlineMessageId string, text string) (*Message, error)
- 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 (b Bot) ForwardMessage(chatId int, fromChatId int, messageId int) (*Message, error)
- func (b Bot) Get(method string, params url.Values) (json.RawMessage, error)
- func (b Bot) GetChat(chatId int) (*Chat, error)
- func (b Bot) GetChatAdministrators(chatId int) ([]ChatMember, error)
- func (b Bot) GetChatMember(chatId int, userId int) (*ChatMember, error)
- func (b Bot) GetChatMembersCount(chatId int) (int, error)
- func (b Bot) GetFile(fileId string) (*File, error)
- func (b Bot) GetGameHighScores(userId int, chatId int, messageId int) ([]GameHighScore, error)
- func (b Bot) GetGameHighScoresInline(userId int, inlineMessageId string) ([]GameHighScore, error)
- func (b Bot) GetMe() (*User, error)
- func (b Bot) GetMyCommands() ([]BotCommand, error)
- func (b Bot) GetStickerSet(name string) (*StickerSet, error)
- func (b Bot) GetUserProfilePhotos(userId int, offset int, limit int) (*UserProfilePhotos, error)
- func (b Bot) GetWebhookInfo() (*WebhookInfo, error)
- func (b Bot) KickChatMember(chatId int, userId int) (bool, error)
- func (b Bot) KickChatMemberUntil(chatId int, userId int, untilDate int64) (bool, error)
- func (b Bot) LeaveChat(chatId int) (bool, error)
- func (b Bot) LogOut() (bool, error)
- func (b Bot) NewFileId(fileId string) InputFile
- func (b Bot) NewFileReader(name string, r io.Reader) InputFile
- func (b Bot) NewFileURL(url string) InputFile
- func (b Bot) NewSendableAddStickerToSet(userId int, name string, emojis string) *sendableAddStickerToSet
- func (b Bot) NewSendableAnimation(chatId int, caption string) *sendableAnimation
- func (b Bot) NewSendableAnswerCallbackQuery(queryId string) *sendableCallbackQuery
- func (b Bot) NewSendableAnswerInlineQuery(inlineQueryId string, results []InlineQueryResult) *sendableAnswerInlineQuery
- func (b Bot) NewSendableAnswerPreCheckoutQuery(shippingQueryId string, ok bool) *sendableAnswerPreCheckoutQuery
- func (b Bot) NewSendableAnswerShippingQuery(shippingQueryId string, ok bool) *sendableAnswerShippingQuery
- func (b Bot) NewSendableAudio(chatId int, caption string) *sendableAudio
- func (b Bot) NewSendableChatAction(chatId int) *sendableChatAction
- func (b Bot) NewSendableContact(chatId int) *sendableContact
- func (b Bot) NewSendableCopyMessage(chatId int, fromChatId int, messageId int) *sendableCopyMessage
- func (b Bot) NewSendableCreateNewStickerSet(userId int, name string, title string, emojis string) *sendableCreateNewStickerSet
- func (b Bot) NewSendableDice(chatId int) *sendableDice
- func (b Bot) NewSendableDocument(chatId int, caption string) *sendableDocument
- func (b Bot) NewSendableEditMessageCaption(chatId int, messageId int, caption string) *sendableEditMessageCaption
- func (b Bot) NewSendableEditMessageLiveLocation(chatId int, latitude float64, longitude float64) *sendableEditMessageLiveLocation
- func (b Bot) NewSendableEditMessageMedia(chatId int, messageId int) *sendableEditMessageMedia
- func (b Bot) NewSendableEditMessageReplyMarkup(chatId int, messageId int, markup ReplyMarkup) *sendableEditMessageReplyMarkup
- func (b Bot) NewSendableEditMessageText(chatId int, messageId int, text string) *sendableEditMessageText
- func (b Bot) NewSendableGame(chatId int, gameShortName string) *sendableGame
- func (b Bot) NewSendableGetGameHighScore(userId int, chatId int, messageId int) *sendableGetGameHighScores
- func (b Bot) NewSendableGetGameHighScoreInline(userId int, inlineMessageId string) *sendableGetGameHighScores
- func (b Bot) NewSendableInvoice(chatId int, title string, description string, payload string, ...) *sendableInvoice
- func (b Bot) NewSendableKickChatMember(chatId int, userId int) *sendableKickChatMember
- func (b Bot) NewSendableLocation(chatId int) *sendableLocation
- func (b Bot) NewSendableMediaGroup(chatId int) *sendableMediaGroup
- func (b Bot) NewSendableMessage(chatId int, text string) *sendableTextMessage
- func (b Bot) NewSendablePhoto(chatId int, caption string) *sendablePhoto
- func (b Bot) NewSendablePinChatMessage(chatId int, messageId int) *sendablePinChatMessage
- func (b Bot) NewSendablePoll(chatId int, question string, options []string) *sendablePoll
- func (b Bot) NewSendablePromoteChatMember(chatId int, userId int) *sendablePromoteChatMember
- func (b Bot) NewSendableRestrictChatMember(chatId int, userId int) *sendableRestrictChatMember
- func (b Bot) NewSendableSetChatAdministratorCustomTitle(chatId int, userId int, customTitle string) *sendableSetChatAdministratorCustomTitle
- func (b Bot) NewSendableSetChatPermissions(chatId int, perms ChatPermissions) *sendableSetChatPermissions
- func (b Bot) NewSendableSetChatPhoto(chatId int) *sendableSetChatPhoto
- func (b Bot) NewSendableSetGameScore(userId int, score int, chatId int, messageId int) *sendableSetGameScore
- func (b Bot) NewSendableSetGameScoreInline(userId int, score int, inlineMessageId string) *sendableSetGameScore
- func (b Bot) NewSendableSetStickerSetThumb(userId int) *sendableSetStickerSetThumb
- func (b Bot) NewSendableSticker(chatId int) *sendableSticker
- func (b Bot) NewSendableStopMessageLiveLocation(chatId int) *sendableStopMessageLiveLocation
- func (b Bot) NewSendableUploadStickerFile(userId int) *sendableUploadStickerFile
- func (b Bot) NewSendableVenue(chatId int) *sendableVenue
- func (b Bot) NewSendableVideo(chatId int, caption string) *sendableVideo
- func (b Bot) NewSendableVideoNote(chatId int) *sendableVideoNote
- func (b Bot) NewSendableVoice(chatId int, caption string) *sendableVoice
- func (b Bot) ParseMessage(message json.RawMessage) (mess *Message, err error)
- func (b Bot) PinChatMessage(chatId int, messageId int) (bool, error)
- func (b Bot) PinChatMessageQuiet(chatId int, messageId int) (bool, error)
- func (b Bot) Post(method string, params url.Values, data map[string]PostFile) (json.RawMessage, error)
- func (b Bot) PromoteChatMember(chatId int, userId int) (bool, error)
- func (b Bot) ReplyAudio(chatId int, audio InputFile, replyToMessageId int) (*Message, error)
- func (b Bot) ReplyContact(chatId int, phoneNumber string, firstName string, replyToMessageId int) (*Message, error)
- func (b Bot) ReplyDocument(chatId int, document InputFile, replyToMessageId int) (*Message, error)
- func (b Bot) ReplyDocumentCaption(chatId int, document InputFile, caption string, replyToMessageId int) (*Message, error)
- func (b Bot) ReplyHTML(chatId int, text string, replyToMessageId int) (*Message, error)
- func (b Bot) ReplyLocation(chatId int, latitude float64, longitude float64, replyToMessageId int) (*Message, error)
- func (b Bot) ReplyMarkdown(chatId int, text string, replyToMessageId int) (*Message, error)
- func (b Bot) ReplyMarkdownV2(chatId int, text string, replyToMessageId int) (*Message, error)
- func (b Bot) ReplyPhoto(chatId int, photo InputFile, replyToMessageId int) (*Message, error)
- func (b Bot) ReplyPhotoCaption(chatId int, photo InputFile, caption string, replyToMessageId int) (*Message, error)
- func (b Bot) ReplyPoll(chatId int, question string, options []string, replyToMessageId int) (*Message, error)
- func (b Bot) ReplySticker(chatId int, s InputFile, replyToMessageId int) (*Message, error)
- func (b Bot) ReplyText(chatId int, text string, replyToMessageId int) (*Message, error)
- func (b Bot) ReplyVenue(chatId int, latitude float64, longitude float64, title string, address string, ...) (*Message, error)
- func (b Bot) ReplyVideo(chatId int, video InputFile, replyToMessageId int) (*Message, error)
- func (b Bot) ReplyVideoNote(chatId int, videoNote InputFile, replyToMessageId int) (*Message, error)
- func (b Bot) ReplyVoice(chatId int, voice InputFile, replyToMessageId int) (*Message, error)
- func (b Bot) RestrictChatMember(chatId int, userId int) (bool, error)
- func (b Bot) SendAudio(chatId int, audio InputFile) (*Message, error)
- func (b Bot) SendChatAction(chatId int, action string) (bool, error)
- func (b Bot) SendContact(chatId int, phoneNumber string, firstName string) (*Message, error)
- func (b Bot) SendDocument(chatId int, document InputFile) (*Message, error)
- func (b Bot) SendDocumentCaption(chatId int, document InputFile, caption string) (*Message, error)
- func (b Bot) SendGame(chatId int, gameShortName string) (*Message, error)
- func (b Bot) SendInvoice(chatId int, title string, description string, payload string, ...) (*Message, error)
- func (b Bot) SendLocation(chatId int, latitude float64, longitude float64) (*Message, error)
- func (b Bot) SendMessage(chatId int, text string) (*Message, error)
- func (b Bot) SendMessageHTML(chatId int, text string) (*Message, error)
- func (b Bot) SendMessageMarkdown(chatId int, text string) (*Message, error)
- func (b Bot) SendMessageMarkdownV2(chatId int, text string) (*Message, error)
- func (b Bot) SendPhoto(chatId int, photo InputFile) (*Message, error)
- func (b Bot) SendPhotoCaption(chatId int, photo InputFile, caption string) (*Message, error)
- func (b Bot) SendPoll(chatId int, question string, options []string) (*Message, error)
- func (b Bot) SendSticker(chatId int, s InputFile) (*Message, error)
- func (b Bot) SendVenue(chatId int, latitude float64, longitude float64, title string, address string) (*Message, error)
- func (b Bot) SendVideo(chatId int, video InputFile) (*Message, error)
- func (b Bot) SendVideoNote(chatId int, videoNote InputFile) (*Message, error)
- func (b Bot) SendVoice(chatId int, voice InputFile) (*Message, error)
- func (b Bot) SetChatAdministratorCustomTitle(chatId int, userId int, customTitle string) (bool, error)
- func (b Bot) SetChatDescription(chatId int, description string) (bool, error)
- func (b Bot) SetChatPermissions(chatId int, perms ChatPermissions) (bool, error)
- func (b Bot) SetChatPhoto(chatId int, photo InputFile) (bool, error)
- func (b Bot) SetChatStickerSet(chatId int, stickerSetName string) (bool, error)
- func (b Bot) SetChatTitle(chatId int, title string) (bool, error)
- func (b Bot) SetGameScore(userId int, score int, chatId int, messageId int) (bool, error)
- func (b Bot) SetGameScoreInline(userId int, score int, inlineMessageId string) (bool, error)
- func (b Bot) SetMyCommands(cmds []BotCommand) (bool, error)
- func (b Bot) SetPassportDataErrors(userId int, errors ...PassportElementError)
- func (b Bot) SetStickerPositionInSet(sticker string, position int) (bool, error)
- func (b Bot) SetWebhook(path string, webhook Webhook) (bool, error)
- func (b Bot) StopPoll(chatId int, messageId int) (*Poll, error)
- func (b Bot) StopPollMarkup(chatId int, messageId int, replyMarkup InlineKeyboardMarkup) (*Poll, error)
- func (b Bot) UnRestrictChatMember(chatId int, userId int) (bool, error)
- func (b Bot) UnbanChatMember(chatId int, userId int) (bool, error)
- func (b Bot) UnbanChatMemberOnlyIfBanned(chatId int, userId int, onlyIfBanned bool) (bool, error)
- func (b Bot) UnpinAllChatMessages(chatId int) (bool, error)
- func (b Bot) UnpinChatMessage(chatId int) (bool, error)
- func (b Bot) UnpinChatMessageById(chatId int, messageId int) (bool, error)
- func (b Bot) UploadSticker(userId int, s InputFile) (*File, error)
- type BotCommand
- type CallbackQuery
- type Chat
- func (chat Chat) DeleteMessage(messageId int) (bool, error)
- func (chat Chat) DeletePhoto() (bool, error)
- func (chat Chat) DeleteStickerSet() (bool, error)
- func (chat Chat) DemoteMember(userId int) (bool, error)
- func (chat Chat) ExportInviteLink() (string, error)
- func (chat Chat) Get() (*Chat, error)
- func (chat Chat) GetAdministrators() ([]ChatMember, error)
- func (chat Chat) GetMember(userId int) (*ChatMember, error)
- func (chat Chat) GetMembersCount() (int, error)
- func (chat Chat) KickMember(userId int) (bool, error)
- func (chat Chat) Leave() (bool, error)
- func (chat Chat) PinMessage(messageId int) (bool, error)
- func (chat Chat) PinMessageQuiet(messageId int) (bool, error)
- func (chat Chat) PromoteMember(userId int) (bool, error)
- func (chat Chat) RestrictMember(userId int) (bool, error)
- func (chat Chat) SendAction(action string) (bool, error)
- func (chat Chat) SetAdministratorCustomTitle(userId int, customTitle string) (bool, error)
- func (chat Chat) SetChatPermissions(perms ChatPermissions) (bool, error)
- func (chat Chat) SetChatPhoto(photo InputFile) (bool, error)
- func (chat Chat) SetDescription(description string) (bool, error)
- func (chat Chat) SetStickerSet(stickerSetName string) (bool, error)
- func (chat Chat) SetTitle(title string) (bool, error)
- func (chat Chat) UnRestrictMember(userId int) (bool, error)
- func (chat Chat) UnbanMember(userId int) (bool, error)
- func (chat Chat) UnpinAll() (bool, error)
- func (chat Chat) UnpinMessage() (bool, error)
- func (chat Chat) UnpinMessageById(messageId int) (bool, error)
- type ChatLocation
- type ChatMember
- type ChatPermissions
- type ChatPhoto
- type ChosenInlineResult
- type Contact
- type Dice
- type Document
- type EncryptedCredentials
- type EncryptedPassportElement
- type File
- type ForceReply
- type Game
- type GameHighScore
- type InlineKeyboardButton
- type InlineKeyboardMarkup
- type InlineQuery
- type InlineQueryResult
- type InlineQueryResultArticle
- type InlineQueryResultAudio
- type InlineQueryResultCachedAudio
- type InlineQueryResultCachedDocument
- type InlineQueryResultCachedGif
- type InlineQueryResultCachedMpeg4Gif
- type InlineQueryResultCachedPhoto
- type InlineQueryResultCachedSticker
- type InlineQueryResultCachedVideo
- type InlineQueryResultCachedVoice
- type InlineQueryResultContact
- type InlineQueryResultDocument
- type InlineQueryResultGame
- type InlineQueryResultGif
- type InlineQueryResultLocation
- type InlineQueryResultMpeg4Gif
- type InlineQueryResultPhoto
- type InlineQueryResultVenue
- type InlineQueryResultVideo
- type InlineQueryResultVoice
- type InputContactMessageContent
- type InputFile
- type InputLocationMessageContent
- type InputMedia
- type InputMediaAnimation
- type InputMediaAudio
- type InputMediaDocument
- type InputMediaPhoto
- type InputMediaVideo
- type InputMessageContent
- type InputTextMessageContent
- type InputVenueMessageContent
- type Invoice
- type KeyboardButton
- type KeyboardButtonPollType
- type LabeledPrice
- type Location
- type LoginUrl
- type MaskPosition
- type Message
- func (m Message) Delete() (bool, error)
- func (m Message) EditCaption(text string) (*Message, error)
- func (m Message) EditCaptionHTML(text string) (*Message, error)
- func (m Message) EditCaptionHTMLf(format string, a ...interface{}) (*Message, error)
- func (m Message) EditCaptionMarkdown(text string) (*Message, error)
- func (m Message) EditCaptionMarkdownf(format string, a ...interface{}) (*Message, error)
- func (m Message) EditCaptionf(format string, a ...interface{}) (*Message, error)
- func (m Message) EditHTML(text string) (*Message, error)
- func (m Message) EditHTMLf(format string, a ...interface{}) (*Message, error)
- func (m Message) EditMarkdown(text string) (*Message, error)
- func (m Message) EditMarkdownf(format string, a ...interface{}) (*Message, error)
- func (m Message) EditText(text string) (*Message, error)
- func (m Message) EditTextf(format string, a ...interface{}) (*Message, error)
- func (m Message) Forward(chatId int) (*Message, error)
- func (m *Message) OriginalCaption() string
- func (m *Message) OriginalCaptionHTML() string
- func (m *Message) OriginalCaptionV2() string
- func (m *Message) OriginalHTML() string
- func (m *Message) OriginalText() string
- func (m *Message) OriginalTextV2() string
- func (m *Message) ParseCaptionEntities() (out []ParsedMessageEntity)
- func (m *Message) ParseCaptionEntity(entity MessageEntity) ParsedMessageEntity
- func (m *Message) ParseCaptionEntityTypes(accepted map[string]struct{}) (out []ParsedMessageEntity)
- func (m *Message) ParseEntities() (out []ParsedMessageEntity)
- func (m *Message) ParseEntity(entity MessageEntity) ParsedMessageEntity
- func (m *Message) ParseEntityTypes(accepted map[string]struct{}) (out []ParsedMessageEntity)
- func (m Message) ReplyAudio(audio InputFile) (*Message, error)
- func (m Message) ReplyDocument(document InputFile) (*Message, error)
- func (m Message) ReplyHTML(text string) (*Message, error)
- func (m Message) ReplyHTMLf(format string, a ...interface{}) (*Message, error)
- func (m Message) ReplyLocation(latitude float64, longitude float64) (*Message, error)
- func (m Message) ReplyMarkdown(text string) (*Message, error)
- func (m Message) ReplyMarkdownf(format string, a ...interface{}) (*Message, error)
- func (m Message) ReplyPhoto(photo InputFile) (*Message, error)
- func (m Message) ReplySticker(sticker InputFile) (*Message, error)
- func (m Message) ReplyText(text string) (*Message, error)
- func (m Message) ReplyTextf(format string, a ...interface{}) (*Message, error)
- func (m Message) ReplyVenue(latitude float64, longitude float64, title string, address string) (*Message, error)
- func (m Message) ReplyVideo(video InputFile) (*Message, error)
- func (m Message) ReplyVideoNote(videoNote InputFile) (*Message, error)
- func (m Message) ReplyVoice(voice InputFile) (*Message, error)
- type MessageEntity
- type OrderInfo
- type ParsedMessageEntity
- type PassportData
- type PassportElementError
- type PassportElementErrorDataField
- type PassportElementErrorFile
- type PassportElementErrorFiles
- type PassportElementErrorFrontSide
- type PassportElementErrorReverseSide
- type PassportElementErrorSelfie
- type PassportElementErrorTranslationFile
- type PassportElementErrorTranslationFiles
- type PassportElementErrorUnspecified
- type PassportFile
- type PhotoSize
- type Poll
- type PollAnswer
- type PollOption
- type PostFile
- type PreCheckoutQuery
- type ProximityAlertTriggered
- type ReplyKeyboardMarkup
- type ReplyKeyboardRemove
- type ReplyMarkup
- type Requester
- type ResponseParameters
- type Sendable
- type ShippingAddress
- type ShippingOption
- type ShippingQuery
- type Sticker
- type StickerSet
- type SuccessfulPayment
- type TelegramError
- type User
- type UserProfilePhotos
- type Venue
- type Video
- type VideoNote
- type Voice
- type Webhook
- type WebhookInfo
Constants ¶
const ApiUrl = "https://api.telegram.org/bot"
Variables ¶
var DefaultTgBotRequester = BaseRequester{ Client: http.Client{ Timeout: time.Millisecond * 1500, }, ApiUrl: ApiUrl, }
Functions ¶
This section is empty.
Types ¶
type Animation ¶
type Animation struct {
FileId string `json:"file_id"`
FileUniqueId string `json:"file_unique_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"`
FileUniqueId string `json:"file_unique_id"`
Duration int `json:"duration"`
Performer string `json:"performer"`
Title string `json:"title"`
FileName string `json:"file_name"`
MimeType string `json:"mime_type"`
FileSize int `json:"file_size"`
Thumb *PhotoSize `json:"thumb"`
}
type BasePassportError ¶
type BaseRequester ¶
func (BaseRequester) Get ¶
func (tbg BaseRequester) Get(l *zap.SugaredLogger, token string, method string, params url.Values) (json.RawMessage, error)
func (BaseRequester) Post ¶
func (tbg BaseRequester) Post(l *zap.SugaredLogger, token string, method string, params url.Values, data map[string]PostFile) (json.RawMessage, error)
type Bot ¶
type Bot struct {
Token string
Id int
FirstName string
UserName string
Logger *zap.SugaredLogger `json:"-"`
DisableWebPreview bool
AllowSendingWithoutReply bool
Requester
}
func (Bot) AddPngStickerToSet ¶
func (Bot) AddTgsStickerToSet ¶
func (Bot) AnswerCallbackQuery ¶
AnswerCallbackQuery answer a callback query
func (Bot) AnswerCallbackQueryText ¶
AnswerCallbackQueryText answer a callback query with text
func (Bot) AnswerCallbackQueryURL ¶
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 (Bot) AnswerShippingQuery ¶
func (Bot) CreateNewPngStickerSet ¶
func (Bot) CreateNewTgsStickerSet ¶
func (Bot) DeleteWebhook ¶
func (Bot) EditMessage ¶
func (Bot) EditMessageCaption ¶
func (Bot) EditMessageCaptionInline ¶
func (Bot) EditMessageCaptionMarkup ¶
func (Bot) EditMessageCaptionParseMode ¶
func (Bot) EditMessageHTML ¶
func (Bot) EditMessageHTMLInline ¶
func (Bot) EditMessageInline ¶
func (Bot) EditMessageMarkdown ¶
func (Bot) EditMessageMarkdownInline ¶
func (Bot) EditMessageMarkdownV2 ¶
func (Bot) EditMessageMarkdownV2Inline ¶
func (Bot) EditMessageReplyMarkup ¶
func (Bot) EditMessageReplyMarkupInline ¶
func (b Bot) EditMessageReplyMarkupInline(inlineMessageId string, replyMarkup InlineKeyboardMarkup) (*Message, error)
func (Bot) EditMessageText ¶
func (Bot) EditMessageTextInline ¶
func (Bot) EditMessageTextMarkup ¶
func (Bot) ForwardMessage ¶
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) GetGameHighScores ¶
func (Bot) GetGameHighScoresInline ¶
func (b Bot) GetGameHighScoresInline(userId int, inlineMessageId string) ([]GameHighScore, error)
func (Bot) GetMyCommands ¶
func (b Bot) GetMyCommands() ([]BotCommand, error)
GetMyCommands gets the list of bot commands assigned to the bot.
func (Bot) GetStickerSet ¶
func (b Bot) GetStickerSet(name string) (*StickerSet, error)
func (Bot) GetUserProfilePhotos ¶
GetUserProfilePhotos Retrieves a user's profile pictures
func (Bot) GetWebhookInfo ¶
func (b Bot) GetWebhookInfo() (*WebhookInfo, error)
GetWebhookInfo Get webhook info from telegram servers
func (Bot) KickChatMemberUntil ¶
func (Bot) NewFileURL ¶
func (Bot) NewSendableAddStickerToSet ¶
func (Bot) NewSendableAnimation ¶
NewSendableAnimation creates a new animation struct to send
func (Bot) NewSendableAnswerCallbackQuery ¶
NewSendableAnswerCallbackQuery creates a new callbackQuery struct to send.
func (Bot) NewSendableAnswerInlineQuery ¶
func (b Bot) NewSendableAnswerInlineQuery(inlineQueryId string, results []InlineQueryResult) *sendableAnswerInlineQuery
func (Bot) NewSendableAnswerPreCheckoutQuery ¶
func (Bot) NewSendableAnswerShippingQuery ¶
func (Bot) NewSendableAudio ¶
NewSendableAudio creates a new audio struct to send
func (Bot) NewSendableChatAction ¶
NewSendableChatAction creates a new chat action struct to send
func (Bot) NewSendableContact ¶
NewSendableContact creates a new contact struct to send
func (Bot) NewSendableCopyMessage ¶
NewSendableMessage create a new message struct to send
func (Bot) NewSendableCreateNewStickerSet ¶
func (Bot) NewSendableDice ¶
NewSendableDice creates a new poll struct to send.
func (Bot) NewSendableDocument ¶
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) NewSendableEditMessageLiveLocation ¶
func (Bot) NewSendableEditMessageMedia ¶
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 (Bot) NewSendableGetGameHighScore ¶
func (Bot) NewSendableGetGameHighScoreInline ¶
func (Bot) NewSendableInvoice ¶
func (Bot) NewSendableKickChatMember ¶
func (Bot) NewSendableLocation ¶
func (Bot) NewSendableMediaGroup ¶
NewSendableMediaGroup creates a new mediagroup struct to send
func (Bot) NewSendableMessage ¶
NewSendableMessage create a new message struct to send
func (Bot) NewSendablePhoto ¶
NewSendablePhoto creates a new photo struct to send
func (Bot) NewSendablePinChatMessage ¶
func (Bot) NewSendablePoll ¶
NewSendablePoll creates a new poll struct to send.
func (Bot) NewSendablePromoteChatMember ¶
note: set all as true for promotion by default
func (Bot) NewSendableRestrictChatMember ¶
func (Bot) NewSendableSetChatAdministratorCustomTitle ¶
func (b Bot) NewSendableSetChatAdministratorCustomTitle(chatId int, userId int, customTitle string) *sendableSetChatAdministratorCustomTitle
note: set all as true for promotion by default
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 (Bot) NewSendableSetGameScore ¶
func (Bot) NewSendableSetGameScoreInline ¶
func (Bot) NewSendableSetStickerSetThumb ¶
func (Bot) NewSendableSticker ¶
func (Bot) NewSendableStopMessageLiveLocation ¶
func (Bot) NewSendableUploadStickerFile ¶
func (Bot) NewSendableVenue ¶
NewSendableVenue creates a new venue struct to send
func (Bot) NewSendableVideo ¶
NewSendableVideo creates a new video struct to send
func (Bot) NewSendableVideoNote ¶
NewSendableVideoNote creates a new videonote struct to send
func (Bot) NewSendableVoice ¶
NewSendableVoice creates a new voice struct to send
func (Bot) ParseMessage ¶
func (b Bot) ParseMessage(message json.RawMessage) (mess *Message, err error)
func (Bot) PinChatMessageQuiet ¶
func (Bot) Post ¶
func (b Bot) Post(method string, params url.Values, data map[string]PostFile) (json.RawMessage, error)
Post -> convenience function to execute commands against the TG API. the "data" map is used to fill out the multipart form data to send to TG.
func (Bot) ReplyAudio ¶
func (Bot) ReplyContact ¶
func (Bot) ReplyDocument ¶
func (Bot) ReplyDocumentCaption ¶
func (Bot) ReplyLocation ¶
func (Bot) ReplyMarkdown ¶
func (Bot) ReplyMarkdownV2 ¶
func (Bot) ReplyPhoto ¶
func (Bot) ReplyPhotoCaption ¶
func (Bot) ReplySticker ¶
func (Bot) ReplyVenue ¶
func (Bot) ReplyVideo ¶
func (Bot) ReplyVideoNote ¶
func (Bot) ReplyVoice ¶
func (Bot) RestrictChatMember ¶
func (Bot) SendContact ¶
func (Bot) SendDocument ¶
func (Bot) SendDocumentCaption ¶
func (Bot) SendInvoice ¶
func (Bot) SendLocation ¶
func (Bot) SendMessageHTML ¶
func (Bot) SendMessageMarkdown ¶
func (Bot) SendMessageMarkdownV2 ¶
func (Bot) SendPhotoCaption ¶
func (Bot) SendVideoNote ¶
func (Bot) SetChatAdministratorCustomTitle ¶
func (Bot) SetChatDescription ¶
func (Bot) SetChatPermissions ¶
func (b Bot) SetChatPermissions(chatId int, perms ChatPermissions) (bool, error)
func (Bot) SetChatStickerSet ¶
func (Bot) SetGameScore ¶
func (Bot) SetGameScoreInline ¶
func (Bot) SetMyCommands ¶
func (b Bot) SetMyCommands(cmds []BotCommand) (bool, error)
SetMyCommands gets the list of bot commands assigned to the bot.
func (Bot) SetPassportDataErrors ¶
func (b Bot) SetPassportDataErrors(userId int, errors ...PassportElementError)
func (Bot) SetStickerPositionInSet ¶
func (Bot) SetWebhook ¶
SetWebhook Set the webhook url for telegram to contact with updates
func (Bot) StopPollMarkup ¶
func (Bot) UnRestrictChatMember ¶
func (Bot) UnbanChatMemberOnlyIfBanned ¶
func (Bot) UnpinChatMessageById ¶
type BotCommand ¶
type CallbackQuery ¶
type CallbackQuery struct {
Bot Bot `json:"-"`
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"`
}
func (*CallbackQuery) AnswerCallbackQuery ¶
func (cq *CallbackQuery) AnswerCallbackQuery() (bool, error)
func (*CallbackQuery) AnswerCallbackQueryText ¶
func (cq *CallbackQuery) AnswerCallbackQueryText(text string, alert bool) (bool, error)
func (*CallbackQuery) AnswerCallbackQueryURL ¶
func (cq *CallbackQuery) AnswerCallbackQueryURL(url string) (bool, error)
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"`
Bio string `json:"bio"`
Description string `json:"description"`
InviteLink string `json:"invite_link"`
PinnedMessage *Message `json:"pinned_message"`
Permissions *ChatPermissions `json:"permissions"`
SlowModeDelay int `json:"slow_mode_delay"`
StickerSetName string `json:"sticker_set_name"`
CanSetStickerSet bool `json:"can_set_sticker_set"`
LinkedChatId int `json:"linked_chat_id"`
Location ChatLocation `json:"location"`
}
func (Chat) DeletePhoto ¶
func (Chat) DeleteStickerSet ¶
func (Chat) ExportInviteLink ¶
func (Chat) GetAdministrators ¶
func (chat Chat) GetAdministrators() ([]ChatMember, error)
func (Chat) GetMembersCount ¶
func (Chat) SetAdministratorCustomTitle ¶
func (Chat) SetChatPermissions ¶
func (chat Chat) SetChatPermissions(perms ChatPermissions) (bool, error)
func (Chat) UnpinMessage ¶
type ChatLocation ¶
type ChatMember ¶
type ChatMember struct {
User *User `json:"user"`
Status string `json:"status"`
CustomTitle string `json:"custom_title"`
IsAnonymous bool `json:"is_anonymous"`
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_polls"`
CanSendOtherMessages bool `json:"can_send_other_messages"`
CanAddWebPagePreviews bool `json:"can_add_web_page_previews"`
UntilDate int64 `json:"until_date"`
}
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 ChosenInlineResult ¶
type EncryptedCredentials ¶
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 ForceReply ¶
func (*ForceReply) Marshal ¶
func (fr *ForceReply) Marshal() ([]byte, error)
type GameHighScore ¶
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 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"`
HorizontalAccuracy float64 `json:"horizontal_accuracy"`
LivePeriod int `json:"live_period"`
Heading int `json:"heading"`
ProximityAlertRadius int `json:"proximity_alert_radius"`
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"`
FoursquareType string `json:"foursquare_type"`
GooglePlaceId string `json:"google_place_id"`
GooglePlaceType string `json:"google_place_type"`
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 InputFile ¶
type InputLocationMessageContent ¶
type InputLocationMessageContent struct {
InputMessageContent
Latitude float64 `json:"latitude"`
Longitude float64 `json:"longitude"`
HorizontalAccuracy float64 `json:"horizontal_accuracy"`
LivePeriod int `json:"live_period"`
Heading int `json:"heading"`
ProximityAlertRadius int `json:"proximity_alert_radius"`
}
type InputMedia ¶
type InputMedia interface {
// contains filtered or unexported methods
}
type InputMediaAnimation ¶
type InputMediaAudio ¶
type InputMediaDocument ¶
type InputMediaPhoto ¶
type InputMediaPhoto struct {
Media InputFile
Caption string
ParseMode string
CaptionEntities []MessageEntity
}
type InputMediaVideo ¶
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"`
FoursquareType string `json:"foursquare_type"`
GooglePlaceId string `json:"google_place_id"`
GooglePlaceType string `json:"google_place_type"`
}
type KeyboardButton ¶
type KeyboardButton struct {
Text string `json:"text"`
RequestContact bool `json:"request_contact"`
RequestLocation bool `json:"request_location"`
RequestPoll *KeyboardButtonPollType `json:"request_poll"`
}
type KeyboardButtonPollType ¶
type KeyboardButtonPollType struct {
Type []string `json:"type"`
}
type LabeledPrice ¶
type MaskPosition ¶
type Message ¶
type Message struct {
Bot Bot `json:"-"`
MessageId int `json:"message_id"`
From *User `json:"from"`
SenderChat *Chat `json:"sender_chat"`
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"`
ViaBot *User `json:"via_bot"`
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"`
Dice *Dice `json:"dice"`
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"`
ProximityAlertTriggered *ProximityAlertTriggered `json:"proximity_alert_triggered"`
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup"`
// contains filtered or unexported fields
}
func (Message) EditCaptionHTMLf ¶
func (Message) EditCaptionMarkdown ¶
func (Message) EditCaptionMarkdownf ¶
func (Message) EditCaptionf ¶
func (Message) EditMarkdownf ¶
func (*Message) OriginalCaption ¶
func (*Message) OriginalCaptionHTML ¶
func (*Message) OriginalCaptionV2 ¶
func (*Message) OriginalHTML ¶
func (*Message) OriginalText ¶
func (*Message) OriginalTextV2 ¶
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) ReplyHTMLf ¶
func (Message) ReplyLocation ¶
func (Message) ReplyMarkdownf ¶
func (Message) ReplyTextf ¶
func (Message) ReplyVenue ¶
func (Message) ReplyVideoNote ¶
type MessageEntity ¶
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 PassportData ¶
type PassportData struct {
Data []EncryptedPassportElement `json:"data"`
Credentials EncryptedCredentials `json:"credentials"`
}
type PassportElementError ¶
type PassportElementErrorDataField ¶
type PassportElementErrorDataField struct {
BasePassportError
FieldName string
DataHash string
}
type PassportElementErrorFile ¶
type PassportElementErrorFile struct {
BasePassportError
FileHash string
}
type PassportElementErrorFiles ¶
type PassportElementErrorFiles struct {
BasePassportError
FileHashes []string
}
type PassportElementErrorFrontSide ¶
type PassportElementErrorFrontSide struct {
BasePassportError
FileHash string
}
type PassportElementErrorReverseSide ¶
type PassportElementErrorReverseSide struct {
BasePassportError
FileHash string
}
type PassportElementErrorSelfie ¶
type PassportElementErrorSelfie struct {
BasePassportError
FileHash string
}
type PassportElementErrorTranslationFile ¶
type PassportElementErrorTranslationFile struct {
BasePassportError
FileHash string
}
type PassportElementErrorTranslationFiles ¶
type PassportElementErrorTranslationFiles struct {
BasePassportError
FileHashes []string
}
type PassportElementErrorUnspecified ¶
type PassportElementErrorUnspecified struct {
BasePassportError
ElementHash string
}
type PassportFile ¶
type Poll ¶
type Poll struct {
Bot Bot `json:"-"`
Id string `json:"id"`
Question string `json:"question"`
Options []PollOption `json:"options"`
TotalVoterCount int `json:"total_voter_count"`
IsClosed bool `json:"is_closed"`
IsAnonymous bool `json:"is_anonymous"`
Type string `json:"type"`
AllowsMultipleAnswers bool `json:"allows_multiple_answers"`
CorrectOptionId int `json:"correct_option_id"`
Explanation string `json:"explanation"`
ExplanationEntities []MessageEntity `json:"explanation_entities"`
OpenPeriod int `json:"open_period"`
CloseDate int `json:"close_date"`
}
type PollAnswer ¶
type PollOption ¶
type PreCheckoutQuery ¶
type ProximityAlertTriggered ¶
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 Requester ¶
type Requester interface {
Get(l *zap.SugaredLogger, token string, method string, params url.Values) (json.RawMessage, error)
Post(l *zap.SugaredLogger, token string, method string, params url.Values, data map[string]PostFile) (json.RawMessage, error)
}
type ResponseParameters ¶
type ShippingAddress ¶
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"`
FileUniqueId string `json:"file_unique_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 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 TelegramError ¶
func (*TelegramError) Error ¶
func (t *TelegramError) Error() string
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"`
CanJoinGroups bool `json:"can_join_groups"`
CanReadAllGroupMessages bool `json:"can_read_all_group_messages"`
SupportsInlineQueries bool `json:"supports_inline_queries"`
}
func (User) GetProfilePhotos ¶
func (user User) GetProfilePhotos() (*UserProfilePhotos, error)
GetProfilePhotos Retrieves a user's profile pictures
func (User) GetProfilePhotosOffset ¶
func (user User) GetProfilePhotosOffset(offset int, limit int) (*UserProfilePhotos, error)
GetProfilePhotosOffset Retrieves a user's profile pictures
type UserProfilePhotos ¶
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"`
GooglePlaceId string `json:"google_place_id"`
GooglePlaceType string `json:"google_place_type"`
}
type Video ¶
type Video struct {
FileId string `json:"file_id"`
FileUniqueId string `json:"file_unique_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 Webhook ¶
type Webhook struct {
Serve string // base url to where you listen
ServePath string // path you listen to
ServePort int // port you listen on
URL string // where you set the webhook to send to
// CertPath string // TODO
IPAddress string // where you set the webhook to send to
MaxConnections int // max connections; max 100, default 40
AllowedUpdates []string // which updates to allow
DropPendingUpdates bool // should start from scratch on the new updates
}
func (Webhook) GetListenUrl ¶
type WebhookInfo ¶
type WebhookInfo struct {
URL string `json:"url"`
HasCustomCertificate bool `json:"has_custom_certificate"`
PendingUpdateCount int `json:"pending_update_count"`
IPAddress string `json:"ip_address"`
LastErrorDate int `json:"last_error_date"`
LastErrorMessage int `json:"last_error_message"`
MaxConnections int `json:"max_connections"`
AllowedUpdates []string `json:"allowed_updates"`
}