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() })