actions

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIRequest

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

APIRequest represents an api request action.

func (APIRequest) Process

Process executes the action.

type APIRequestConfig

type APIRequestConfig struct {
	URL         string
	Method      string
	ContentType string
	Responses   []string
}

APIRequestConfig represents the config for an api request action.

type Action

type Action interface {
	Process(s *discordgo.Session, m *discordgo.MessageCreate) (string, error)
}

Action represents a single runnable action.

func NewAPIRequest

func NewAPIRequest(config map[string]interface{}) (Action, error)

NewAPIRequest creates a new api request action.

func NewSimpleChat

func NewSimpleChat(config map[string]interface{}) (Action, error)

NewSimpleChat creates a new simple chat action.

type ActionDefinition

type ActionDefinition struct {
	Name    string
	Type    string
	Trigger string
	Config  map[string]interface{}
}

ActionDefinition represents the definition for a custom action.

type CustomAction

type CustomAction struct {
	Definition ActionDefinition
	Action     Action
}

CustomAction represents a custom action.

func NewAction

func NewAction(def ActionDefinition) (*CustomAction, error)

NewAction creates a new custom action.

type SimpleChat

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

SimpleChat represents a simple chat action.

func (SimpleChat) Process

Process executes the action.

type SimpleChatConfig

type SimpleChatConfig struct {
	Responses []string
}

SimpleChatConfig represents the config for a simple chat action.

Jump to

Keyboard shortcuts

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