cli

package
v0.0.0-...-3d4fb19 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Global

	Version VersionCmd `cmd:"" help:"Print the version." default:"1"`

	Run    RunCmd           `cmd:"" help:"Witness the hubris of man."`
	Add    ManagerAddCmd    `cmd:"" help:"Add a directory of JSON files as commands."`
	List   ManagerListCmd   `cmd:"" help:"List the application's commands."`
	Remove ManagerRemoveCmd `cmd:"" help:"Remove a command by its ID."`
}

type Global

type Global struct {
	Token         string `help:"The bot's OAuth2 token." required:"" short:"t" env:"HUBRIS_TOKEN"`
	ApplicationID string `help:"OAuth2 application snowflake." required:"" short:"a" env:"HUBRIS_APP_ID"`
	DSN           string `help:"PostgreSQL data connection string." required:"" short:"p" env:"HUBRIS_DSN"`
}

type ManagerAddCmd

type ManagerAddCmd struct {
	GuildID   string `help:"GuildID to apply commands to. Global if blank." short:"g"`
	Directory string `help:"Path of JSON files to use for upload." required:"" type:"existingdir" arg:""`
}

func (*ManagerAddCmd) Run

func (c *ManagerAddCmd) Run(ctx context.Context, g *Global) error

type ManagerListCmd

type ManagerListCmd struct {
	GuildID string `help:"GuildID to pull commands from." short:"g"`
}

func (*ManagerListCmd) Run

func (c *ManagerListCmd) Run(ctx context.Context, g *Global) error

type ManagerRemoveCmd

type ManagerRemoveCmd struct {
	GuildID string `help:"GuildID to remove command from." short:"g"`
	ID      string `help:"ID of command to remove." arg:""`
}

func (*ManagerRemoveCmd) Run

func (c *ManagerRemoveCmd) Run(ctx context.Context, g *Global) error

type RunCmd

type RunCmd struct {
	Debug bool `help:"Run in debug mode?" default:"false" short:"d"`
}

func (*RunCmd) Run

func (c *RunCmd) Run(ctx context.Context, g *Global) error

type VersionCmd

type VersionCmd struct{}

func (*VersionCmd) Run

func (c *VersionCmd) Run(ctx context.Context, g *Global) error

Jump to

Keyboard shortcuts

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