Versions in this module Expand all Collapse all v1 v1.4.2 Aug 15, 2023 Changes in this version + const CALLBACK_QUERY + const DELETED_MESSAGE + const EDITED_MESSAGE + const FILE + const FORWARD + const LEFT_CHAT_MEMBERS + const MENTION + const NEW_CHAT_MEMBERS + const NEW_MESSAGE + const PINNED_MESSAGE + const REPLY + const STICKER + const UNPINNED_MESSAGE + const VOICE + type AdminsListResponse struct + List []ChatMember + func (v *AdminsListResponse) UnmarshalEasyJSON(l *jlexer.Lexer) + func (v *AdminsListResponse) UnmarshalJSON(data []byte) error + func (v AdminsListResponse) MarshalEasyJSON(w *jwriter.Writer) + func (v AdminsListResponse) MarshalJSON() ([]byte, error) + type BaseEventPayload struct + Chat Chat + From Contact + MsgID string + Text string + Timestamp int + func (v *BaseEventPayload) UnmarshalEasyJSON(l *jlexer.Lexer) + func (v *BaseEventPayload) UnmarshalJSON(data []byte) error + func (v BaseEventPayload) MarshalEasyJSON(w *jwriter.Writer) + func (v BaseEventPayload) MarshalJSON() ([]byte, error) + type Bot struct + Info *BotInfo + func NewBot(token string, opts ...BotOption) (*Bot, error) + func (b *Bot) BlockChatUser(chatID, userID string, deleteLastMessages bool) error + func (b *Bot) DeleteMessage(message *Message) error + func (b *Bot) EditMessage(message *Message) error + func (b *Bot) GetChatAdmins(chatID string) ([]ChatMember, error) + func (b *Bot) GetChatBlockedUsers(chatID string) ([]User, error) + func (b *Bot) GetChatInfo(chatID string) (*Chat, error) + func (b *Bot) GetChatMembers(chatID string) ([]ChatMember, error) + func (b *Bot) GetChatPendingUsers(chatID string) ([]User, error) + func (b *Bot) GetFileInfo(fileID string) (*File, error) + func (b *Bot) GetInfo() (*BotInfo, error) + func (b *Bot) GetUpdatesChannel(ctx context.Context) <-chan Event + func (b *Bot) NewButtonResponse(queryID, url, text string, showAlert bool) *ButtonResponse + func (b *Bot) NewChat(id string) *Chat + func (b *Bot) NewDeeplinkMessage(chatID, text string, keyboard Keyboard, deeplink string) *Message + func (b *Bot) NewFileMessage(chatID string, file *os.File) *Message + func (b *Bot) NewFileMessageByFileID(chatID, fileID string) *Message + func (b *Bot) NewInlineKeyboardMessage(chatID, text string, keyboard Keyboard) *Message + func (b *Bot) NewMessage(chatID string) *Message + func (b *Bot) NewMessageFromPart(message PartMessage) *Message + func (b *Bot) NewTextMessage(chatID, text string) *Message + func (b *Bot) NewTextMessageWithRequestID(chatID, text, requestID string) *Message + func (b *Bot) NewVoiceMessage(chatID string, file *os.File) *Message + func (b *Bot) NewVoiceMessageByFileID(chatID, fileID string) *Message + func (b *Bot) ResolveChatJoinRequests(chatID, userID string, accept, everyone bool) error + func (b *Bot) SendChatActions(chatID string, actions ...ChatAction) error + func (b *Bot) SendMessage(message *Message) error + func (b *Bot) SetChatAbout(chatID, about string) error + func (b *Bot) SetChatRules(chatID, rules string) error + func (b *Bot) SetChatTitle(chatID, title string) error + func (b *Bot) UnblockChatUser(chatID, userID string) error + type BotApiURL string + func (o BotApiURL) Type() string + func (o BotApiURL) Value() interface{} + type BotDebug bool + func (o BotDebug) Type() string + func (o BotDebug) Value() interface{} + type BotHTTPClient http.Client + func (o BotHTTPClient) Type() string + func (o BotHTTPClient) Value() interface{} + type BotInfo struct + About string + FirstName string + Nick string + Photo []Photo + func (v *BotInfo) UnmarshalEasyJSON(l *jlexer.Lexer) + func (v *BotInfo) UnmarshalJSON(data []byte) error + func (v BotInfo) MarshalEasyJSON(w *jwriter.Writer) + func (v BotInfo) MarshalJSON() ([]byte, error) + type BotOption interface + Type func() string + Value func() interface{} + type Button struct + CallbackData string + Style ButtonStyle + Text string + URL string + func NewCallbackButton(text string, callbackData string) Button + func NewURLButton(text string, url string) Button + func (v *Button) UnmarshalEasyJSON(l *jlexer.Lexer) + func (v *Button) UnmarshalJSON(data []byte) error + func (v Button) MarshalEasyJSON(w *jwriter.Writer) + func (v Button) MarshalJSON() ([]byte, error) + func (v Button) WithStyle(style ButtonStyle) Button + type ButtonResponse struct + CallbackData string + QueryID string + ShowAlert bool + Text string + URL string + func (cl *ButtonResponse) Send() error + func (v *ButtonResponse) UnmarshalEasyJSON(l *jlexer.Lexer) + func (v *ButtonResponse) UnmarshalJSON(data []byte) error + func (v ButtonResponse) MarshalEasyJSON(w *jwriter.Writer) + func (v ButtonResponse) MarshalJSON() ([]byte, error) + type ButtonStyle string + const ButtonAttention + const ButtonPrimary + type Chat struct + About string + FirstName string + ID string + InviteLink string + IsBot bool + JoinModeration bool + LastName string + Nick string + Public bool + Rules string + Title string + Type ChatType + func (c *Chat) BlockUser(userID string, deleteLastMessages bool) error + func (c *Chat) GetAdmins() ([]ChatMember, error) + func (c *Chat) GetBlockedUsers() ([]User, error) + func (c *Chat) GetMembers() ([]ChatMember, error) + func (c *Chat) GetPendingUsers() ([]User, error) + func (c *Chat) ResolveAllJoinRequests(accept bool) error + func (c *Chat) ResolveJoinRequest(userID string, accept bool) error + func (c *Chat) SendActions(actions ...ChatAction) error + func (c *Chat) SetAbout(about string) error + func (c *Chat) SetRules(rules string) error + func (c *Chat) SetTitle(title string) error + func (c *Chat) UnblockUser(userID string) error + func (v *Chat) UnmarshalEasyJSON(l *jlexer.Lexer) + func (v *Chat) UnmarshalJSON(data []byte) error + func (v Chat) MarshalEasyJSON(w *jwriter.Writer) + func (v Chat) MarshalJSON() ([]byte, error) + type ChatAction = string + const LookingAction + const TypingAction + type ChatMember struct + Admin bool + Creator bool + func (v *ChatMember) UnmarshalEasyJSON(l *jlexer.Lexer) + func (v *ChatMember) UnmarshalJSON(data []byte) error + func (v ChatMember) MarshalEasyJSON(w *jwriter.Writer) + func (v ChatMember) MarshalJSON() ([]byte, error) + type ChatType = string + const Channel + const Group + const Private + type Client struct + func NewClient(baseURL string, token string, logger *logrus.Logger) *Client + func NewCustomClient(client *http.Client, baseURL string, token string, logger *logrus.Logger) *Client + func (c *Client) BlockChatUser(chatID, userID string, deleteLastMessages bool) error + func (c *Client) DeleteMessage(message *Message) error + func (c *Client) Do(path string, params url.Values, file *os.File) ([]byte, error) + func (c *Client) DoWithContext(ctx context.Context, path string, params url.Values, file *os.File) ([]byte, error) + func (c *Client) EditMessage(message *Message) error + func (c *Client) GetChatAdmins(chatID string) ([]ChatMember, error) + func (c *Client) GetChatBlockedUsers(chatID string) ([]User, error) + func (c *Client) GetChatInfo(chatID string) (*Chat, error) + func (c *Client) GetChatMembers(chatID string) ([]ChatMember, error) + func (c *Client) GetChatPendingUsers(chatID string) ([]User, error) + func (c *Client) GetEvents(lastEventID int, pollTime int) ([]*Event, error) + func (c *Client) GetEventsWithContext(ctx context.Context, lastEventID int, pollTime int) ([]*Event, error) + func (c *Client) GetFileInfo(fileID string) (*File, error) + func (c *Client) GetInfo() (*BotInfo, error) + func (c *Client) GetVoiceInfo(fileID string) (*File, error) + func (c *Client) PinMessage(message *Message) error + func (c *Client) ResolveChatPending(chatID, userID string, approve, everyone bool) error + func (c *Client) SendAnswerCallbackQuery(answer *ButtonResponse) error + func (c *Client) SendChatActions(chatID string, actions ...ChatAction) error + func (c *Client) SendFileMessage(message *Message) error + func (c *Client) SendTextMessage(message *Message) error + func (c *Client) SendTextWithDeeplinkMessage(message *Message) error + func (c *Client) SendVoiceMessage(message *Message) error + func (c *Client) SetChatAbout(chatID, about string) error + func (c *Client) SetChatRules(chatID, rules string) error + func (c *Client) SetChatTitle(chatID, title string) error + func (c *Client) UnblockChatUser(chatID, userID string) error + func (c *Client) UnpinMessage(message *Message) error + func (c *Client) UploadFile(message *Message) error + func (c *Client) UploadVoice(message *Message) error + type Contact struct + FirstName string + LastName string + func (v *Contact) UnmarshalEasyJSON(l *jlexer.Lexer) + func (v *Contact) UnmarshalJSON(data []byte) error + func (v Contact) MarshalEasyJSON(w *jwriter.Writer) + func (v Contact) MarshalJSON() ([]byte, error) + type Event struct + EventID int + Payload EventPayload + Type EventType + func (v *Event) UnmarshalEasyJSON(l *jlexer.Lexer) + func (v *Event) UnmarshalJSON(data []byte) error + func (v Event) MarshalEasyJSON(w *jwriter.Writer) + func (v Event) MarshalJSON() ([]byte, error) + type EventPayload struct + AddedBy Contact + CallbackData string + CallbackMsg BaseEventPayload + LeftMembers []Contact + NewMembers []Contact + Parts []Part + QueryID string + RemovedBy Contact + func (ep *EventPayload) CallbackMessage() *Message + func (ep *EventPayload) CallbackQuery() *ButtonResponse + func (ep *EventPayload) Message() *Message + func (v *EventPayload) UnmarshalEasyJSON(l *jlexer.Lexer) + func (v *EventPayload) UnmarshalJSON(data []byte) error + func (v EventPayload) MarshalEasyJSON(w *jwriter.Writer) + func (v EventPayload) MarshalJSON() ([]byte, error) + type EventType string + type File struct + ID string + Name string + Size uint64 + Type string + URL string + func (v *File) UnmarshalEasyJSON(l *jlexer.Lexer) + func (v *File) UnmarshalJSON(data []byte) error + func (v File) MarshalEasyJSON(w *jwriter.Writer) + func (v File) MarshalJSON() ([]byte, error) + type Keyboard struct + Rows [][]Button + func NewKeyboard() Keyboard + func (k *Keyboard) AddButton(rowIndex int, button Button) error + func (k *Keyboard) AddRow(row ...Button) + func (k *Keyboard) ChangeButton(rowIndex, buttonIndex int, newButton Button) error + func (k *Keyboard) DeleteButton(rowIndex, buttonIndex int) error + func (k *Keyboard) DeleteRow(index int) error + func (k *Keyboard) GetKeyboard() [][]Button + func (k *Keyboard) RowSize(row int) int + func (k *Keyboard) RowsCount() int + func (k *Keyboard) SwapRows(first, second int) error + type MembersListResponse struct + List []ChatMember + func (v *MembersListResponse) UnmarshalEasyJSON(l *jlexer.Lexer) + func (v *MembersListResponse) UnmarshalJSON(data []byte) error + func (v MembersListResponse) MarshalEasyJSON(w *jwriter.Writer) + func (v MembersListResponse) MarshalJSON() ([]byte, error) + type Message struct + Chat Chat + ContentType MessageContentType + Deeplink string + File *os.File + FileID string + ForwardChatID string + ForwardMsgID string + ID string + InlineKeyboard *Keyboard + ParseMode ParseMode + ReplyMsgID string + RequestID string + Text string + Timestamp int + func (m *Message) AppendParseMode(mode ParseMode) + func (m *Message) AttachExistingFile(fileID string) + func (m *Message) AttachExistingVoice(fileID string) + func (m *Message) AttachInlineKeyboard(keyboard Keyboard) + func (m *Message) AttachNewFile(file *os.File) + func (m *Message) AttachNewVoice(file *os.File) + func (m *Message) Delete() error + func (m *Message) Edit() error + func (m *Message) Forward(chatID string) error + func (m *Message) Pin() error + func (m *Message) Reply(text string) error + func (m *Message) Send() error + func (m *Message) Unpin() error + func (v *Message) UnmarshalEasyJSON(l *jlexer.Lexer) + func (v *Message) UnmarshalJSON(data []byte) error + func (v Message) MarshalEasyJSON(w *jwriter.Writer) + func (v Message) MarshalJSON() ([]byte, error) + type MessageContentType uint8 + const Deeplink + const OtherFile + const Text + const Unknown + const Voice + type MockHandler struct + func (h *MockHandler) GetEvents(w http.ResponseWriter) + func (h *MockHandler) SendMessage(w http.ResponseWriter) + func (h *MockHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) + func (h *MockHandler) TokenError(w http.ResponseWriter) + type ParseMode string + const ParseModeHTML + const ParseModeMarkdownV2 + type Part struct + Payload PartPayload + Type PartType + func (v *Part) UnmarshalEasyJSON(l *jlexer.Lexer) + func (v *Part) UnmarshalJSON(data []byte) error + func (v Part) MarshalEasyJSON(w *jwriter.Writer) + func (v Part) MarshalJSON() ([]byte, error) + type PartMessage struct + From Contact + MsgID string + Text string + Timestamp int + func (v *PartMessage) UnmarshalEasyJSON(l *jlexer.Lexer) + func (v *PartMessage) UnmarshalJSON(data []byte) error + func (v PartMessage) MarshalEasyJSON(w *jwriter.Writer) + func (v PartMessage) MarshalJSON() ([]byte, error) + type PartPayload struct + Caption string + FileID string + FirstName string + LastName string + Message PartMessage + PartMessage PartMessage + Type string + UserID string + func (v *PartPayload) UnmarshalEasyJSON(l *jlexer.Lexer) + func (v *PartPayload) UnmarshalJSON(data []byte) error + func (v PartPayload) MarshalEasyJSON(w *jwriter.Writer) + func (v PartPayload) MarshalJSON() ([]byte, error) + type PartType string + type Photo struct + URL string + func (v *Photo) UnmarshalEasyJSON(l *jlexer.Lexer) + func (v *Photo) UnmarshalJSON(data []byte) error + func (v Photo) MarshalEasyJSON(w *jwriter.Writer) + func (v Photo) MarshalJSON() ([]byte, error) + type Response struct + Description string + OK bool + func (v *Response) UnmarshalEasyJSON(l *jlexer.Lexer) + func (v *Response) UnmarshalJSON(data []byte) error + func (v Response) MarshalEasyJSON(w *jwriter.Writer) + func (v Response) MarshalJSON() ([]byte, error) + type Updater struct + PollTime int + func NewUpdater(client *Client, pollTime int, logger *logrus.Logger) *Updater + func (u *Updater) GetLastEvents(pollTime int) ([]*Event, error) + func (u *Updater) GetLastEventsWithContext(ctx context.Context, pollTime int) ([]*Event, error) + func (u *Updater) NewMessageFromPayload(message EventPayload) *Message + func (u *Updater) RunUpdatesCheck(ctx context.Context, ch chan<- Event) + type User struct + ID string + func (v *User) UnmarshalEasyJSON(l *jlexer.Lexer) + func (v *User) UnmarshalJSON(data []byte) error + func (v User) MarshalEasyJSON(w *jwriter.Writer) + func (v User) MarshalJSON() ([]byte, error) + type UsersListResponse struct + List []User + func (v *UsersListResponse) UnmarshalEasyJSON(l *jlexer.Lexer) + func (v *UsersListResponse) UnmarshalJSON(data []byte) error + func (v UsersListResponse) MarshalEasyJSON(w *jwriter.Writer) + func (v UsersListResponse) MarshalJSON() ([]byte, error)