limitations

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLimitationExpiration

func GetLimitationExpiration(userID disgord.Snowflake, command string) (*time.Time, error)

func ReadLimitations

func ReadLimitations(file string) (map[string]*UserLimitations, error)

ReadLimitations reads the user limitations contained inside the given file

func SetLimitationExpiration

func SetLimitationExpiration(userID disgord.Snowflake, command string, expiration time.Time) error

func SetLimitationsFile

func SetLimitationsFile(file string)

SetLimitationsFile sets the file path where the limitations will be written

Types

type UserLimitations

type UserLimitations struct {
	CommandsLimitations map[string]time.Time `json:"commands_limitations"` // Map of limitations for each command
}

UserLimitations contains the data about the limitations of a single user

func NewUserLimitations

func NewUserLimitations() *UserLimitations

NewUserLimitations returns a new UserLimitations object

func (*UserLimitations) Equal

func (u *UserLimitations) Equal(v *UserLimitations) bool

Equal tells whether u and v contain the same data

Jump to

Keyboard shortcuts

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