feat: 添加帮助功能

This commit is contained in:
lixiangwuxian
2024-10-15 23:07:49 +08:00
parent ea3ef541e2
commit 48891fbd0a
12 changed files with 217 additions and 33 deletions

22
handler/help/help.go Normal file
View 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,
}
}