commands

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

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

Go to latest
Published: Dec 2, 2021 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Log = &logrus.Logger{
	Out:       os.Stderr,
	Formatter: new(logrus.TextFormatter),
	Hooks:     make(logrus.LevelHooks),
	Level:     logrus.InfoLevel,
}

Functions

func ParseMessage

func ParseMessage(session disgord.Session, event *disgord.MessageCreate, guild *disgord.Guild, message string)

Types

type Command

type Command struct {
	Name        string
	HelpMessage string

	GuildOwnerOnly     bool
	RequirePermissions bool
	PermissionsLevel   disgord.PermissionBit

	RequireArguments     bool
	MinimumArgumentsSize int
	MaximumArgumentsSize int

	NSFW bool

	Exec func(disgord.Session, *disgord.MessageCreate, *disgord.Guild, []string) error
}

func NewCommand

func NewCommand(name string, requirePermissions bool, nsfw bool, f func(disgord.Session, *disgord.MessageCreate, *disgord.Guild, []string) error) Command

func (*Command) Register

func (command *Command) Register() Command

func (*Command) SetArgumentsRequirements

func (command *Command) SetArgumentsRequirements(requireArguments bool, minimumArgumentsSize int, maximumArgumentsSize int)

If MinimumArgumentsSize is set to -1 that means no limit If MinimumArgumentsSize is set to -1 that means no limit

func (*Command) SetHelpMessage

func (command *Command) SetHelpMessage(message string)

func (*Command) SetPermissions

func (command *Command) SetPermissions(requirePermissions bool, guildOwnerOnly bool, permissionsLevel disgord.PermissionBit)

type GuildCaller

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

func (*GuildCaller) Guild

Jump to

Keyboard shortcuts

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