moderation

package
v0.0.0-...-bf34452 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MsgRickListEmpty prints that nobody is on the rickroll moderation list
	MsgRickListEmpty = "Nobody is on the ricklist."
	// MsgRickListUsers is a header for who is on the rickroll moderation list
	MsgRickListUsers = "On the Rick list: "
)
View Source
const (
	// MsgHelpRickListInfo is the help text for ?ricklist
	MsgHelpRickListInfo = "" /* 162-byte string literal not displayed */
)
View Source
const (
	// MsgRickList is the canonical rickroll URL. Used only for super serious moderation
	MsgRickList = "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Feature

type Feature struct {
	// contains filtered or unexported fields
}

Feature registers feature-specific things for moderation.

func NewFeature

func NewFeature(featureRegistry *feature.Registry, config *config.Config) *Feature

NewFeature returns a new Feature.

func (*Feature) CommandInterceptors

func (f *Feature) CommandInterceptors() []feature.CommandInterceptor

CommandInterceptors returns command interceptors.

func (*Feature) Executors

func (f *Feature) Executors() []feature.Executor

Executors gets the executors.

func (*Feature) FallbackParser

func (f *Feature) FallbackParser() feature.Parser

FallbackParser returns nil.

func (*Feature) OnInitialLoad

func (f *Feature) OnInitialLoad(s api.DiscordSession) error

OnInitialLoad does nothing.

func (*Feature) Parsers

func (f *Feature) Parsers() []feature.Parser

Parsers returns the parsers.

type RickListCommandInterceptor

type RickListCommandInterceptor struct {
	// contains filtered or unexported fields
}

RickListCommandInterceptor asserts that the

func NewRickListCommandInterceptor

func NewRickListCommandInterceptor(config *config.Config) *RickListCommandInterceptor

NewRickListCommandInterceptor returns a new ricklist command interceptor.

func (*RickListCommandInterceptor) Intercept

Intercept checks whether the command is forbidden by the ricklist.

type RickListExecutor

type RickListExecutor struct {
}

RickListExecutor prints a rick roll.

func NewRickListExecutor

func NewRickListExecutor() *RickListExecutor

NewRickListExecutor works as advertised.

func (*RickListExecutor) Execute

func (e *RickListExecutor) Execute(s api.DiscordSession, channel model.Snowflake, command *model.Command)

Execute replies over the given channel with a rick roll.

func (*RickListExecutor) GetType

func (e *RickListExecutor) GetType() int

GetType returns the type.

func (*RickListExecutor) PublicOnly

func (e *RickListExecutor) PublicOnly() bool

PublicOnly returns whether the executor should be intercepted in a private channel.

type RickListInfoExecutor

type RickListInfoExecutor struct {
	// contains filtered or unexported fields
}

RickListInfoExecutor prints a rick roll.

func NewRickListInfoExecutor

func NewRickListInfoExecutor(config *config.Config) *RickListInfoExecutor

NewRickListInfoExecutor works as advertised.

func (*RickListInfoExecutor) Execute

func (e *RickListInfoExecutor) Execute(s api.DiscordSession, channel model.Snowflake, command *model.Command)

Execute replies over the given channel with a rick roll.

func (*RickListInfoExecutor) GetType

func (e *RickListInfoExecutor) GetType() int

GetType returns the type.

func (*RickListInfoExecutor) PublicOnly

func (e *RickListInfoExecutor) PublicOnly() bool

PublicOnly returns whether the executor should be intercepted in a private channel.

type RickListInfoParser

type RickListInfoParser struct{}

RickListInfoParser parses ?list commands.

func NewRickListInfoParser

func NewRickListInfoParser() *RickListInfoParser

NewRickListInfoParser works as advertised.

func (*RickListInfoParser) GetName

func (p *RickListInfoParser) GetName() string

GetName returns the named type of this feature.

func (*RickListInfoParser) HelpText

func (p *RickListInfoParser) HelpText(command string) (string, error)

HelpText explains how to use ?ricklist.

func (*RickListInfoParser) Parse

func (p *RickListInfoParser) Parse(splitContent []string, m *discordgo.MessageCreate) (*model.Command, error)

Parse parses the given list command.

Jump to

Keyboard shortcuts

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