commands

package
v3.2.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Commands = [...]Command{

	{
		Name:    "Server",
		Command: admin.ServerCommand,
		Admin:   true,
		Desc:    "Manage factorio server. " + admin.ServerCommandUsage,
	},
	{
		Name:    "Save",
		Command: admin.SaveServer,
		Admin:   true,
		Desc:    "Save the game.",
	},
	{
		Name:    "Kick",
		Command: admin.KickPlayer,
		Admin:   true,
		Desc:    "Kick a user from the server. " + admin.KickPlayerUsage,
	},
	{
		Name:    "Ban",
		Command: admin.BanPlayer,
		Admin:   true,
		Desc:    "Ban a user from the server. " + admin.BanPlayerUsage,
	},
	{
		Name:    "Unban",
		Command: admin.UnbanPlayer,
		Admin:   true,
		Desc:    "Unban a user from the server. " + admin.UnbanPlayerUsage,
	},
	{
		Name:    "Config",
		Command: admin.ConfigCommand,
		Admin:   true,
		Desc:    "Manage config.json. " + admin.ConfigCommandUsage,
	},
	{
		Name:    "Mod",
		Command: admin.ModCommand,
		Admin:   true,
		Desc:    "Manage mod-list.json. " + admin.ModCommandUsage,
	},

	{
		Name:    "Mods",
		Command: utils.ModsList,
		Admin:   false,
		Desc:    "List the mods on the server. " + utils.ModListUsage,
	},
	{
		Name:    "Version",
		Command: utils.VersionString,
		Admin:   false,
		Desc:    "Get server version " + utils.VersionStringUsage,
	},
	{
		Name:  "Help",
		Admin: false,
		Desc:  "List the commands for Factocord",
	},
}

Commands is a list of all available commands

Functions

func CheckAdmin

func CheckAdmin(ID string) bool

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

func RunCommand

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

RunCommand runs a specified command.

Types

type Command

type Command struct {
	Name string

	Command func(s *discordgo.Session, args string)

	Admin bool
	Desc  string
}

Command is a struct containing fields that hold command information.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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