Skip to content

altfoxie/drpc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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