cli

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var App = &cli.App{
	Name:    "spidee",
	Usage:   "A command line interface for Discord webhooks",
	Version: Version,
	Flags: []cli.Flag{
		&cli.IntFlag{
			Name:    "id",
			Usage:   "webhook id",
			EnvVars: []string{"SPIDEE_WEBHOOK_ID"},
		},
		&cli.StringFlag{
			Name:    "token",
			Usage:   "webhook token",
			EnvVars: []string{"SPIDEE_WEBHOOK_TOKEN"},
		},
	},
	Before: func(c *cli.Context) error {
		client := *webhook.New(discord.WebhookID(c.Int("id")), c.String("token"))

		var (
			sendCommand   = command.SendCommand(client)
			editCommand   = command.EditCommand(client)
			deleteCommand = command.DeleteCommand(client)
		)

		c.App.Commands = []*cli.Command{
			&sendCommand,
			&editCommand,
			&deleteCommand,
		}

		return nil
	},
}
View Source
var Version string

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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