middlewares

package
v0.0.0-...-cd6a17b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const USER_CTX_KEY types.CtxKey = "botUser"

Variables

This section is empty.

Functions

func WithUserHandler

func WithUserHandler(handler UserHandlerFunc) bot.HandlerFunc

Types

type User

type User struct {
	ID        int64
	ChatID    int64
	Lang      string
	Localizer *i18n.Localizer
	Settings  UserSettings
	Action    *UserAction
}

type UserAction

type UserAction struct {
	Action  services.UserAction
	Payload *string
}

type UserHandlerFunc

type UserHandlerFunc func(context.Context, *User, *bot.Bot, *models.Update)

type UserMiddleware

type UserMiddleware struct {
	// contains filtered or unexported fields
}

func CreateUserMiddleware

func CreateUserMiddleware(
	userService *services.UserService,
	userActionService *services.UserActionService,
	languages *languages.Languages,
) *UserMiddleware

func (*UserMiddleware) Middleware

func (m *UserMiddleware) Middleware(next bot.HandlerFunc) bot.HandlerFunc

type UserSettings

type UserSettings struct {
	PayoutsNotify bool
	BlocksNotify  bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL