sanction

package
v0.0.0-...-90cead1 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2024 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupSanctionTypes

func SetupSanctionTypes(t []*Type, retCfg []*config.RetentionConfig) error

func UpdateRecord

func UpdateRecord(s *discordgo.Session, client *redis.Client)

Types

type Duration

type Duration struct {
	Days   uint
	Months uint
	Years  uint
}

func LoadDuration

func LoadDuration(duration string) (*Duration, error)

func (*Duration) ToString

func (d *Duration) ToString() string

func (*Duration) ToUint

func (d *Duration) ToUint() uint

type Member

type Member struct {
	UserID  string
	GuildID string
}

func (*Member) GetAllRecord

func (m *Member) GetAllRecord() ([]*ModRecord, error)

func (*Member) Sanction

func (m *Member) Sanction(record *ModRecord) error

type ModRecord

type ModRecord struct {
	gorm.Model
	UserID   string
	GuildID  string
	Proof    string
	Duration uint
	Reason   string
	Sanction *Type
	Removed  bool `gorm:"default:false"`
}

func CreateSanction

func CreateSanction(sanction *Type, reason string, proof string, duration uint) *ModRecord

type Type

type Type struct {
	gorm.Model
	Name        string `gorm:"unique" toml:"name"`
	Description string `toml:"description"`
	Retention   int8   `toml:"retention"`
}
var (
	BanCommandSanction Type
)

Jump to

Keyboard shortcuts

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