commands

package
v0.0.0-...-b615ece Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAdmin

func CheckAdmin(ID string) bool

CheckAdmin checks if the user attempting to run an admin command is an admin

func RegisterCommands

func RegisterCommands()

RegisterCommands registers the commands on start up.

func RunCommand

func RunCommand(input string, s *discordgo.Session, m *discordgo.MessageCreate)

RunCommand runs a specified command.

Types

type Command

type Command struct {
	Name     string
	Command  func(s *discordgo.Session, m *discordgo.MessageCreate)
	Command1 func(s *discordgo.Session, m *discordgo.MessageCreate, arg1 string)
	Command2 func(s *discordgo.Session, m *discordgo.MessageCreate, arg1 string, arg2 string)
	Admin    bool
	Args     int
	Desc     string
}

Command is a struct containing fields that hold command information.

type Commands

type Commands struct {
	CommandList []Command
}

Commands is a struct containing a slice of Command.

var CL Commands

CL is a Commands interface.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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