From b4f5ef7f75b69914a2cd7475baba5519759afb17 Mon Sep 17 00:00:00 2001 From: cdle <798731886@qq.com> Date: Thu, 28 Oct 2021 21:58:17 +0800 Subject: [PATCH] update --- core/otto.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/otto.go b/core/otto.go index 602c665..bba14f2 100644 --- a/core/otto.go +++ b/core/otto.go @@ -174,7 +174,6 @@ func init123() { var handler = func(s Sender) interface{} { template := data template = strings.Replace(template, "ImType()", fmt.Sprintf(`"%s"`, s.GetImType()), -1) - template = strings.Replace(template, "GetChatID()", fmt.Sprint(s.GetChatID()), -1) param := func(call otto.Value) otto.Value { i, _ := call.ToInteger() v, _ := otto.ToValue(s.Get(int(i - 1))) @@ -193,6 +192,10 @@ func init123() { vm.Set("Delete", func() { s.Delete() }) + vm.Set("GetChatID", func() otto.Value { + v, _ := otto.ToValue(s.GetChatID()) + return v + }) vm.Set("Continue", func() { s.Continue() })