bot

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2021 License: MPL-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SlackClient *slack.Client

	BotName string
)

Functions

func Banner()

func HandleMentionEvent

func HandleMentionEvent(event *slackevents.AppMentionEvent)

func PostMessage

func PostMessage(channelID string, message string) (string, string, error)

func RegisterScript

func RegisterScript(script Script)

func Shell

func Shell()

func SlackEventRoute added in v1.0.1

func SlackEventRoute(c *gin.Context)

func Start

func Start()

func StatusRoute added in v1.0.1

func StatusRoute(c *gin.Context)

Types

type CustomHandle

type CustomHandle struct{}

func (CustomHandle) Invoke

func (handler CustomHandle) Invoke(ctx context.Context, payload []byte) ([]byte, error)

type EventContext

type EventContext struct {
	Arguments  map[string]string
	SlackEvent *slackevents.AppMentionEvent
}

type Matcher

type Matcher string

type PollEvent

type PollEvent struct {
	Name   string `json:"name"`
	Status string `json:"status"`
	Count  string `json:"count"`
}

func PollEventHandler

func PollEventHandler(ctx context.Context, req PollEvent) (PollEvent, error)

type Script

type Script struct {
	Name        string
	Matcher     Matcher
	Description string
	Function    ScriptFunction
}

type ScriptFunction

type ScriptFunction func(*EventContext)

Jump to

Keyboard shortcuts

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