Documentation
¶
Index ¶
Constants ¶
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: " )
const ( // MsgHelpRickListInfo is the help text for ?ricklist MsgHelpRickListInfo = "" /* 162-byte string literal not displayed */ )
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 ¶
NewFeature returns a new Feature.
func (*Feature) CommandInterceptors ¶
func (f *Feature) CommandInterceptors() []feature.CommandInterceptor
CommandInterceptors returns command interceptors.
func (*Feature) FallbackParser ¶
FallbackParser returns nil.
func (*Feature) OnInitialLoad ¶
func (f *Feature) OnInitialLoad(s api.DiscordSession) error
OnInitialLoad does nothing.
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 ¶
func (i *RickListCommandInterceptor) Intercept(command *model.Command, s api.DiscordSession) (*model.Command, error)
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.