rulebot

package
v0.0.8 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 Option

type Option func(*RuleBot)

func RegisterRuleset

func RegisterRuleset(rule RuleParser) Option

type RuleBot

type RuleBot struct {
	SubClient pb.SubscribeClient
	MidClient pb.MiddleClient
	// contains filtered or unexported fields
}

func New

func New(name string, v *viper.Viper, SubClient pb.SubscribeClient, MidClient pb.MiddleClient, opts ...Option) *RuleBot

func (*RuleBot) MessageProviderOut

func (s *RuleBot) MessageProviderOut() []model.Message

func (*RuleBot) Name

func (s *RuleBot) Name() string

func (*RuleBot) Process

func (s *RuleBot) Process(in model.Message) *RuleBot

func (*RuleBot) Send

func (s *RuleBot) Send(out model.Message)

type RuleParser

type RuleParser interface {
	Name() string
	Boot(*RuleBot)
	ParseMessage(*RuleBot, model.Message) []model.Message
	HelpMessage(*RuleBot, model.Message) string
}

Jump to

Keyboard shortcuts

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