update
This commit is contained in:
@@ -144,8 +144,14 @@ func init() {
|
|||||||
}
|
}
|
||||||
template = strings.Replace(template, "ImType()", fmt.Sprintf(`"%s"`, s.GetImType()), -1)
|
template = strings.Replace(template, "ImType()", fmt.Sprintf(`"%s"`, s.GetImType()), -1)
|
||||||
template = strings.Replace(template, "GetChatID()", fmt.Sprint(s.GetChatID()), -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 := otto.New()
|
||||||
vm.Set("set", set)
|
vm.Set("set", set)
|
||||||
|
vm.Set("param", param)
|
||||||
vm.Set("get", get)
|
vm.Set("get", get)
|
||||||
vm.Set("request", request)
|
vm.Set("request", request)
|
||||||
vm.Set("push", push)
|
vm.Set("push", push)
|
||||||
|
|||||||
Reference in New Issue
Block a user