moderation

package
v0.0.0-...-c1401b0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 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,
	},
	MaxServerModerationTasks: 5,
}

Functions

This section is empty.

Types

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 MessagePruneTask

type MessagePruneTask struct {
	// The ID of the server
	ServerID string

	// Constraints, this is auto-set by the task in jobserver and hence not configurable in this mode.
	Constraints *ModerationConstraints

	// Backup options
	Options MessagePruneOpts
}

func (*MessagePruneTask) CorrespondingBotCommand_Create

func (t *MessagePruneTask) CorrespondingBotCommand_Create() string

func (*MessagePruneTask) CorrespondingBotCommand_Download

func (t *MessagePruneTask) CorrespondingBotCommand_Download() string

func (*MessagePruneTask) CorrespondingBotCommand_View

func (t *MessagePruneTask) CorrespondingBotCommand_View() string

func (*MessagePruneTask) Exec

func (*MessagePruneTask) Expiry

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

func (*MessagePruneTask) LocalPresets

func (t *MessagePruneTask) LocalPresets() *taskdef.PresetInfo

func (*MessagePruneTask) Name

func (t *MessagePruneTask) Name() string

func (*MessagePruneTask) Resumable

func (t *MessagePruneTask) Resumable() bool

func (*MessagePruneTask) TaskFields

func (t *MessagePruneTask) TaskFields() map[string]any

As tasks often deal with sensitive data such as secrets, the TaskFields method returns a map of fields that can be stored in the database

func (*MessagePruneTask) TaskFor

func (t *MessagePruneTask) TaskFor() *types.TaskFor

func (*MessagePruneTask) Validate

func (t *MessagePruneTask) Validate(state taskstate.TaskState) error

type ModerationConstraints

type ModerationConstraints struct {
	MessagePrune             *MessagePruneConstraints
	MaxServerModerationTasks int // How many moderation tasks can run concurrently per server
}

Jump to

Keyboard shortcuts

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