Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hugolgst/rich-go
Discord Rich Presence implementation for Linux, macOS and Windows in Golang
https://github.com/hugolgst/rich-go
discord golang rich-presence
Last synced: 1 day ago
JSON representation
Discord Rich Presence implementation for Linux, macOS and Windows in Golang
- Host: GitHub
- URL: https://github.com/hugolgst/rich-go
- Owner: hugolgst
- License: mit
- Created: 2018-06-01T20:12:40.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-07-28T11:52:17.000Z (4 months ago)
- Last Synced: 2024-11-05T18:59:28.130Z (8 days ago)
- Topics: discord, golang, rich-presence
- Language: Go
- Homepage:
- Size: 35.2 KB
- Stars: 133
- Watchers: 7
- Forks: 38
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# rich-go [![Build Status](https://travis-ci.org/hugolgst/rich-go.svg?branch=master)](https://travis-ci.org/hugolgst/rich-go)
An implementation of Discord's rich presence in Golang for Linux, macOS and Windows
## Installation
Install `github.com/hugolgst/rich-go`:
```
$ go get github.com/hugolgst/rich-go
```## Usage
First of all import rich-go
```golang
import "github.com/hugolgst/rich-go/client"
```then login by sending the first handshake
```golang
err := client.Login("DISCORD_APP_ID")
if err != nil {
panic(err)
}
```and you can set the Rich Presence activity (parameters can be found :
```golang
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](https://github.com/ananagame/rich-go/blob/master/example/main.go)
## Contributing
1. Fork it (https://github.com/hugolgst/rich-go/fork)
2. Create your feature branch (git checkout -b my-new-feature)
3. Commit your changes (git commit -am 'Add some feature')
4. Push to the branch (git push origin my-new-feature)
5. Create a new Pull Request## Contributors
- [hugolgst](https://github.com/hugolgst) - creator, maintainer
- [donovansolms](https://github.com/donovansolms) - contributor
- [heroslender](https://github.com/heroslender) - contributor