permissions

package
v0.0.0-...-abaa55c Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: GPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MustBeAdmin = &command.Permission{
	Name: "be server admin",
	Checker: func(ctx *command.Context) bool {
		if ctx.GuildID == "" {
			return false
		}

		member, err := ctx.Bot.GetMember(ctx.GuildID, "", ctx.AuthorID)
		if err != nil {
			return false
		}

		return member.Permissions().Has(model.PermissionAdministrator)
	},
}
View Source
var MustBeOwner = &command.Permission{
	Name: "be the bot owner",
	Checker: func(ctx *command.Context) bool {
		return ctx.AuthorID == config.Config.OwnerID
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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