Skip to content
/ rich-go Public
forked from hugolgst/rich-go

Discord Rich Presence implementation for Linux, macOS and Windows in Golang. But with cross platform compilation by using Microsoft named pipes.

License

Notifications You must be signed in to change notification settings

ibadus/rich-go

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rich-go Build Status

An implementation of Discord's rich presence in Golang for Linux, macOS and Windows. \

❗Fork reason

I had issue with the original repo, when trying to build a windows binary on Linux, so I forked it and made some changes.
I removed the npipe (old) package to rather use Microsoft implementation. As the old package used syscalls directly, I wasn't able to build it on Linux nor MacOS.

Installation

Install github.com/ibadus/rich-go:

$ go get github.com/ibadus/rich-go

Usage

First of all import rich-go

import "github.com/ibadus/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

Contributing

  1. Fork it (https://github.com/ibadus/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

Check original repo for contributors

About

Discord Rich Presence implementation for Linux, macOS and Windows in Golang. But with cross platform compilation by using Microsoft named pipes.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%