telegroid

package module
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: May 22, 2020 License: MIT Imports: 10 Imported by: 0

README

Telegroid

A Telegram Bot API wrapper for Golang.

Currently supports Bot API 4.2 without some rarely-used (in my opinion) functions.

Example

import "github.com/deadblue/telegroid"
import "github.com/deadblue/telegroid/arguments"

// Create a bot instance
bot := telegroid.New("your_bot_token")

// Get bot information
me, err := bot.GetMe()
if err != nil {
    panic(err)
}

// Send markdown text message with inline keyboard
args := new(arguments.SendMessageArgs)
args.ChatId(1234)
args.Text("Hello, *world*!").Markdown()
args.InlineKeyboard().
    AddUrlButton("Github", "https://github.com/deadblue/telegroid").
    AddUrlButton("Author", "tg://resolve?domain=deadbluex").
    AddCallbackButton("Foo", "Bar").
    Layout(2, 1).
    Finish()
msg, err := bot.SendMessage(args)
if err != nil {
    panic(err)
}

Feature:

Telegroid currently supports most of functions, except:

  • Inline mode

These functions will be supported in the plan.

Reference

LICENSE

MIT

Documentation

Overview

A Telegram Bot API wrapper.

Current supports Bot API version is 4.2.

Example:

import "github.com/deadblue/telegroid"
import "github.com/deadblue/telegroid/arguments"

// Create a bot instance
bot := telegroid.New("your_bot_token")

// Get bot information
me, err := bot.GetMe()
if err != nil {
	panic(err)
}

// Send markdown text message with an inline keyboard
args := new(arguments.SendMessageArgs)
args.ChatId(1234)
args.Text("Hello, *world*!").Markdown()
args.InlineKeyboard().
	AddUrlButton("Github", "https://github.com/deadblue/telegroid").
	AddUrlButton("Author", "tg://resolve?domain=deadbluex").
	AddCallbackButton("Foo", "Bar").
	Layout(2, 1).
	Finish()
msg, err := bot.SendMessage(args)
if err != nil {
	panic(err)
}

Index

Constants

