Documentation ¶
Index ¶
- func GetOptionsOnCronjob() map[string]*Control
- type BotBlockConfig
- type BotResponseConfig
- type Control
- func (m *Control) Ban(uid, gid string)
- func (m *Control) CloseGlobalMode() error
- func (m *Control) Disable(groupID string) error
- func (m *Control) Enable(groupID string) error
- func (m *Control) Handler(gid, uid string) bool
- func (m *Control) IsBannedIn(uid, gid string) bool
- func (m *Control) IsEnabledAll(enable bool) (isEnable bool, ok bool)
- func (m *Control) IsEnabledIn(gid string) bool
- func (m *Control) Permit(uid, gid string)
- type Engine
- func (e *Engine) GetDataFolder() string
- func (e *Engine) OnCommand(commands string, rules ...robot.Rule) *Matcher
- func (e *Engine) OnCommandGroup(commands []string, rules ...robot.Rule) *Matcher
- func (e *Engine) OnFullMatch(src string, rules ...robot.Rule) *Matcher
- func (e *Engine) OnFullMatchGroup(src []string, rules ...robot.Rule) *Matcher
- func (e *Engine) OnKeyword(keyword string, rules ...robot.Rule) *Matcher
- func (e *Engine) OnKeywordGroup(keywords []string, rules ...robot.Rule) *Matcher
- func (e *Engine) OnMessage(rules ...robot.Rule) *Matcher
- func (e *Engine) OnPrefix(prefix string, rules ...robot.Rule) *Matcher
- func (e *Engine) OnPrefixGroup(prefix []string, rules ...robot.Rule) *Matcher
- func (e *Engine) OnRegex(regexPattern string, rules ...robot.Rule) *Matcher
- func (e *Engine) OnSuffix(suffix string, rules ...robot.Rule) *Matcher
- func (e *Engine) OnSuffixGroup(suffix []string, rules ...robot.Rule) *Matcher
- type Manager
- func (manager *Manager) CanResponse(gid string) bool
- func (manager *Manager) DoBlock(uid string) error
- func (manager *Manager) DoUnblock(uid string) error
- func (manager *Manager) IsBlocked(uid string) bool
- func (manager *Manager) Lookup(service string) (*Control, bool)
- func (manager *Manager) LookupAll() map[string]*Control
- func (manager *Manager) NewControl(service string, o *Options) *Control
- func (manager *Manager) Response(gid string) error
- func (manager *Manager) Silence(gid string) error
- type Matcher
- type MessageRecord
- type Options
- type PluginBanConfig
- type PluginConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetOptionsOnCronjob ¶
GetOptionsOnCronjob 获取定时任务插件控制器配置
Types ¶
type BotBlockConfig ¶
type BotBlockConfig struct {
UserID string `gorm:"column:uid"` // 用户ID
}
BotBlockConfig bot ban配置表,ban掉的用户无法使用所有插件
type BotResponseConfig ¶
type BotResponseConfig struct { GroupID string `gorm:"column:gid"` // 群组ID Status bool `gorm:"column:status"` // 响应状态,默认启用 }
BotResponseConfig bot响应群配置表
type Control ¶
type Control struct { Service string // Service 插件服务名 Cache map[string]bool // Cache 缓存 Options Options // Options 插件配置 Manager *Manager // Manager 插件管理器 }
Control 插件控制器
func (*Control) CloseGlobalMode ¶ added in v1.0.3
CloseGlobalMode 关闭全局模式
func (*Control) IsBannedIn ¶
IsBannedIn 某人是否在某群被ban
func (*Control) IsEnabledAll ¶ added in v1.0.3
IsEnabledAll 查询是否全局开启
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
func (*Engine) OnCommandGroup ¶
OnCommandGroup 命令触发器组
func (*Engine) OnFullMatch ¶
OnFullMatch 完全匹配触发器
func (*Engine) OnFullMatchGroup ¶
OnFullMatchGroup 完全匹配触发器组
func (*Engine) OnKeywordGroup ¶
OnKeywordGroup 关键词触发器组
func (*Engine) OnPrefixGroup ¶
OnPrefixGroup 前缀触发器组
type Manager ¶
func NewManager ¶
func (*Manager) CanResponse ¶
func (*Manager) NewControl ¶
type MessageRecord ¶ added in v1.2.1
type MessageRecord struct {
*robot.MessageRecord
}
MessageRecord 消息记录表
type Options ¶
type Options struct { Alias string // 插件别名 Help string // 插件帮助信息 Priority uint64 // 优先级,只读 DisableOnDefault bool // 默认禁用状态 HideMenu bool // 是否隐藏在菜单中,默认显示,可用于隐藏一些不希望展示的插件 DataFolder string // 数据文件夹 OnEnable func(ctx *robot.Ctx) // 自定义启用插件后执行的操作 OnDisable func(ctx *robot.Ctx) // 自定义禁用插件后执行的操作 OnCronjob func(ctx *robot.Ctx) // 自定义定时任务,用于被定时调用 }
type PluginBanConfig ¶
type PluginBanConfig struct { Label string `gorm:"column:label"` // 标签(service_uid_gid) UserID string `gorm:"column:uid"` // 用户ID GroupID string `gorm:"column:gid"` // 群组ID }
PluginBanConfig 插件Ban配置表
type PluginConfig ¶
type PluginConfig struct { GroupID string `gorm:"column:gid"` // 群组ID Enable bool `gorm:"column:enable"` // 启用状态,默认启用 }
PluginConfig 插件配置表
Click to show internal directories.
Click to hide internal directories.