rpc

package
v0.0.0-...-40a491f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2022 License: MIT Imports: 5 Imported by: 0

README

This package is modified from https://github.com/rikkuness/discord-rpc

Planning to release a separate Go package for Discord RPC once it's publicly available / no longer in private beta

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Activity

type Activity struct {
	State      string     `json:"state"`
	Details    string     `json:"details"`
	Timestamps Timestamps `json:"timestamps,omitempty"`
	Assets     Assets     `json:"assets,omitempty"`
}

type Assets

type Assets struct {
	LargeImage string `json:"large_image,omitempty"`
	LargeText  string `json:"large_text,omitempty"`
	SmallImage string `json:"small_image,omitempty"`
	SmallText  string `json:"small_text,omitempty"`
}

type AuthenticateCommandArgs

type AuthenticateCommandArgs struct {
	AccessToken string `json:"access_token"`
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(clientId string) *Client

func (*Client) Close

func (c *Client) Close()

func (*Client) Connect

func (c *Client) Connect() error

func (*Client) SetActivity

func (c *Client) SetActivity(args Activity) error

func (*Client) SetUserVoiceSettings

func (c *Client) SetUserVoiceSettings(args SetUserVoiceSettingsCommandArgs) error

type Handshake

type Handshake struct {
	V        string `json:"v"`
	ClientID string `json:"client_id"`
}

type Pan

type Pan struct {
	Left  float32 `json:"left"`
	Right float32 `json:"right"`
}

type Payload

type Payload[T any] struct {
	Cmd   string `json:"cmd"`
	Args  T      `json:"args"`
	Nonce string `json:"nonce"`
}

type SetActivityCommandArgs

type SetActivityCommandArgs struct {
	Pid      int      `json:"pid"`
	Activity Activity `json:"activity"`
}

type SetUserVoiceSettingsCommandArgs

type SetUserVoiceSettingsCommandArgs struct {
	UserId string  `json:"user_id"`
	Volume float32 `json:"volume"`
	Mute   bool    `json:"mute"`
	Pan    Pan     `json:"pan"`
}

type Timestamps

type Timestamps struct {
	Start int `json:"start,omitempty"`
	End   int `json:"end,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL