This commit is contained in:
cdle
2021-10-15 17:50:32 +08:00
parent 42cf1a67c0
commit 52cba715d9
2 changed files with 107 additions and 5 deletions
+45
View File
@@ -56,5 +56,50 @@ func init() {
return reply(msg)
},
},
// {
// Rules: []string{
// "^挑战古诗词$",
// },
// Handle: func(s Sender) interface{} {
// api := sillyGirl.Get("小爱同学")
// if api == "" {
// return "未设置小同学api"
// }
// reply := func(str string) string {
// str, _ = httplib.Get(fmt.Sprintf(api, str)).String()
// // s.Reply(str)
// if gjson := sillyGirl.Get("小爱同学gjson"); gjson != "" {
// str, _ = jsonparser.GetString([]byte(str), strings.Split(gjson, ".")...)
// }
// if str == "" {
// str = "暂时无法回复。"
// }
// return str
// }
// msg := s.Get()
// msg = strings.Trim(msg, " ")
// if strings.Contains(msg, "对话模式") {
// stop := false
// s.Reply(reply("小爱"))
// for {
// if stop {
// return nil
// }
// s.Await(s, func(s2 Sender) interface{} {
// msg := s2.GetContent()
// msg = strings.Trim(msg, " ")
// if strings.Contains(msg, "闭嘴") {
// stop = true
// }
// return reply(msg)
// }, `[\s\S]*`, time.Duration(time.Second*5000))
// }
// }
// if msg == "" {
// msg = "小爱"
// }
// return reply(msg)
// },
// },
})
}