demo

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Script

type Script struct {
	Id          string
	Name        string
	Description string
	Channel     ScriptChannel
	Users       []ScriptUser
	Messages    []ScriptMessage
	Responses   []ScriptResponse
}

func LoadScriptsFromFile

func LoadScriptsFromFile(filepath string) ([]Script, error)

func (*Script) RunScript

func (s *Script) RunScript(teamId, botId, userId string, api plugin.API)

func (*Script) TriggerResponse

func (s *Script) TriggerResponse(responseId, channelId, userId string, api plugin.API) error

type ScriptAttachment

type ScriptAttachment struct {
	Title       string
	TitleLink   string
	Color       string
	AuthorName  string `yaml:"author_name"`
	AuthorImage string `yaml:"author_image"`
	Fields      []ScriptAttachmentField
	Actions     []ScriptAttachmentAction
}

type ScriptAttachmentAction

type ScriptAttachmentAction struct {
	Name       string
	ResponseId string `yaml:"response_id"`
}

type ScriptAttachmentField

type ScriptAttachmentField struct {
	Title string
	Value string
	Short bool
}

type ScriptChannel

type ScriptChannel struct {
	Id          string
	Name        string
	Description string
}

type ScriptMessage

type ScriptMessage struct {
	UserId      string `yaml:"user_id"`
	Text        string
	Attachments []ScriptAttachment
	Reactions   []ScriptReaction
	PostDelay   int `yaml:"post_delay"`
	Replies     []ScriptMessage
}

type ScriptReaction

type ScriptReaction struct {
	Id     string
	UserId string `yaml:"user_id"`
	Delay  int
}

type ScriptResponse

type ScriptResponse struct {
	Id      string
	Message ScriptMessage
}

type ScriptRunner

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

func NewScriptRunner

func NewScriptRunner(script Script) *ScriptRunner

type ScriptUser

type ScriptUser struct {
	Id       string
	Name     string
	Position string
	Bot      bool
}

type Server

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

func NewServer

func NewServer(api plugin.API) *Server

func (*Server) RegisterBotUser

func (s *Server) RegisterBotUser() error

func (*Server) SendWelcomePost

func (s *Server) SendWelcomePost(channelId string)

func (*Server) Start

func (s *Server) Start() error

func (*Server) StartScript

func (s *Server) StartScript(teamId, userId, scriptId string) error

func (*Server) TriggerResponse

func (s *Server) TriggerResponse(channelId, userId, scriptId, responseId string) error

Jump to

Keyboard shortcuts

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