Documentation
¶
Overview ¶
Package control 控制插件的启用与优先级等
Index ¶
- func Delete(service string)
- func ForEach(iterator func(key string, manager *Control) bool)
- type Control
- func (m *Control) Ban(uid, gid int64)
- func (m *Control) Disable(groupID int64)
- func (m *Control) Enable(groupID int64)
- func (m *Control) EnableMarkIn(grp int64) EnableMark
- func (m *Control) GetData(gid int64) int64
- func (m *Control) Handler(ctx *zero.Ctx) bool
- func (m *Control) IsBannedIn(uid, gid int64) bool
- func (m *Control) IsEnabledIn(gid int64) bool
- func (m *Control) Permit(uid, gid int64)
- func (m *Control) Reset(groupID int64)
- func (m *Control) SetData(groupID int64, data int64) error
- func (m *Control) String() string
- type EnableMark
- type Engine
- type Matcher
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Control ¶
Control is to control the plugins.
func (*Control) Disable ¶
Disable disables a group to pass the Manager. groupID == 0 (ALL) will operate on all grps.
func (*Control) Enable ¶
Enable enables a group to pass the Manager. groupID == 0 (ALL) will operate on all grps.
func (*Control) EnableMarkIn ¶ added in v1.4.0
func (m *Control) EnableMarkIn(grp int64) EnableMark
EnableMarkIn 打印 ● 或 ○
func (*Control) IsBannedIn ¶
IsBannedIn 某人是否在某群被 ban
func (*Control) IsEnabledIn ¶
IsEnabledIn 查询开启群 当全局未配置或与默认相同时, 状态取决于单独配置, 后备为默认配置; 当全局与默认不同时, 状态取决于全局配置, 单独配置失效。
func (*Control) Reset ¶
Reset resets the default config of a group. groupID == 0 (ALL) is not allowed.
type Engine ¶
type Engine interface {
// Delete 移除该 Engine 注册的所有 Matchers
Delete()
// On 添加新的指定消息类型的匹配器
On(typ string, rules ...zero.Rule) Matcher
// OnMessage 消息触发器
OnMessage(rules ...zero.Rule) Matcher
// OnNotice 系统提示触发器
OnNotice(rules ...zero.Rule) Matcher
// OnRequest 请求消息触发器
OnRequest(rules ...zero.Rule) Matcher
// OnMetaEvent 元事件触发器
OnMetaEvent(rules ...zero.Rule) Matcher
// OnPrefix 前缀触发器
OnPrefix(prefix string, rules ...zero.Rule) Matcher
// OnSuffix 后缀触发器
OnSuffix(suffix string, rules ...zero.Rule) Matcher
// OnCommand 命令触发器
OnCommand(commands string, rules ...zero.Rule) Matcher
// OnRegex 正则触发器
OnRegex(regexPattern string, rules ...zero.Rule) Matcher
// OnKeyword 关键词触发器
OnKeyword(keyword string, rules ...zero.Rule) Matcher
// OnFullMatch 完全匹配触发器
OnFullMatch(src string, rules ...zero.Rule) Matcher
// OnFullMatchGroup 完全匹配触发器组
OnFullMatchGroup(src []string, rules ...zero.Rule) Matcher
// OnKeywordGroup 关键词触发器组
OnKeywordGroup(keywords []string, rules ...zero.Rule) Matcher
// OnCommandGroup 命令触发器组
OnCommandGroup(commands []string, rules ...zero.Rule) Matcher
// OnPrefixGroup 前缀触发器组
OnPrefixGroup(prefix []string, rules ...zero.Rule) Matcher
// OnSuffixGroup 后缀触发器组
OnSuffixGroup(suffix []string, rules ...zero.Rule) Matcher
// OnShell shell命令触发器
OnShell(command string, model any, rules ...zero.Rule) Matcher
// ApplySingle 应用反并发
ApplySingle(*single.Single[int64]) Engine
// DataFolder 本插件数据目录, 默认 data/zbp/
DataFolder() string
// IsEnabledIn 自己是否在 id (正群负个人零全局) 启用
IsEnabledIn(id int64) bool
// 下载并获取本 engine 文件夹下的懒加载数据
GetLazyData(filename string, isDataMustEqual bool) ([]byte, error)
}
type Matcher ¶
type Options ¶
type Options struct {
DisableOnDefault bool
Help string // 帮助文本信息
PrivateDataFolder string // 全部小写的数据文件夹名, 不出现在 zbpdata
PublicDataFolder string // 驼峰的数据文件夹名, 出现在 zbpdata
OnEnable func(ctx *zero.Ctx) // 启用插件后执行的命令, 为空则打印 “已启用服务: xxx”
OnDisable func(ctx *zero.Ctx) // 禁用插件后执行的命令, 为空则打印 “已禁用服务: xxx”
}
Options holds the optional parameters for the Manager.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.