NextFire / apple-music-discord-rpc

🎵 Discord Rich Presence Client for the macOS Apple Music app and iTunes
MIT License
511 stars 33 forks source link

RangeError: IPC ID must be between 0-9 #48

Closed cluelessdev404 closed 1 year ago

cluelessdev404 commented 1 year ago

The script can't seem to detect Discord. I'm on the latest version of the stable branch.

This is what I get when I manually run the script:

Client {
  ipc: DiscordIPC {},
  user: undefined,
  config: undefined,
  token: undefined,
  tokenExpires: undefined,
  application: undefined,
  options: { id: "..." } <-removed
}

Display current activity is enabled in Discord

macOS 13.1, Discord Stable 168826 (3146690)

cluelessdev404 commented 1 year ago

I used these commands, in these order, to install:

brew install deno
brew tap nextfire/tap
brew install apple-music-discord-rpc
brew services restart apple-music-discord-rpc

None of them gave any errors during the install. which deno also points me to the path.

NextFire commented 1 year ago

Is there any other logging besides the Client one?

cluelessdev404 commented 1 year ago
RangeError: IPC ID must be between 0-9
    at getIPCPath (https://raw.githubusercontent.com/harmonyland/discord_rpc/ba127c20816af15e2c3cd2c17d81248b097e9bd2/src/util.ts:14:31)
    at findIPC (https://raw.githubusercontent.com/harmonyland/discord_rpc/ba127c20816af15e2c3cd2c17d81248b097e9bd2/src/util.ts:30:16)
    at findIPC (https://raw.githubusercontent.com/harmonyland/discord_rpc/ba127c20816af15e2c3cd2c17d81248b097e9bd2/src/util.ts:41:12)
    at async Function.connect (https://raw.githubusercontent.com/harmonyland/discord_rpc/ba127c20816af15e2c3cd2c17d81248b097e9bd2/src/conn.ts:40:18)
    at async Client.connect (https://raw.githubusercontent.com/harmonyland/discord_rpc/ba127c20816af15e2c3cd2c17d81248b097e9bd2/src/client.ts:85:16)
    at async main (file:///usr/local/Cellar/apple-music-discord-rpc/0.5.0/bin/music-rpc.ts:70:5)
   NotFound: No such file or directory (os error 2)
    at async Object.readTextFile (deno:runtime/js/40_read_file.js:56:20)
    at async Function.loadCache (file:///usr/local/opt/apple-music-discord-rpc/bin/music-rpc.ts:27:20)
    at async start (file:///usr/local/opt/apple-music-discord-rpc/bin/music-rpc.ts:63:3) No valid cache.json found, generating a new cache...
BrokenPipe: Broken pipe (os error 32)
    at async write (deno:ext/net/01_net.js:27:12)
    at async DiscordIPC.send (https://raw.githubusercontent.com/harmonyland/discord_rpc/ba127c20816af15e2c3cd2c17d81248b097e9bd2/src/conn.ts:81:5)
NextFire commented 1 year ago

Can you try this https://github.com/NextFire/apple-music-discord-rpc/issues/43#issuecomment-1321221961 and report me what you see in the Discord console?

cluelessdev404 commented 1 year ago

Sorry for the late response, it just started working again. I changed my status from online to invisible then online again, then restarted discord and it worked. Thanks again.

chrisportela commented 1 year ago

For anyone seeing this error in the future: make sure under Activity Settings > Activity Privacy that "Display current activity as status message" is enabled.