robot

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: May 10, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Map

type Map map[string]any

type Message

type Message struct {
	Regexp   string `yaml:"regexp"`
	Template string `yaml:"template"`

	Exp *regexp.Regexp
}

func NewMessage

func NewMessage(exp string, template string) *Message

func (*Message) Build

func (m *Message) Build(params Map) string

type Robot

type Robot struct {
	Name     string     `yaml:"name"`
	Alias    string     `yaml:"uuid"`
	WebHook  string     `yaml:"webhook"`
	BodyTpl  string     `yaml:"bodytpl"`
	Messages []*Message `yaml:"messages"`
}

func Load

func Load(robotsPath string) ([]*Robot, error)

func (*Robot) BuildReply

func (r *Robot) BuildReply(msg string) (*resty.Response, error)

func (*Robot) MatchMsg

func (r *Robot) MatchMsg(body []byte) (*Message, bool)

Jump to

Keyboard shortcuts

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