Documentation ¶
Index ¶
- Variables
- type MessagePruneConstraints
- type MessagePruneOpts
- type MessagePruneTask
- func (t *MessagePruneTask) CorrespondingBotCommand_Create() string
- func (t *MessagePruneTask) CorrespondingBotCommand_Download() string
- func (t *MessagePruneTask) CorrespondingBotCommand_View() string
- func (t *MessagePruneTask) Exec(l *zap.Logger, state taskstate.TaskState, ...) (*types.TaskOutput, error)
- func (t *MessagePruneTask) Expiry() *time.Duration
- func (t *MessagePruneTask) LocalPresets() *taskdef.PresetInfo
- func (t *MessagePruneTask) Name() string
- func (t *MessagePruneTask) Resumable() bool
- func (t *MessagePruneTask) TaskFields() map[string]any
- func (t *MessagePruneTask) TaskFor() *types.TaskFor
- func (t *MessagePruneTask) Validate(state taskstate.TaskState) error
- type ModerationConstraints
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 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 (t *MessagePruneTask) Exec( l *zap.Logger, state taskstate.TaskState, progstate taskstate.TaskProgressState, ) (*types.TaskOutput, error)
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
type ModerationConstraints ¶
type ModerationConstraints struct { MessagePrune *MessagePruneConstraints MaxServerModerationTasks int // How many moderation tasks can run concurrently per server }
Click to show internal directories.
Click to hide internal directories.