This commit is contained in:
cdle
2021-10-06 09:56:56 +08:00
parent 0a041e0379
commit 2e5b932be2
+6
View File
@@ -144,8 +144,14 @@ func init() {
}
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)))
return v
}
vm := otto.New()
vm.Set("set", set)
vm.Set("param", param)
vm.Set("get", get)
vm.Set("request", request)
vm.Set("push", push)