Documentation ¶
Overview ¶
Package out implements custom or higher level outputs than that which are implemented by Disdup directly. These are designed for use by a user through shell scripting or the disdup program directly, rather than being imported by another package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrEmptyCommand = errors.New("output executor: empty command")
)
Possible executor init errors.
Functions ¶
This section is empty.
Types ¶
type Executor ¶
type Executor struct { // Command is the path to or name of the program to execute on message // send. Command string // Args are command line arguments to provide to the program. Simple // format substitution is supported for each, replacing the following: // - {id}: unique message ID // - {author}: name#tag of the author of the message // - {guild}: the name of the guild in which the message was sent // - {channel}: the name of the channel in which the message was sent // - {content}: the formatted content of the message // - {time}: approximate timestamp of the message's send, formatted according to RFC822 // // Arguments are guaranteed to be formatted as correct command line // arguments, with the same restrictions as per usual via exec.Command. Args []string // contains filtered or unexported fields }
Executor reads in all incoming messages and executes a given program with configurable arguments. Arguments may contain formatting directives to pass information about messages to the executing program.
If an empty command is passed, Executor.Open returns ErrEmptyCommand.
Click to show internal directories.
Click to hide internal directories.