Socket
Book a DemoInstallSign in
Socket

github.com/sajberk/rich-go

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/sajberk/rich-go

v0.0.0-20230426132632-eabe51b71683
Source
Go
Version published
Created
Source

An implementation of Discord's rich presence in Golang for Linux, macOS and Windows, forked from hugolgst and adjusted for Snap and go module support that the other Snap fork did not have

Installation

Install github.com/sajberk/rich-go:

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

Usage

First of all import rich-go

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

  • Fork my repo or the original (https://github.com/hugolst/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

Original contributors

FAQs

Package last updated on 26 Apr 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.