Exemplo n.º 1
0
func GetReplay(url string) *js.Object {
	resp, _ := http.Get(url)
	defer resp.Body.Close()
	d, _ := ioutil.ReadAll(resp.Body)
	msg, _ := capnp.Unmarshal(d)
	r, _ := botapi.ReadRootReplay(msg)
	return js.MakeWrapper(engine.NewReplay(r))
}
Exemplo n.º 2
0
func GetReplayFromString(replayString string) *js.Object {
	// Will it work? It's not Unicode clean
	msg, _ := capnp.Unmarshal([]byte(replayString))
	r, _ := botapi.ReadRootReplay(msg)
	return js.MakeWrapper(engine.NewReplay(r))
}