refactor: 重构handler系统
This commit is contained in:
12
model/handler.go
Normal file
12
model/handler.go
Normal file
@@ -0,0 +1,12 @@
|
||||
package model
|
||||
|
||||
import "git.lxtend.com/qqbot/constants"
|
||||
|
||||
type Handler func(msg Message) (reply Reply)
|
||||
type TryCatchHandler func(msg Message) (reply Reply, catched bool)
|
||||
|
||||
type HandlerInfo[H Handler | TryCatchHandler] struct {
|
||||
Trigger string
|
||||
Handler H
|
||||
Level constants.PermissionLevel
|
||||
}
|
||||
Reference in New Issue
Block a user