An implementation of Discord's rich presence in Golang for Linux, macOS and Windows
Install github.com/hugolgst/rich-go
:
$ go get github.com/hugolgst/rich-go
First of all import rich-go
import "github.com/hugolgst/rich-go/client"
then login by sending the first handshake
err := client.Login("DISCORD_APP_ID")
if err != nil {
panic(err)
}
and you can set the Rich Presence activity (parameters can be found :
err = client.SetActivity(client.Activity{
State: "Heyy!!!",
Details: "I'm running on rich-go :)",
LargeImage: "largeimageid",
LargeText: "This is the large image :D",
SmallImage: "smallimageid",
SmallText: "And this is the small image",
Party: &client.Party{
ID: "-1",
Players: 15,
MaxPlayers: 24,
},
Timestamps: &client.Timestamps{
Start: time.Now(),
},
})
if err != nil {
panic(err)
}
More details in the example
- Fork it (https://github.com/hugolgst/rich-go/fork)
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
- hugolgst - creator, maintainer
- donovansolms - contributor
- heroslender - contributor