Prevent races on gateway_test on low-precision computers
Experimental websocket client for Discord gateways. It parses events and handles gateway retrieval and reconnections transparently.
package main import ( "fmt" "os" "github.com/WatchBeam/cord" "github.com/WatchBeam/cord/events" "github.com/WatchBeam/cord/model" ) func main() { c := cord.New(os.Args[1], nil) c.On(events.Ready(func(r *model.Ready) { fmt.Printf("%+v\n", r) })) c.On(events.PresenceUpdate(func(r *model.PresenceUpdate) { fmt.Printf("%+v\n", r) })) for err := range c.Errs() { fmt.Printf("Got an error: %s", err) if _, isFatal := err.(cord.FatalError); isFatal { os.Exit(1) } } }
JSON and the event handlers are auto-generated by the Makefile. Running make will ensure the generations are up-to-date and run all tests.
make
版权所有:中国计算机学会技术支持:开源发展技术委员会 京ICP备13000930号-9 京公网安备 11010802032778号
cord

Experimental websocket client for Discord gateways. It parses events and handles gateway retrieval and reconnections transparently.
Example
Development
JSON and the event handlers are auto-generated by the Makefile. Running
makewill ensure the generations are up-to-date and run all tests.