Skip to content

Commit

Permalink
Fix Rich Presence update rate limit (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
NikOverflow authored Mar 1, 2024
2 parents 4b13205 + d224d49 commit dba83e4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

rpc = None
connected = False
wait = 10
wait = 15

def connect():
global connected
Expand All @@ -14,7 +14,7 @@ def connect():
rpc.connect()
print("Connected.")
connected = True
wait = 10
wait = 15
return rpc
except Exception:
print("Could not connect!")
Expand Down Expand Up @@ -72,6 +72,7 @@ def is_running():
rpc = None
disconnect()
print(f"Trying to reconnect in {wait} seconds.")
# Rate Limit (15s): https://discord.com/developers/docs/rich-presence/how-to#updating-presence
time.sleep(wait)
except KeyboardInterrupt:
disconnect()

0 comments on commit dba83e4

Please sign in to comment.