filter

package
v0.0.0-...-094d83a Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	Mute   bool
	Ban    bool
	Delete bool
}

type Delete

type Delete struct {
	Checker func(string) bool
}

func (*Delete) Check

func (f *Delete) Check(ctx context.Context, message Message) (actions []Action, stop bool)

type DeleteAdvanced

type DeleteAdvanced struct {
	Checker func(*discordgo.Message) bool
}

func (*DeleteAdvanced) Check

func (f *DeleteAdvanced) Check(ctx context.Context, message Message) (actions []Action, stop bool)

type Filter

type Filter interface {
	Check(ctx context.Context, message Message) (actions []Action, stop bool)
}

type Message

type Message struct {
	DiscordMessage *discordgo.Message
}

type Mute

type Mute struct {
	Checker func(string) bool
}

func (*Mute) Check

func (f *Mute) Check(ctx context.Context, message Message) (actions []Action, stop bool)

type Runner

type Runner struct {
	Dry bool
	// contains filtered or unexported fields
}

func NewRunner

func NewRunner() *Runner

func (*Runner) AddFilter

func (r *Runner) AddFilter(f Filter)

func (*Runner) OnBan

func (r *Runner) OnBan(cb func(message Message))

func (*Runner) OnDelete

func (r *Runner) OnDelete(cb func(message Message))

func (*Runner) OnMute

func (r *Runner) OnMute(cb func(message Message))

func (*Runner) Run

func (r *Runner) Run(ctx context.Context)

func (*Runner) ScanMessage

func (r *Runner) ScanMessage(message Message)

Jump to

Keyboard shortcuts

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