Versions in this module Expand all Collapse all v0 v0.2.0 Jul 5, 2022 Changes in this version + const ScopeTypeAllChatAdministrators + const ScopeTypeAllGroupChats + const ScopeTypeAllPrivateChats + const ScopeTypeChat + const ScopeTypeChatAdministrators + const ScopeTypeChatMember + const ScopeTypeDefault + type Bot struct + func NewBot(api *tgbotapi.BotAPI, opts ...Option) *Bot + func (bot *Bot) AddCommands(commands ...*Command) + func (bot *Bot) ClearBotCommands() error + func (bot *Bot) Commands() map[string]*Command + func (bot *Bot) CommandsWithScope() map[CommandScope][]*Command + func (bot *Bot) Run() error + func (bot *Bot) Stop() context.Context + type Command struct + Description string + Handler Handler + Name string + func NewCommand(name, desc string, handler Handler, opts ...CommandOption) *Command + func (c *Command) Hide() bool + func (c *Command) Scopes() []CommandScope + func (c Command) String() string + type CommandOption func(cmd *Command) + func WithHide(v bool) CommandOption + func WithScopes(scopes ...CommandScope) CommandOption + type CommandScope interface + ChatID func() int64 + LanguageCode func() string + Type func() string + UserID func() int64 + func CommandScopeAllChatAdministrators(lc ...string) CommandScope + func CommandScopeAllGroupChats(lc ...string) CommandScope + func CommandScopeAllPrivateChats(lc ...string) CommandScope + func CommandScopeChat(chatID int64, lc ...string) CommandScope + func CommandScopeChatAdministrators(chatID int64, lc ...string) CommandScope + func CommandScopeChatMember(chatID, userID int64, lc ...string) CommandScope + func CommandScopeDefault(lc ...string) CommandScope + func CommandScopeNoScope() CommandScope + type Context struct + func (c *Context) Command() string + func (c *Context) CommandArgs() string + func (c *Context) FromChat() *tgbotapi.Chat + func (c *Context) IsCommand() bool + func (c *Context) Message() *tgbotapi.Message + func (c *Context) ReplyHTML(text string, opts ...MessageOption) error + func (c *Context) ReplyMarkdown(text string, opts ...MessageOption) error + func (c *Context) ReplyText(text string, opts ...MessageOption) error + func (c *Context) SendReply(chat tgbotapi.Chattable) error + func (c *Context) SentFrom() *tgbotapi.User + func (c *Context) Update() *tgbotapi.Update + func (c *Context) WithContext(ctx context.Context) *Context + type ErrHandler func(err error) + type Handler func(ctx *Context) error + type MessageOption func(c *tgbotapi.MessageConfig) + func WithChatId(chatId int64) MessageOption + func WithDisableWebPagePreview(disable bool) MessageOption + func WithHTML() MessageOption + func WithInlineKeyboardMarkup(markup tgbotapi.InlineKeyboardMarkup) MessageOption + func WithKeyboardMarkup(markup tgbotapi.ReplyKeyboardMarkup) MessageOption + func WithMarkdown() MessageOption + func WithMarkdownV2() MessageOption + func WithRemoveKeyboard(markup tgbotapi.ReplyKeyboardRemove) MessageOption + type Option func(o *options) + func WithBufferSize(size int) Option + func WithContext(ctx context.Context) Option + func WithDisableAutoSetupCommands(v bool) Option + func WithDisableHandleAllUpdateOnStop(v bool) Option + func WithErrorHandler(h ErrHandler) Option + func WithGetUpdatesAllowedUpdates(v ...string) Option + func WithGetUpdatesLimit(limit int) Option + func WithGetUpdatesTimeout(timeout int) Option + func WithPanicHandler(h PanicHandler) Option + func WithTimeout(d time.Duration) Option + func WithUndefinedCmdHandler(h Handler) Option + func WithUpdatesHandler(handler UpdatesHandler) Option + func WithWorkersNum(n int) Option + func WithWorkersPool(p Pool) Option + type PanicHandler func(*Context, interface{}) + type Pool interface + Go func(f func()) error + IsClosed func() bool + func NewAntsPool(p *ants.Pool) Pool + type UpdatesHandler func(ctx *Context)