service

package
v0.0.0-...-b0a87dc Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2022 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckBlock

func CheckBlock(ctx *zero.Ctx) bool

func IsServiceEnabled

func IsServiceEnabled(serv string) zero.Rule

func LoadCommandList

func LoadCommandList(service string) map[string]CommandInfo

func StoneCommandList

func StoneCommandList(service string, cmds map[string]CommandInfo)

func StoreServiceData

func StoreServiceData(serv string, d ServiceInfo)

Types

type CommandInfo

type CommandInfo struct {
	Type    string   `json:"type"`
	Docs    string   `json:"docs"`
	Aliases []string `json:"aliases"`
}

type D

type D map[string]string

type Service

type Service struct {
	Service     string
	Docs        string
	OnlyAdmin   bool
	Rule        []zero.Rule
	MainCommand string
}

func NewService

func NewService(name string, docs string, onlyAdmin bool, mainCommand string, rules ...zero.Rule) *Service

NewService 注册一个服务

func (*Service) OnCommand

func (s *Service) OnCommand(command string, docs string, aliases []string, rules ...zero.Rule) *zero.Matcher

func (*Service) OnMessage

func (s *Service) OnMessage(name string, docs string, rules ...zero.Rule) *zero.Matcher

func (*Service) OnMetaEvent

func (s *Service) OnMetaEvent(name string, docs string, rules ...zero.Rule) *zero.Matcher

func (*Service) OnNotice

func (s *Service) OnNotice(name string, docs string, rules ...zero.Rule) *zero.Matcher

func (*Service) OnRegex

func (s *Service) OnRegex(pattern string, docs string, rules ...zero.Rule) *zero.Matcher

func (*Service) OnRequest

func (s *Service) OnRequest(name string, docs string, rules ...zero.Rule) *zero.Matcher

type ServiceInfo

type ServiceInfo struct {
	Service      string                 `json:"service"`
	Docs         string                 `json:"docs"`
	CommandList  map[string]CommandInfo `json:"command_list"`
	Enabled      bool                   `json:"enabled"`
	OnlyAdmin    bool                   `json:"only_admin"`
	DisableUser  []string               `json:"disable_user"`
	DisableGroup []string               `json:"disable_group"`
}

func LoadServiceData

func LoadServiceData(service string) ServiceInfo

Jump to

Keyboard shortcuts

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