moderation

package
v0.0.0-...-792b534 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2025 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FreePlanModerationConstraints = &ModerationConstraints{
	MessagePrune: &MessagePruneConstraints{
		TotalMaxMessages: 1000,
		MinPerChannel:    10,
	},
	MaxServerModeration: 5,
}

Functions

This section is empty.

Types

type MessagePrune

type MessagePrune struct {
	// Constraints, this is auto-set by the job in jobserver and hence not configurable in this mode.
	Constraints *ModerationConstraints

	// Backup options
	Options MessagePruneOpts
}

func (*MessagePrune) Exec

func (t *MessagePrune) Exec(
	l *zap.Logger,
	state jobstate.State,
	progstate jobstate.ProgressState,
) (*types.Output, error)

func (*MessagePrune) Expiry

func (t *MessagePrune) Expiry() *time.Duration

func (*MessagePrune) Fields

func (t *MessagePrune) Fields() map[string]any

func (*MessagePrune) LocalPresets

func (t *MessagePrune) LocalPresets() *interfaces.PresetInfo

func (*MessagePrune) Name

func (t *MessagePrune) Name() string

func (*MessagePrune) Resumable

func (t *MessagePrune) Resumable() bool

func (*MessagePrune) Validate

func (t *MessagePrune) Validate(state jobstate.State) error

type MessagePruneConstraints

type MessagePruneConstraints struct {
	TotalMaxMessages int `description:"The maximum number of messages to prune"`
	MinPerChannel    int `description:"The minimum number of messages to prune per channel"`
}

type MessagePruneOpts

type MessagePruneOpts struct {
	UserID             string         `description:"If set, the user id to prune messages of"`
	Channels           []string       `description:"If set, the channels to prune messages from"`
	IgnoreErrors       bool           `description:"If set, ignore errors while pruning"`
	MaxMessages        int            `description:"The maximum number of messages to prune"`
	PruneFrom          timex.Duration `description:"If set, the time to prune messages from."`
	PerChannel         int            `description:"The minimum number of messages to prune per channel"`
	RolloverLeftovers  bool           `description:"Whether to attempt rollover of leftover message quota to another channels or not"`
	SpecialAllocations map[string]int `description:"Specific channel allocation overrides"`
}

Options that can be set when pruning a message

type ModerationConstraints

type ModerationConstraints struct {
	MessagePrune        *MessagePruneConstraints
	MaxServerModeration int // How many moderation related jobs can run concurrently per server
}

Jump to

Keyboard shortcuts

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