scripting

package
v0.0.0-...-52a80d5 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2021 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine interface {
	// LoadScripts loads scripts from a directory into the VM
	LoadScripts(string) error
	// SetErrorOutput sets the io.Writer that the errors are piped into.
	SetErrorOutput(errorOutput io.Writer)

	// OnMessageSend handles the client sending new messages, allowing scripts
	// to manipulate what's sent. The order of script execution is undefined
	// and should therefore be expected to be random.
	OnMessageSend(string) string
	// OnMessageReceive gets called every time a message is received, no matter
	// in which channel or guild.
	OnMessageReceive(*discordgo.Message)
	// OnMessageEdit gets called every time a message is edited, no matter in
	// which channel or guild.
	OnMessageEdit(*discordgo.Message)
	// OnMessageDelete gets called every time a message gets deleted, no matter
	// in which channel or guild.
	OnMessageDelete(*discordgo.Message)

	SetTriggerNotificationFunction(func(string, string))
	SetPrintToConsoleFunction(func(string))
	SetPrintLineToConsoleFunction(func(string))

	SetGetCurrentGuildFunction(func() string)
	SetGetCurrentChannelFunction(func() string)
}

Engine describes a type that is capable of handling events from the main application and allows mutation of data.

Directories

Path Synopsis
This package is the Engine implementation for a javascript scripting interface.
This package is the Engine implementation for a javascript scripting interface.

Jump to

Keyboard shortcuts

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