slashcommand

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2022 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrChannelUnauthorized = errors.New("you cannot use this command from this channel")
View Source
var ErrCommandNotFound = errors.New("command not found")
View Source
var ErrTeamUnauthorized = errors.New("you cannot use this command from this team")
View Source
var ErrUserUnauthorized = errors.New("you are not authorized to use this command")

Functions

This section is empty.

Types

type SlashCommand

type SlashCommand struct {
	// Command is the root command that will be used to dispatch the received slash command
	Command string
	// Token is the token you get from Mattermost when creating a slash command
	Token string
	// DialogURL is the URL that will be used to open the dialog
	DialogURL string
	// DialogResponseURL is the URL that will be used to send the response to the dialog
	DialogResponseURL string
	// ScheduledResponseURL is the URL that will be used to send the response from the scheduled commands
	SchedulerResponseURL string

	Commands []model.Command

	AccessControl model.AccessControl
}

func Load

func Load(ctx context.Context, plugins []plugin.Plugin, cfg []config.CommandConfig) ([]SlashCommand, error)

func (*SlashCommand) Execute

func (s *SlashCommand) Execute(ctx context.Context, mmCommand *model.MMSlashCommand, cmd string, args map[string]string) (*model.CommandResponse, error)

func (*SlashCommand) ExecuteDialog

func (s *SlashCommand) ExecuteDialog(ctx context.Context, submission *model.DialogSubmission, cmd string, args map[string]string) (*model.CommandResponse, error)

Jump to

Keyboard shortcuts

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