Discord RPC implementation in Go.
$ go get -u github.com/altfoxie/drpc
You need to create a client.
client, err := drpc.New("APP_ID")
if err != nil { /* handle error */ }
Now you can use the client to set player's activity. DRPC maintains a persistent connection to Discord RPC, so you don't need to worry about reconnecting.
err := client.SetActivity(drpc.Activity{
State: "Playing",
Details: "Unranked PvP",
Timestamps: &drpc.Timestamps{
Start: time.Now(),
},
// Other fields...
})
if err != nil { /* handle error */ }
- Support Windows
- Support events
- Match responses with method calls by
nonce
MIT