Documentation ¶
Overview ¶
Package control 控制插件的启用与优先级等
Index ¶
- type Control
- func (m *Control[CTX]) Ban(uid, gid int64)
- func (m *Control[CTX]) Disable(groupID int64)
- func (m *Control[CTX]) Enable(groupID int64)
- func (m *Control[CTX]) EnableMarkIn(grp int64) EnableMark
- func (m *Control[CTX]) Flip() error
- func (m *Control[CTX]) GetData(gid int64) int64
- func (m *Control[CTX]) Handler(ctx uintptr, gid, uid int64) bool
- func (m *Control[CTX]) IsBannedIn(uid, gid int64) bool
- func (m *Control[CTX]) IsEnabledIn(gid int64) bool
- func (m *Control[CTX]) Permit(uid, gid int64)
- func (m *Control[CTX]) Reset(groupID int64)
- func (m *Control[CTX]) SetData(groupID int64, data int64) error
- func (m *Control[CTX]) String() string
- type EnableMark
- type Manager
- func (manager *Manager[CTX]) DoBlock(uid int64) error
- func (manager *Manager[CTX]) DoUnblock(uid int64) error
- func (manager *Manager[CTX]) ForEach(iterator func(key string, manager *Control[CTX]) bool)
- func (manager *Manager[CTX]) InitBlock() error
- func (manager *Manager[CTX]) IsBlocked(uid int64) bool
- func (manager *Manager[CTX]) Lookup(service string) (*Control[CTX], bool)
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Control ¶
type Control[CTX any] struct { // contains filtered or unexported fields }
Control is to control the plugins.
func (*Control[CTX]) Disable ¶
Disable disables a group to pass the Manager. groupID == 0 (ALL) will operate on all grps.
func (*Control[CTX]) Enable ¶
Enable enables a group to pass the Manager. groupID == 0 (ALL) will operate on all grps.
func (*Control[CTX]) EnableMarkIn ¶ added in v1.4.0
func (m *Control[CTX]) EnableMarkIn(grp int64) EnableMark
EnableMarkIn 打印 ● 或 ○
func (*Control[CTX]) IsBannedIn ¶
IsBannedIn 某人是否在某群被 ban
func (*Control[CTX]) IsEnabledIn ¶
IsEnabledIn 查询开启群 当全局未配置或与默认相同时, 状态取决于单独配置, 后备为默认配置; 当全局与默认不同时, 状态取决于全局配置, 单独配置失效。
func (*Control[CTX]) Reset ¶
Reset resets the default config of a group. groupID == 0 (ALL) is not allowed.
type Manager ¶ added in v1.4.0
func NewManager ¶ added in v1.4.0
type Options ¶
type Options[CTX any] struct { DisableOnDefault bool Help string // 帮助文本信息 PrivateDataFolder string // 全部小写的数据文件夹名, 不出现在 zbpdata PublicDataFolder string // 驼峰的数据文件夹名, 出现在 zbpdata OnEnable func(CTX) // 启用插件后执行的命令, 为空则打印 “已启用服务: xxx” OnDisable func(CTX) // 禁用插件后执行的命令, 为空则打印 “已禁用服务: xxx” }
Options holds the optional parameters for the Manager.
Click to show internal directories.
Click to hide internal directories.