middleware

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2020 License: ISC Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrOnCooldown     = errors.New("command is on cooldown")
	ErrChannelNotNSFW = errors.New("this command can only be used in an NSFW channel")
)

Errors

Functions

func CatchReply

func CatchReply(message string) func(ctx *router.Context)

CatchReply returns a function that prints the message you pass it

func Permission

func Permission(permission int) router.MiddlewareFunc

Permission validates the permission level

func RequireNSFW

func RequireNSFW(catch CatchFunc) router.MiddlewareFunc

RequireNSFW requires a message to be sent from an NSFW channel

Types

type CatchFunc

type CatchFunc func(ctx *router.Context)

CatchFunc function called if one of the middleware experiences an error Can be left as nil

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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