This commit is contained in:
cdle
2021-10-12 11:31:44 +08:00
parent 9d19d08dd1
commit 06711a79d0
2 changed files with 1 additions and 35 deletions
-35
View File
@@ -165,41 +165,6 @@ func init123() {
v, _ := otto.ToValue(s.GetUsername())
return v
})
// vm.Set("Await", func(call otto.Value) interface{} {
// patternV, _ := call.Object().Get("pattern")
// timeoutV, _ := call.Object().Get("timeout")
// timeout, _ := timeoutV.ToInteger()
// pattern, _ := patternV.ToString()
// s.Await(s, func(s1 string, s2 Sender, e error) interface{} {
// s.Reply("-----")
// if e != nil {
// s.Reply(e)
// return nil
// }
// v, err := call.Object().Call("callback", s1)
// s.Reply("-+-+-+")
// if err != nil {
// s.Reply(err)
// return nil
// }
// deleteV, _ := v.Object().Get("delete")
// delete, _ := deleteV.ToBoolean()
// if delete {
// s2.Delete()
// }
// disappearV, _ := call.Object().Get("disappear")
// disappear, _ := disappearV.ToInteger()
// fmt.Println(disappear, "====")
// s2.Disappear(time.Millisecond * time.Duration(disappear))
// replyV, _ := v.Object().Get("reply")
// reply, _ := replyV.ToString()
// if reply != "" {
// return reply
// }
// return nil
// }, pattern, time.Millisecond*time.Duration(timeout))
// return otto.Value{}
// })
vm.Set("GetUserID", func() otto.Value {
v, _ := otto.ToValue(s.GetUserID())
return v
+1
View File
@@ -282,6 +282,7 @@ Alias=sillyGirl.service`
s.Await(s, func(s2 Sender, err error) interface{} {
if err != nil {
s.Reply(err)
return nil
}
ct := s2.GetContent()
if ct == "退出接龙" {