adminonly

package
v0.0.0-...-4c137d3 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2021 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Require

func Require(routeParam string) web.Middleware

Require requires that the current OAuth user has the administrator permission for the current guild. It requires oauth.Require.

Types

type Data

type Data struct {
	UserID discord.UserID

	Guild       *discord.Guild
	MemberCount int
}

Data contains data that follows after the admin check and contains information about the current route.

Routes that use the middleware is guaranteed to have routeData.

func GetData

func GetData(ctx context.Context) Data

Jump to

Keyboard shortcuts

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