discord

package
v1.8.3 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2026 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package discord publishes the now-playing track to Discord as Rich Presence ("Listening to …") over Discord's local IPC socket. It needs a Discord application client id (configure via $OPENDEEZER_DISCORD_APP_ID or ~/.config/opendeezer/discord-app-id.txt); with none set it is a no-op.

Connection is best-effort and lazy: all IPC work runs on a dedicated worker goroutine fed by Update, so the caller (the Bubble Tea update loop) never blocks on a dial or a wedged Discord. Works on macOS/Linux (unix socket); Windows (named pipe) is currently a no-op.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Presence

type Presence interface {
	Update(State)
	Close()
}

Presence publishes State to Discord and is closed on shutdown.

func New

func New(appID string) Presence

New returns a Presence for the given Discord application id. An empty id yields a no-op (feature disabled).

type State

type State struct {
	Status     string // "playing" | "paused" | "stopped"
	Title      string
	Artist     string
	Album      string
	PositionMS int64
	DurationMS int64
}

State is a now-playing snapshot pushed by the UI.

Jump to

Keyboard shortcuts

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