user

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	T_Prohibit permissions = iota
	T_Guest
	T_Subscribe
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Task

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

func GetTask

func GetTask(userID int64, types TaskType) (*Task, error)

func (*Task) Down

func (task *Task) Down()

func (*Task) ID

func (task *Task) ID() int64

func (*Task) Set

func (t *Task) Set(key string, value any)

func (*Task) Type

func (task *Task) Type() TaskType

func (*Task) Value

func (t *Task) Value(key string) any

type TaskType

type TaskType uint
const (
	T_Draw TaskType = iota
	T_GuessTag
	T_CtrlPhoto
	T_SuperResolution
)

type UserInfo

type UserInfo struct {
	UserInfo   *db.UserInfo
	Subscribe  *db.Subscribe
	ChatMember *tgbotapi.ChatMember
	LastUpdate time.Time
}

func LoadAndInitUser

func LoadAndInitUser(bot *tgbotapi.BotAPI, userID int64) (u *UserInfo, err error)

func LoadUser

func LoadUser(bot *tgbotapi.BotAPI, userID int64) (u *UserInfo, err error)

func (*UserInfo) AddTask

func (u *UserInfo) AddTask(types TaskType) (*Task, error)

func (*UserInfo) ChangeDefaultMODE

func (u *UserInfo) ChangeDefaultMODE(mode string) error

func (*UserInfo) ChangeDefaultNumber

func (u *UserInfo) ChangeDefaultNumber(num int) error

func (*UserInfo) ChangeDefaultScale

func (u *UserInfo) ChangeDefaultScale(scale int) error

func (*UserInfo) ChangeDefaultSteps

func (u *UserInfo) ChangeDefaultSteps(steps int) error

func (*UserInfo) ChangeDefaultUC

func (u *UserInfo) ChangeDefaultUC(uc string) error

func (*UserInfo) ChangeShare

func (u *UserInfo) ChangeShare(share bool) error

func (*UserInfo) DefaultConfig

func (u *UserInfo) DefaultConfig() *api.DrawConfig

func (*UserInfo) LoadExtraLang

func (u *UserInfo) LoadExtraLang(tag string) string

func (*UserInfo) LoadLang

func (u *UserInfo) LoadLang(tag string) string

func (*UserInfo) Passwd

func (u *UserInfo) Passwd() string

userID -> passwd

func (*UserInfo) Permissions

func (u *UserInfo) Permissions() permissions

func (*UserInfo) ProhibitString

func (u *UserInfo) ProhibitString(bot *tgbotapi.BotAPI) string

func (*UserInfo) SetLang

func (u *UserInfo) SetLang(langType string) error

func (*UserInfo) UseFree

func (u *UserInfo) UseFree(n int)

Jump to

Keyboard shortcuts

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