View Source
const (
	Version       = "1.0"
	BotApiVersion = "4.2"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Animation

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

type Audio

type Audio struct {
	FileId    string     `json:"file_id"`
	FileSize  int        `json:"file_size"`
	MimeType  string     `json:"mime_type"`
	Duration  int        `json:"duration"`
	Performer string     `json:"performer"`
	Title     string     `json:"title"`
	Thumb     *PhotoSize `json:"thumb"`
}

type Bot

type Bot struct {

	// Get me
	GetMe func() (*User, error)
	// Get updates
	GetUpdates func(args *arguments.GetUpdatesArgs) ([]*Update, error)
	// Webhook management
	SetWebhook     func(args *arguments.SetWebhookArgs) (bool, error)
	DeleteWebhook  func() (bool, error)
	GetWebhookInfo func() (*WebhookInfo, error)
	// Send message
	ForwardMessage func(args *arguments.ForwardMessageArgs) (*Message, error)
	SendMessage    func(args *arguments.SendMessageArgs) (*Message, error)
	SendPhoto      func(args *arguments.SendPhotoArgs) (*Message, error)
	SendAudio      func(args *arguments.SendAudioArgs) (*Message, error)
	SendDocument   func(args *arguments.SendDocumentArgs) (*Message, error)
	SendVideo      func(args *arguments.SendVideoArgs) (*Message, error)
	SendAnimation  func(args *arguments.SendAnimationArgs) (*Message, error)
	SendVoice      func(args *arguments.SendVoiceArgs) (*Message, error)
	SendVideoNote  func(args *arguments.SendVideoNoteArgs) (*Message, error)
	SendMediaGroup func(args *arguments.SendMediaGroupArgs) ([]*Message, error)
	SendLocation   func(args *arguments.SendLocationArgs) (*Message, error)
	SendVenue      func(args *arguments.SendVenueArgs) (*Message, error)
	SendContact    func(args *arguments.SendContactArgs) (*Message, error)
	SendPoll       func(args *arguments.SendPollArgs) (*Message, error)
	SendChatAction func(args *arguments.SendChatActionArgs) (bool, error)
	// Inline keyboard callback
	AnswerCallbackQuery func(args *arguments.AnswerCallbackQueryArgs) (bool, error)
	// Delete message
	DeleteMessage func(args *arguments.ChatMessageArgs) (bool, error)
	// Edit own message
	EditMessageText         func(args *arguments.EditMessageTextArgs) (*Message, error)
	EditMessageCaption      func(args *arguments.EditMessageCaptionArgs) (*Message, error)
	EditMessageMedia        func(args *arguments.EditMessageMediaArgs) (*Message, error)
	EditMessageReplyMarkup  func(args *arguments.EditMessageReplyMarkupArgs) (*Message, error)
	EditMessageLiveLocation func(args *arguments.EditMessageLiveLocationArgs) (*Message, error)
	StopMessageLiveLocation func(args *arguments.EditMessageReplyMarkupArgs) (*Message, error)
	StopPoll                func(args *arguments.StopPollArgs) (*Poll, error)
	// Edit other's message
	EditOthersMessageText         func(args *arguments.EditMessageTextArgs) (bool, error)         `method:"editMessageText"`
	EditOthersMessageCaption      func(args *arguments.EditMessageCaptionArgs) (bool, error)      `method:"editMessageCaption"`
	EditOthersMessageMedia        func(args *arguments.EditMessageMediaArgs) (bool, error)        `method:"editMessageMedia"`
	EditOthersMessageReplyMarkup  func(args *arguments.EditMessageReplyMarkupArgs) (bool, error)  `method:"editMessageReplyMarkup"`
	EditOthersMessageLiveLocation func(args *arguments.EditMessageLiveLocationArgs) (bool, error) `method:"editMessageLiveLocation"`
	StopOthersMessageLiveLocation func(args *arguments.EditMessageReplyMarkupArgs) (bool, error)  `method:"stopMessageLiveLocation"`
	// User information
	GetUserProfilePhotos func(args *arguments.GetUserProfilePhotosArgs) (*UserProfilePhotos, error)
	// Chat information
	GetChat               func(args *arguments.ChatArgs) (*Chat, error)
	GetChatAdministrators func(args *arguments.ChatArgs) ([]*ChatMember, error)
	GetChatMembersCount   func(args *arguments.ChatArgs) (int, error)
	GetChatMember         func(args *arguments.ChatMemberArgs) (*ChatMember, error)
	// Chat management
	KickChatMember       func(args *arguments.KickChatMemberArgs) (bool, error)
	UnbanChatMember      func(args *arguments.ChatMemberArgs) (bool, error)
	RestrictChatMember   func(args *arguments.RestrictChatMemberArgs) (bool, error)
	PromoteChatMember    func(args *arguments.PromoteChatMemberArgs) (bool, error)
	ExportChatInviteLink func(args *arguments.ChatArgs) (string, error)
	SetChatPhoto         func(args *arguments.SetChatPhotoArgs) (bool, error)
	DeleteChatPhoto      func(args *arguments.ChatArgs) (bool, error)
	SetChatTitle         func(args *arguments.SetChatTitleArgs) (bool, error)
	SetChatDescription   func(args *arguments.SetChatDescriptionArgs) (bool, error)
	PinChatMessage       func(args *arguments.PinChatMessageArgs) (bool, error)
	UnpinChatMessage     func(args *arguments.ChatArgs) (bool, error)
	SetChatStickerSet    func(args *arguments.SetChatStickerSetArgs) (bool, error)
	DeleteChatStickerSet func(args *arguments.ChatArgs) (bool, error)
	LeaveChat            func(args *arguments.ChatArgs) (bool, error)
	// Misc
	GetFile func(args *arguments.GetFileArgs) (*File, error)
	// Sticker
	SendSticker             func(args *arguments.SendStickerArgs) (*Message, error)
	GetStickerSet           func(args *arguments.GetStickerSetArgs) (*StickerSet, error)
	UploadStickerFile       func(args *arguments.UploadStickerFileArgs) (*File, error)
	CreateNewStickerSet     func(args *arguments.CreateNewStickerSetArgs) (bool, error)
	AddStickerToSet         func(args *arguments.AddStickerToSetArgs) (bool, error)
	SetStickerPositionInSet func(args *arguments.SetStickerPositionInSetArgs) (bool, error)
	DeleteStickerFromSet    func(args *arguments.DeleteStickerFromSetArgs) (bool, error)
	// Game
	SendGame          func(args *arguments.SendGameArgs) (*Message, error)
	SetGameScore      func(args *arguments.SetGameScoreArgs) (bool, error)
	GetGameHighScores func(args *arguments.GetGameHighScoresArgs) (*GameHighScore, error)
	// Inline mode
	//AnswerInlineQuery func(args *arguments.AnswerInlineQueryArgs) (bool, error)
	// Payment
	SendInvoice            func(args *arguments.SendInvoiceArgs) (*Message, error)
	AnswerShippingQuery    func(args *arguments.AnswerShippingQueryArgs) (bool, error)
	AnswerPreCheckoutQuery func(args *arguments.AnswerPreCheckoutQueryArgs) (bool, error)
	// Passport
	SetPassportDataErrors func(args *arguments.SetPassportDataErrorsArgs) (bool, error)
	// contains filtered or unexported fields
}

Telegram Bot API wrapper

func New

func New(token string) *Bot

Create a Bot instance.

The New() process contains some reflect operations, so I do not suggest to new more than one Bot for one bot account. Also the Bot is safe for using in multiple goroutines, so it is unnecessary to new many.

type CallbackGame

type CallbackGame struct{}

type CallbackQuery

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

type Chat

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

type ChatMember

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

type ChatPhoto

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

type ChatType

type ChatType string

The enum type for "Chat.Type". Developer can simply call "IsXXX" method to judge its value.

func (ChatType) IsChannel

func (t ChatType) IsChannel() bool

func (ChatType) IsGroup

func (t ChatType) IsGroup() bool

func (ChatType) IsPrivate

func (t ChatType) IsPrivate() bool

func (ChatType) IsSuperGroup

func (t ChatType) IsSuperGroup() bool

type ChosenInlineResult

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

type Contact

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

type Document

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

type EncryptedCredentials

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

type EncryptedPassportElement

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

type EntityType

type EntityType string

The enum type for "MessageEntity.Type". Developer can simply call "IsXXX" method to judge its value.

func (EntityType) IsBold

func (t EntityType) IsBold() bool

func (EntityType) IsBotCommand

func (t EntityType) IsBotCommand() bool

func (EntityType) IsCashtag

func (t EntityType) IsCashtag() bool

func (EntityType) IsCode

func (t EntityType) IsCode() bool

func (EntityType) IsEmail

func (t EntityType) IsEmail() bool

func (EntityType) IsHashtag

func (t EntityType) IsHashtag() bool

func (EntityType) IsItalic

func (t EntityType) IsItalic() bool

func (EntityType) IsPhoneNumber

func (t EntityType) IsPhoneNumber() bool

func (EntityType) IsPre

func (t EntityType) IsPre() bool
func (t EntityType) IsTextLink() bool

func (EntityType) IsTextMention

func (t EntityType) IsTextMention() bool

func (EntityType) IsUrl

func (t EntityType) IsUrl() bool

type File

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

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

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

type MaskPosition

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

type MemberStatus

type MemberStatus string

The enum type for "ChangeMember.Status". Developer can simply call "IsXXX" method to judge its value.

func (MemberStatus) IsAdministrator

func (s MemberStatus) IsAdministrator() bool

func (MemberStatus) IsCreator

func (s MemberStatus) IsCreator() bool

func (MemberStatus) IsKicked

func (s MemberStatus) IsKicked() bool

func (MemberStatus) IsLeft

func (s MemberStatus) IsLeft() bool

func (MemberStatus) IsMember

func (s MemberStatus) IsMember() bool

func (MemberStatus) IsRestricted

func (s MemberStatus) IsRestricted() bool

type Message

type Message struct {
	MessageId             int                `json:"message_id"`
	From                  *User              `json:"from"`
	Date                  int                `json:"date"`
	Chat                  *Chat              `json:"chat"`
	ForwardFrom           *User              `json:"forward_from"`
	ForwardFromChat       *Chat              `json:"forward_from_chat"`
	ForwardFromMessageId  int                `json:"forward_from_message_id"`
	ForwardSignature      string             `json:"forward_signature"`
	ForwardSenderName     string             `json:"forward_sender_name"`
	ForwardDate           int                `json:"forward_date"`
	ReplyToMessage        *Message           `json:"reply_to_message"`
	EditDate              int                `json:"edit_date"`
	MediaGroupId          string             `json:"media_group_id"`
	AuthorSignature       string             `json:"author_signature"`
	Text                  string             `json:"text"`
	Entities              []*MessageEntity   `json:"entities"`
	CaptionEntities       []*MessageEntity   `json:"caption_entities"`
	Audio                 *Audio             `json:"audio"`
	Document              *Document          `json:"document"`
	Animation             *Animation         `json:"animation"`
	Game                  *Game              `json:"game"`
	Photo                 []*PhotoSize       `json:"photo"`
	Sticker               *Sticker           `json:"sticker"`
	Video                 *Video             `json:"video"`
	Voice                 *Voice             `json:"voice"`
	VideoNote             *VideoNote         `json:"video_note"`
	Caption               string             `json:"caption"`
	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"`
}

type MessageEntity

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

type OrderInfo

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

type PassportData

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

type PassportFile

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

type PassportType

type PassportType string

The enum type for "PassportData.Type". Developer can simply call "IsXXX" method to judge its value.

func (PassportType) IsAddress

func (t PassportType) IsAddress() bool

func (PassportType) IsBankStatement

func (t PassportType) IsBankStatement() bool

func (PassportType) IsDriverLicense

func (t PassportType) IsDriverLicense() bool

func (PassportType) IsEmail

func (t PassportType) IsEmail() bool

func (PassportType) IsIdentityCard

func (t PassportType) IsIdentityCard() bool

func (PassportType) IsInternalPassport

func (t PassportType) IsInternalPassport() bool

func (PassportType) IsPassport

func (t PassportType) IsPassport() bool

func (PassportType) IsPassportRegistration

func (t PassportType) IsPassportRegistration() bool

func (PassportType) IsPersonalDetails

func (t PassportType) IsPersonalDetails() bool

func (PassportType) IsPhoneNumber

func (t PassportType) IsPhoneNumber() bool

func (PassportType) IsRentalAgreement

func (t PassportType) IsRentalAgreement() bool

func (PassportType) IsTemporaryRegistration

func (t PassportType) IsTemporaryRegistration() bool

func (PassportType) IsUtilityBill

func (t PassportType) IsUtilityBill() bool

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 {
	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 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 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"`
	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"`
	ContainsMask bool       `json:"contains_mask"`
	Stickers     []*Sticker `json:"stickers"`
}

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 Update

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

type User

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

type UserProfilePhotos

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

type Venue

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

type Video

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

type VideoNote

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

type Voice

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

type WebhookInfo

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

Directories

Path Synopsis
This package contains all arguments structs for Telegram Bot API method.
This package contains all arguments structs for Telegram Bot API method.

Jump to

Keyboard shortcuts

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