altfoxie / drpc

Discord RPC implementation in Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DRPC

GoDoc

Discord RPC implementation in Go.

$ go get -u github.com/altfoxie/drpc

Usage

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 */ }

Roadmap

  • Support Windows
  • Support events
  • Match responses with method calls by nonce

License

MIT

About

Discord RPC implementation in Go

License:MIT License


Languages

Language:Go 100.0%