cc

package
v0.0.0-...-a139185 Latest Latest
Warning

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

Go to latest
Published: May 25, 2023 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package cc contains types and functions for generating static commands from JSON files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseBytes

func ParseBytes(b []byte) (out []*bcr.Command, err error)

ParseBytes parses JSON bytes into a slice of bcr Commands.

Types

type Command

type Command struct {
	// The first name is used as the bcr Command name, the others are used as aliases.
	Names []string `json:"names"`

	Summary     string `json:"summary"`
	Description string `json:"description"`

	Hidden bool `json:"hidden"`

	Response struct {
		Content string         `json:"content"`
		Embed   *discord.Embed `json:"embed"`
	} `json:"response"`
}

Command is a single command, able to be serialized as JSON.

func (Command) ToBcrCommand

func (c Command) ToBcrCommand() *bcr.Command

ToBcrCommand converts a Command into a bcr Command.

Jump to

Keyboard shortcuts

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