Documentation ¶
Index ¶
- type BaseConfig
- type BotBlockConfig
- type BotResponseConfig
- type Control
- func (m *Control) Ban(uid, gid string) error
- 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) UnBan(uid, gid string) error
- type Engine
- func (e *Engine) GetCacheFolder() string
- 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 ¶
This section is empty.
Types ¶
type BaseConfig ¶ added in v1.5.0
type BaseConfig struct {
FileSecret []byte `gorm:"column:file_secret"`
}
BaseConfig 基础配置表
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 Matcher ¶
func (*Matcher) SetPriority ¶ added in v1.6.4
SetPriority 设置当前Matcher优先级
type MessageRecord ¶ added in v1.2.1
type MessageRecord struct {
*robot.MessageRecord
}
MessageRecord 消息记录表
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.