fetchcord / FetchCord

FetchCord grabs your OS info and displays it as Discord Rich Presence
MIT License
325 stars 21 forks source link

[Feature Request] Set RPC in discord running within a browser session #197

Closed Animeshz closed 2 years ago

Animeshz commented 2 years ago

Currently it reports this when Discord Application is not running.

  ~ >>> fetchcord
('DEFAULT', <Section: DEFAULT>)
('cycle_0', <Section: cycle_0>)
('cycle_1', <Section: cycle_1>)
('cycle_2', <Section: cycle_2>)
('cycle_3', <Section: cycle_3>)
Unknown motherboard, contact us on github to resolve this.
Traceback (most recent call last):
  File "/home/animesh/.local/bin/fetchcord", line 8, in <module>
    sys.exit(main())
  File "/home/animesh/.local/lib/python3.10/site-packages/fetch_cord/__main__.py", line 117, in main
    run.run_loop(computer)
  File "/home/animesh/.local/lib/python3.10/site-packages/fetch_cord/run_rpc.py", line 62, in run_loop
    self.rpcs[self.loops_indexes[i]] = Presence(client_id)
  File "/home/animesh/.local/lib/python3.10/site-packages/pypresence/presence.py", line 13, in __init__
    super().__init__(*args, **kwargs)
  File "/home/animesh/.local/lib/python3.10/site-packages/pypresence/baseclient.py", line 28, in __init__
    raise DiscordNotFound
pypresence.exceptions.DiscordNotFound: Could not find Discord installed and running on this machine.

I believe there can be a way to contact the browser discord, if there exists any, maybe by packaging a chrome extension and exposing a connection port which lets the daemon communicate (not too sure about this).

Animeshz commented 2 years ago

Oops, seems like the communication happens through a websocket that currently cannot be created within a browser :(

https://support.discord.com/hc/en-us/community/posts/360048067452-Allow-Rich-Presence-from-web-apps