command

package
v0.7.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	Name string
	// contains filtered or unexported fields
}

func NewMessageCommand

func NewMessageCommand(name string, handler MessageHandler, debug bool) *Message

NewMessageCommand Message.Name should be passed with prefix

func (*Message) RegisterCommand

func (m *Message) RegisterCommand(s *discordgo.Session, logger *zap.Logger)

RegisterCommand checks is every message starts with Message.Name and is it self-message than runs Message.handler

type MessageHandler

type MessageHandler func(ctx context.Context, s *discordgo.Session, m *discordgo.MessageCreate)

type Slash

type Slash struct {
	*discordgo.ApplicationCommand
	// contains filtered or unexported fields
}

func NewSlashCommand

func NewSlashCommand(
	command *discordgo.ApplicationCommand,
	handler slashHandler,
	debug bool,
) *Slash

func (*Slash) RegisterCommand

func (c *Slash) RegisterCommand(s *discordgo.Session) (unregisterCommand func())

RegisterCommand TODO: Handle errors

Jump to

Keyboard shortcuts

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