commands

package
v2025.8.1 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2025 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Module = fx.Module("discord_commands",
	fx.Provide(
		New,
	),
	fx.Decorate(wrapLogger),
)

Functions

func AsCommand

func AsCommand(f any) any

AsCommand annotates the given constructor to state that it provides a Discord command to the "discordcommands" group.

Types

type AbsentCommand

type AbsentCommand struct {
	// contains filtered or unexported fields
}

func (*AbsentCommand) HandleCommand

func (*AbsentCommand) RegisterCommand

func (c *AbsentCommand) RegisterCommand(router *cmdroute.Router) api.CreateCommandData

type Cmds

type Cmds struct {
	// contains filtered or unexported fields
}

func New

func New(p Params) *Cmds

type Command

type Command interface {
	RegisterCommand(router *cmdroute.Router) api.CreateCommandData
	HandleCommand(ctx context.Context, cmd cmdroute.CommandData) *api.InteractionResponseData
}

func NewAbsentCommand

func NewAbsentCommand(p CommandParams) (Command, error)

func NewFivenetCommand

func NewFivenetCommand(p CommandParams) (Command, error)

func NewHelpCommand

func NewHelpCommand(p CommandParams) (Command, error)

func NewSyncCommand

func NewSyncCommand(p CommandParams) (Command, error)

type CommandFactory

type CommandFactory = func(p CommandParams) (Command, error)

type CommandParams

type CommandParams struct {
	fx.In

	Cfg      *config.Config
	JS       *events.JSWrapper
	DB       *sql.DB
	L        *lang.I18n
	BotState types.BotState
	Perms    perms.Permissions
}

type FivenetCommand

type FivenetCommand struct {
	// contains filtered or unexported fields
}

func (*FivenetCommand) HandleCommand

func (*FivenetCommand) RegisterCommand

func (c *FivenetCommand) RegisterCommand(router *cmdroute.Router) api.CreateCommandData

type HelpCommand

type HelpCommand struct {
	// contains filtered or unexported fields
}

func (*HelpCommand) HandleCommand

func (*HelpCommand) RegisterCommand

func (c *HelpCommand) RegisterCommand(router *cmdroute.Router) api.CreateCommandData

type Params

type Params struct {
	fx.In

	LC fx.Lifecycle

	Logger *zap.Logger
	Cfg    *config.Config
	DC     *state.State

	Commands []Command `group:"discordcommands"`
}

type SyncCommand

type SyncCommand struct {
	// contains filtered or unexported fields
}

func (*SyncCommand) HandleCommand

func (*SyncCommand) RegisterCommand

func (c *SyncCommand) RegisterCommand(router *cmdroute.Router) api.CreateCommandData

Jump to

Keyboard shortcuts

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