Documentation ¶
Index ¶
- Variables
- func AddBlackChannels(gid string, cid ...string)
- func AddBlackUsers(us ...*user)
- func AddWhiteChannels(gid string, cid ...string)
- func Process(data *dto.Message)
- func Register(config *Config, handles ...interface{})
- func RemoveBlackChannels(gid string, cid ...string)
- func RemoveBlackUsers(users ...*user)
- func RemoveWhiteChannels(gid string, cid ...string)
- func Run(ctx *Context)
- func SendReply(ctx *Context, msg *MsgView)
- func SendReplyJS(ctx *Context, image string, msg string)
- func SendReplyS(ctx *Context, msg string)
- func SendRunning(running *RunningCommand)
- func SetApi(a openapi.OpenAPI)
- func SetGlobalAfterHandle(f ...func(ctx *Context) (bool, error))
- func SetGlobalBeforeHandle(f ...func(ctx *Context) (bool, error))
- func SetGroupAfterHandle(group string, f ...func(ctx *Context) (bool, error))
- func SetGroupBeforeHandle(group string, f ...func(ctx *Context) (bool, error))
- func WaitDialog(dialog Dialog) interface{}
- type BaseDialog
- type Command
- type Config
- type Context
- type Dialog
- type DialogStack
- type MsgView
- type Permission
- type RunningCommand
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Member = &Permission{Name: "成员", Level: 0} // 普通成员 ChannelAdmin = &Permission{Name: "频道管理员", Level: 1} // 子频道管理员 Admin = &Permission{Name: "超级管理员", Level: 2} // 超级管理员 Owner = &Permission{Name: "频道主", Level: 3} // 频道主 )
View Source
var (
RetryError = errors.New("retry")
)
Functions ¶
func AddBlackChannels ¶ added in v0.1.0
func AddBlackUsers ¶ added in v0.1.0
func AddBlackUsers(us ...*user)
func AddWhiteChannels ¶ added in v0.1.0
func RemoveBlackChannels ¶ added in v0.1.0
func RemoveBlackUsers ¶ added in v0.1.0
func RemoveBlackUsers(users ...*user)
func RemoveWhiteChannels ¶ added in v0.1.0
func SendReplyJS ¶ added in v0.1.0
func SendReplyS ¶ added in v0.1.0
func SendRunning ¶ added in v0.0.3
func SendRunning(running *RunningCommand)
func SetGlobalAfterHandle ¶ added in v0.1.0
func SetGlobalBeforeHandle ¶ added in v0.1.0
func SetGroupAfterHandle ¶ added in v0.1.0
func SetGroupBeforeHandle ¶ added in v0.1.0
func WaitDialog ¶ added in v0.0.5
func WaitDialog(dialog Dialog) interface{}
Types ¶
type BaseDialog ¶ added in v0.0.4
type BaseDialog struct { Ctx *Context // 启动此对话框的上下文 MainMsgView *MsgView // 主消息视图 Channel chan *Context // 通道,用于回复Dialog }
func (*BaseDialog) GetChannel ¶ added in v0.0.5
func (b *BaseDialog) GetChannel() chan *Context
func (*BaseDialog) GetCtx ¶ added in v0.1.0
func (b *BaseDialog) GetCtx() *Context
func (*BaseDialog) GetMainMsgView ¶ added in v0.0.5
func (b *BaseDialog) GetMainMsgView() *MsgView
func (*BaseDialog) Handle ¶ added in v0.0.5
func (b *BaseDialog) Handle(ctx *Context) interface{}
func (*BaseDialog) SendMainMsgView ¶ added in v0.0.5
func (b *BaseDialog) SendMainMsgView(ctx *Context)
type Command ¶ added in v0.0.4
type Command struct { *Config Handles []interface{} }
func GetPrivateCommand ¶ added in v0.0.4
type Config ¶
type Config struct { ID string // ID Group []string // 分组 Name string // 名称 Alias []string // 别名 Usage string // 用法 Emoji string // emoji图标 Description string // 描述 Permission *Permission // 权限 DisableChannel bool // 是否在子频道禁用 DisableDirect bool // 是否在私信禁用 Private bool // 是否为内部指令 Async bool // 是否可异步执行 }
type DialogStack ¶ added in v0.0.7
type DialogStack struct {
// contains filtered or unexported fields
}
func (*DialogStack) Last ¶ added in v0.0.7
func (s *DialogStack) Last() Dialog
func (*DialogStack) Pop ¶ added in v0.0.7
func (s *DialogStack) Pop() Dialog
func (*DialogStack) Push ¶ added in v0.0.7
func (s *DialogStack) Push(d Dialog)
type Permission ¶ added in v0.1.0
type RunningCommand ¶ added in v0.0.3
Source Files ¶
Click to show internal directories.
Click to hide internal directories.