feat: 添加帮助功能
This commit is contained in:
22
handler/help/help.go
Normal file
22
handler/help/help.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package help
|
||||
|
||||
import (
|
||||
"git.lxtend.com/qqbot/handler"
|
||||
"git.lxtend.com/qqbot/model"
|
||||
)
|
||||
|
||||
func init() {
|
||||
handler.RegisterHandler("!help", help)
|
||||
}
|
||||
|
||||
func help(msg model.Message) (reply model.Reply) {
|
||||
helpInfo := `以下是支持的功能:`
|
||||
for k, v := range handler.HelpInforms {
|
||||
helpInfo += "\n" + k + " : " + v
|
||||
}
|
||||
return model.Reply{
|
||||
ReplyMsg: helpInfo,
|
||||
ReferOriginMsg: false,
|
||||
FromMsg: msg,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user