Versions in this module Expand all Collapse all v2 v2.0.1 Nov 23, 2023 Changes in this version + const DefaultMaxRoutines + var ContinueGroups = errors.New("group iteration continued") + var EndGroups = errors.New("group iteration ended") + var ErrBotAlreadyExists = errors.New("bot already exists in bot mapping") + var ErrBotUrlPathAlreadyExists = errors.New("url path already exists in bot mapping") + var ErrEmptyPath = errors.New("empty path") + var ErrExpectedEmptyServer = errors.New("expected server to be nil") + var ErrMissingCertOrKeyFile = errors.New("missing certfile or keyfile") + var ErrNotFound = errors.New("not found") + var ErrPanicRecovered = errors.New("panic recovered") + var ErrUnknownDispatcherAction = errors.New("unknown dispatcher action") + func ValidateLoginQuery(query url.Values, token string) (bool, error) + func ValidateWebAppInitData(initData string, token string) (bool, error) + func ValidateWebAppQuery(query url.Values, token string) (bool, error) + type BaseProcessor struct + func (bp BaseProcessor) ProcessUpdate(d *Dispatcher, b *gotgbot.Bot, ctx *Context) error + type Context struct + Data map[string]interface{} + EffectiveChat *gotgbot.Chat + EffectiveMessage *gotgbot.Message + EffectiveSender *gotgbot.Sender + EffectiveUser *gotgbot.User + func NewContext(update *gotgbot.Update, data map[string]interface{}) *Context + func (c *Context) Args() []string + type Dispatcher struct + Error DispatcherErrorHandler + ErrorLog *log.Logger + Panic DispatcherPanicHandler + Processor Processor + UnhandledErrFunc ErrorFunc + func NewDispatcher(opts *DispatcherOpts) *Dispatcher + func (d *Dispatcher) AddHandler(handler Handler) + func (d *Dispatcher) AddHandlerToGroup(h Handler, group int) + func (d *Dispatcher) CurrentUsage() int + func (d *Dispatcher) MaxUsage() int + func (d *Dispatcher) ProcessUpdate(b *gotgbot.Bot, u *gotgbot.Update, data map[string]interface{}) (err error) + func (d *Dispatcher) RemoveGroup(group int) bool + func (d *Dispatcher) RemoveHandlerFromGroup(handlerName string, group int) bool + func (d *Dispatcher) Start(b *gotgbot.Bot, updates <-chan json.RawMessage) + func (d *Dispatcher) Stop() + type DispatcherAction string + const DispatcherActionContinueGroups + const DispatcherActionEndGroups + const DispatcherActionNoop + type DispatcherErrorHandler func(b *gotgbot.Bot, ctx *Context, err error) DispatcherAction + type DispatcherOpts struct + Error DispatcherErrorHandler + ErrorLog *log.Logger + MaxRoutines int + Panic DispatcherPanicHandler + Processor Processor + UnhandledErrFunc ErrorFunc + type DispatcherPanicHandler func(b *gotgbot.Bot, ctx *Context, r interface{}) + type ErrorFunc func(error) + type Handler interface + CheckUpdate func(b *gotgbot.Bot, ctx *Context) bool + HandleUpdate func(b *gotgbot.Bot, ctx *Context) error + Name func() string + type PollingOpts struct + DropPendingUpdates bool + EnableWebhookDeletion bool + GetUpdatesOpts *gotgbot.GetUpdatesOpts + type Processor interface + ProcessUpdate func(d *Dispatcher, b *gotgbot.Bot, ctx *Context) error + type UpdateDispatcher interface + Start func(b *gotgbot.Bot, updates <-chan json.RawMessage) + Stop func() + type Updater struct + Dispatcher UpdateDispatcher + ErrorLog *log.Logger + UnhandledErrFunc ErrorFunc + func NewUpdater(dispatcher UpdateDispatcher, opts *UpdaterOpts) *Updater + func (u *Updater) AddWebhook(b *gotgbot.Bot, urlPath string, opts WebhookOpts) error + func (u *Updater) Idle() + func (u *Updater) SetAllBotWebhooks(domain string, opts *gotgbot.SetWebhookOpts) error + func (u *Updater) StartPolling(b *gotgbot.Bot, opts *PollingOpts) error + func (u *Updater) StartServer(opts WebhookOpts) error + func (u *Updater) StartWebhook(b *gotgbot.Bot, urlPath string, opts WebhookOpts) error + func (u *Updater) Stop() error + func (u *Updater) StopAllBots() + func (u *Updater) StopBot(token string) bool + type UpdaterOpts struct + ErrorLog *log.Logger + UnhandledErrFunc ErrorFunc + type WebhookOpts struct + CertFile string + KeyFile string + ListenAddr string + ListenNet string + ReadHeaderTimeout time.Duration + ReadTimeout time.Duration + SecretToken string + func (w *WebhookOpts) GetListenNet() string