Documentation ¶
Index ¶
- func DefaultAuthExtractor(ctx context.Context, update *Update) (map[string]any, error)
- func DefaultBotOptions() []bot.Option
- func DefaultErrorHandler(ctx context.Context, b *bot.Bot, update *Update, err error)
- func MarshalData[T any](route string, data T) string
- func NewRecoveryMiddleware() bot.Middleware
- func SendErrorMessageHandler(ctx context.Context, b *bot.Bot, update *Update, err error)
- func SendMessage(ctx context.Context, b *bot.Bot, update *Update, m *Message) error
- func UnmarshalData[T any](data string) (string, *T, error)
- func WithMiddleware(h HandlerFunc, e ErrorHandlerFunc, middleware ...MiddlewareFunc) bot.HandlerFunc
- type AuthExtractorFunc
- type Bot
- func (b *Bot) BindCallback(route string, handlerFunc HandlerFunc, middlewares ...MiddlewareFunc)
- func (b *Bot) BindCommand(command string, handlerFunc HandlerFunc, middlewares ...MiddlewareFunc)
- func (b *Bot) Close(ctx context.Context) error
- func (b *Bot) ExtractorAuth(ctx context.Context, tBot *bot.Bot, update *Update) (context.Context, bool)
- func (b *Bot) Run(ctx context.Context, options ...func(*bot.Bot) error) error
- func (b *Bot) SendMessage(ctx context.Context, update *Update, m *Message) error
- type Button
- type Config
- type Context
- type ErrorHandlerFunc
- type HandlerFunc
- type Message
- type MethodExtraData
- type MiddlewareFunc
- type Update
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultAuthExtractor ¶
func DefaultBotOptions ¶
func DefaultErrorHandler ¶
func MarshalData ¶
func NewRecoveryMiddleware ¶
func NewRecoveryMiddleware() bot.Middleware
func SendErrorMessageHandler ¶
func SendMessage ¶
func WithMiddleware ¶
func WithMiddleware(h HandlerFunc, e ErrorHandlerFunc, middleware ...MiddlewareFunc) bot.HandlerFunc
Types ¶
type AuthExtractorFunc ¶
type Bot ¶
type Bot struct { BotOptions func() []bot.Option ErrorHandler ErrorHandlerFunc AuthExtractor AuthExtractorFunc // contains filtered or unexported fields }
func (*Bot) BindCallback ¶
func (b *Bot) BindCallback(route string, handlerFunc HandlerFunc, middlewares ...MiddlewareFunc)
func (*Bot) BindCommand ¶
func (b *Bot) BindCommand(command string, handlerFunc HandlerFunc, middlewares ...MiddlewareFunc)
func (*Bot) ExtractorAuth ¶
type ErrorHandlerFunc ¶
type MethodExtraData ¶
func NewMethodExtraData ¶
func NewMethodExtraData(raw map[string]string) *MethodExtraData
type MiddlewareFunc ¶
type MiddlewareFunc = func(next HandlerFunc) HandlerFunc
func NewSingleFlightMiddleware ¶
func NewSingleFlightMiddleware() MiddlewareFunc
Click to show internal directories.
Click to hide internal directories.