Versions in this module Expand all Collapse all v0 v0.2.0 Dec 20, 2018 Changes in this version type BotOption + func WithSOCKS5(v SOCKS5) BotOption + type SOCKS5 struct + Address string + Password string + User string + func (s *SOCKS5) Auth() *proxy.Auth v0.1.0 Nov 13, 2018 Changes in this version + const ModeDefault + const ModeHTML + const ModeMarkdown + var ErrEmptyToken = errors.New("telegram: empty token") + var ErrNotAnswered = errors.New("telegram: query not answered") + var ErrNotDeleted = errors.New("telegram: message not deleted") + var ErrNotEdited = errors.New("telegram: message not edited") + type Audio struct + Duration int + FileID string + FileSize *int + MimeType *string + Performer *string + Title *string + type AudioMessage struct + Audio InputFile + AudioID string + Caption string + ChatID int64 + DisableNotification bool + Duration int + Performer string + ReplyMarkup Markup + ReplyToMessageID int + Title string + func (m *AudioMessage) Multipart() *Multipart + type Bot interface + DeleteMessage func(context.Context, *DeletedMessage) error + EditMessageCaption func(context.Context, *MessageCaption) (*Message, error) + EditMessageReplyMarkup func(context.Context, *MessageReplyMarkup) (*Message, error) + EditMessageText func(context.Context, *MessageText) (*Message, error) + Errors func() <-chan error + ForwardMessage func(context.Context, *ForwardedMessage) (*Message, error) + GetMe func(context.Context) (*User, error) + GetUpdates func(context.Context, ...UpdatesOption) ([]*Update, error) + SendMessage func(context.Context, *TextMessage) (*Message, error) + Updates func() <-chan *Update + Username func() string + func NewBot(ctx context.Context, token string, opts ...BotOption) (Bot, error) + type BotOption func(*botOptions) + func WithErrTimeout(t time.Duration) BotOption + func WithPollTimeout(t time.Duration) BotOption + func WithUsername(s string) BotOption + func WithoutUpdates() BotOption + type CallbackQuery struct + ChatInstance string + Data *string + From User + ID string + InlineMessageID *string + Message *Message + type CallbackQueryAnswer struct + CacheTime int + CallbackQueryID string + ShowAlert bool + Text string + URL string + type Chat struct + AllMembersAreAdministrators *bool + ChatPhoto *ChatPhoto + Description *string + FirstName *string + ID int64 + InviteLink *string + LastName *string + Title *string + Type string + Username *string + func (c *Chat) IsChannel() bool + func (c *Chat) IsGroup() bool + func (c *Chat) IsPrivate() bool + func (c *Chat) IsSupergroup() bool + type ChatID int64 + type ChatMember struct + CanAddWebPagePreviews *bool + CanBeEdited *bool + CanChangeInfo *bool + CanDeleteMessages *bool + CanEditMessages *bool + CanInviteUsers *bool + CanPinMessages *bool + CanPostMessages *bool + CanPromoteMembers *bool + CanRestrictMembers *bool + CanSendMediaMessages *bool + CanSendMessages *bool + CanSendOtherMessages *bool + Status string + UntilDate *int + User User + type ChatPhoto struct + BigFileID string + SmallFileID string + type Command struct + Args []string + Chat Chat + Date int + From User + Name string + type CommandFunc func(*Command, *Update) error + type Commands interface + Add func(name string, fn CommandFunc) + Run func(*Update) (error, bool) + func NewCommands(username string) Commands + type Contact struct + FirstName string + LastName *string + PhoneNumber string + UserID *int + type DeletedMessage struct + ChatID int64 + MessageID int + type Document struct + FileID string + FileName *string + FileSize *int + MimeType *string + Thumb *PhotoSize + type DocumentMessage struct + Caption string + ChatID int64 + DisableNotification bool + Document InputFile + ReplyMarkup Markup + ReplyToMessageID int + func (m *DocumentMessage) Multipart() *Multipart + type Error struct + Description string + ErrorCode int + Parameters *ResponseParameters + func (e *Error) Error() string + type File struct + FileID string + FilePath *string + FileSize *int + type ForceReply struct + ForeceReply bool + Selective bool + func (m *ForceReply) MarshalJSON() ([]byte, error) + func (m *ForceReply) UnmarshalJSON(b []byte) error + type ForwardedMessage struct + ChatID int64 + DisableNotification bool + FromChatID int64 + MessageID int + type InlineKeyboardButton struct + CallbackData string + SwitchInlineQuery string + SwitchInlineQueryCurrentChat string + Text string + URL string + type InlineKeyboardMarkup struct + InlineKeyboard [][]*InlineKeyboardButton + func (m *InlineKeyboardMarkup) MarshalJSON() ([]byte, error) + func (m *InlineKeyboardMarkup) UnmarshalJSON(b []byte) error + type InputFile interface + Name func() string + type KeyboardButton struct + RequestContact bool + RequestLocation bool + Text string + type Location struct + Latitude float32 + Longitude float32 + type Markup interface + type MaskPosition struct + Point string + Scale float32 + XShift float32 + YShift float32 + type Message struct + Audio *Audio + Caption *string + ChannelChatCreated *bool + Chat Chat + Contact *Contact + Date int + DeleteChatPhoto *bool + Document *Document + EditDate *int + Entities []*MessageEntity + ForwardDate *int + ForwardFrom *User + ForwardFromChat *Chat + From *User + GroupChatCreated *bool + LeftChatMember *User + Location *Location + MessageID int + MigrateFromChatID *int64 + MigrateToChatID *int64 + NewChatMember *User + NewChatMembers []*User + NewChatPhoto []*PhotoSize + NewChatTitle *string + Photo []*PhotoSize + PinnedMessage *Message + ReplyToMessage *Message + Sticker *Sticker + SupergroupChatCreated *bool + Text *string + Venue *Venue + Video *Video + VideoNote *VideoNote + Voice *Voice + type MessageCaption struct + Caption string + ChatID int64 + InlineMessageID int + MessageID int + ReplyMarkup *InlineKeyboardMarkup + type MessageEntity struct + Length int + Offset int + Type string + URL *string + User *User + func (e *MessageEntity) IsBotCommand() bool + func (e *MessageEntity) IsEmail() bool + func (e *MessageEntity) IsHashtag() bool + func (e *MessageEntity) IsMention() bool + func (e *MessageEntity) IsURL() bool + type MessageReplyMarkup struct + ChatID int64 + InlineMessageID int + MessageID int + ReplyMarkup *InlineKeyboardMarkup + type MessageText struct + ChatID int64 + DisableWebPagePreview bool + InlineMessageID int + MessageID int + ParseMode ParseMode + ReplyMarkup *InlineKeyboardMarkup + Text string + type Multipart struct + Files map[string]InputFile + Form url.Values + func (m *Multipart) Encode() (io.Reader, string, error) + type Multiparter interface + Multipart func() *Multipart + type ParseMode int + func (m ParseMode) MarshalJSON() (b []byte, err error) + type PhotoMessage struct + Caption string + ChatID int64 + DisableNotification bool + Photo InputFile + PhotoID string + ReplyToMessageID int + func (m *PhotoMessage) Multipart() *Multipart + type PhotoSize struct + FileID string + FileSize *int + Height int + Width int + type ReplyKeyboardMarkup struct + Keyboard [][]*KeyboardButton + OneTimeKeyboard bool + ResizeKeyboard bool + Selective bool + func (m *ReplyKeyboardMarkup) MarshalJSON() ([]byte, error) + func (m *ReplyKeyboardMarkup) UnmarshalJSON(b []byte) error + type ReplyKeyboardRemove struct + RemoveKeyboard bool + Selective bool + func (m *ReplyKeyboardRemove) MarshalJSON() ([]byte, error) + func (m *ReplyKeyboardRemove) UnmarshalJSON(b []byte) error + type ResponseParameters struct + MigrateToChatID *int64 + RetryAfter *int + type Sticker struct + Emoji *string + FileID string + FileSize *int + Height int + MaskPosition *MaskPosition + SetName *string + Thumb *PhotoSize + Width int + type StickerMessage struct + ChatID int64 + DisableNotification bool + ReplyMarkup Markup + ReplyToMessageID int + Sticker InputFile + StickerID string + type StickerSet struct + ContainsMasks bool + Name string + Stickers []*Sticker + Title string + type TextMessage struct + ChatID int64 + DisableNotification bool + DisableWebPagePreview bool + ParseMode ParseMode + ReplyMarkup Markup + ReplyToMessageID int + Text string + type Update struct + CallbackQuery *CallbackQuery + ChannelPost *Message + EditedChannelPost *Message + EditedMessage *Message + Message *Message + UpdateID int + type UpdatesOption func(*updatesOptions) + func WithLimit(limit int) UpdatesOption + func WithOffset(offset int) UpdatesOption + func WithTimeout(t time.Duration) UpdatesOption + type User struct + FirstName string + ID int + LanguageCode *string + LastName *string + Username *string + type UserProfilePhotos struct + Photos [][]*PhotoSize + TotalCount int + type Venue struct + Address string + FoursquareID *string + Location Location + Title string + type Video struct + Duration int + FileID string + FileSize *int + Height int + MimeType *string + Thumb *PhotoSize + Width int + type VideoNote struct + Duration int + FileID string + FileSize *int + Length int + Thumb *PhotoSize + type Voice struct + Duration int + FileID string + FileSize *int + MimeType *string + type WebhookInfo struct + AllowedUpdates []string + HasCustomCertificate bool + LastErrorDate int + LastErrorMessage string + MaxConnections int + PendingUpdateCount int + URL string