Senophyx / Discord-RPC

An Python wrapper for Discord RPC
https://pypi.org/project/discord-rpc
MIT License
28 stars 8 forks source link

unpack requires a buffer of 8 bytes #35

Closed ImDevinC closed 1 month ago

ImDevinC commented 1 month ago

Using the following example (with a proper app_id), I get the following error. I believe this may be related to a Discord update, as this worked fine before but looks to have issues now. I'm running on Linux if that makes a difference.

import discordrpc

rpc = discordrpc.RPC(app_id=1234)

rpc.set_activity(state="Test", details="Testing")

rpc.run()
Traceback (most recent call last):
  File "/home/imdevinc/Projects/test/main.py", line 3, in <module>
    rpc = discordrpc.RPC(app_id=1274526445510856765)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/imdevinc/Projects/test/.venv/lib/python3.12/site-packages/discordrpc/presence.py", line 38, in __init__
    self._setup()
  File "/home/imdevinc/Projects/test/.venv/lib/python3.12/site-packages/discordrpc/presence.py", line 53, in _setup
    self.User=self.ipc.handshake()
              ^^^^^^^^^^^^^^^^^^^^
  File "/home/imdevinc/Projects/test/.venv/lib/python3.12/site-packages/discordrpc/presence.py", line 269, in handshake
    data = self._recv()
           ^^^^^^^^^^^^
  File "/home/imdevinc/Projects/test/.venv/lib/python3.12/site-packages/discordrpc/presence.py", line 251, in _recv
    dec_header = struct.unpack("<ii", enc_header)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
struct.error: unpack requires a buffer of 8 bytes

Discord version: stable 335398 (5f5f9be) Host 0.0.70 x64 Build Override: N/A Linux 64-bit (6.11.2-arch1-1)

ImDevinC commented 1 month ago

nvm, must be something with my install. I tested on a secondary machine and it works fine.