bot

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: MPL-2.0 Imports: 18 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SlackClient *slack.Client
)

Functions

func HandleMessageEvent added in v0.3.1

func HandleMessageEvent(event *slackevents.MessageEvent)

func PostMessage

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

func RegisterPeriodicScript added in v0.3.0

func RegisterPeriodicScript(script PeriodicScript) error

func RegisterScript

func RegisterScript(script Script)

func Start

func Start(c *Config)

Types

type Config

type Config struct {
	SlackBotToken    string
	SlackAppToken    string
	BotName          string
	Debug            bool
	ShellMode        bool
	ShellModeChannel string
}

type Matcher

type Matcher string

type PeriodicScript added in v0.3.0

type PeriodicScript struct {
	Name     string
	CronSpec string
	Function func()
	// contains filtered or unexported fields
}

type Script

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

type ScriptContext

type ScriptContext struct {
	Arguments  map[string]string
	SlackEvent *slackevents.MessageEvent
}

type ScriptFunction

type ScriptFunction func(*ScriptContext)

Jump to

Keyboard shortcuts

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