user

package
v1.4.5 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package user provides a User object and it's associated methods

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type User added in v1.4.0

type User struct {
	AuthorId       string
	AuthorName     string
	ChanPermission int64
	Mention        string
	RatCookie      string
	UserInfo       *models.RegisteredUser
}

User is a struct of user object. Each incoming message in the command_handler will try to create a User object based on the message it received

func NewUser added in v1.4.0

func NewUser(d *gorm.DB, c *viper.Viper, i string) (*User, error)

NewUser creates and returns a new User object

func (*User) CheckAuth added in v1.4.4

func (u *User) CheckAuth(d *gorm.DB, h *http.Client) (bool, error)

func (*User) HasRatCookie added in v1.4.0

func (u *User) HasRatCookie() bool

HasRatCookie returns true when *User has a valid SoT RAT cookie set in the database

func (*User) IsAdmin added in v1.4.0

func (u *User) IsAdmin() bool

IsAdmin returns true when *User has channel admin permission

func (*User) IsRegistered added in v1.4.0

func (u *User) IsRegistered() bool

IsRegistered return true when *User is registered

func (*User) UpdateSotBalance added in v1.4.0

func (u *User) UpdateSotBalance(d *gorm.DB, h *http.Client) error

func (*User) UserNeedsNotifyFailedToken added in v1.4.4

func (u *User) UserNeedsNotifyFailedToken(d *gorm.DB) bool

Jump to

Keyboard shortcuts

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