Skip to content

Commit

Permalink
fix discord presence
Browse files Browse the repository at this point in the history
  • Loading branch information
blaisewf authored Jan 19, 2024
1 parent 272921f commit da7e69a
Showing 1 changed file with 25 additions and 20 deletions.
45 changes: 25 additions & 20 deletions assets/discord_presence.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,35 @@
import datetime as dt
import time


def rich_presence():
client_id = "1144714449563955302"
RPC = Presence(client_id)
RPC.connect()
RPC.update(
state="applio.org",
details="Ultimate voice cloning tool.",
buttons=[
{"label": "Home", "url": "https://applio.org"},
{"label": "Download", "url": "https://applio.org/download"},
],
large_image="logo",
large_text="experimenting with applio",
start=dt.datetime.now().timestamp(),
)
return RPC

try:
RPC.connect()
RPC.update(
state="applio.org",
details="Ultimate voice cloning tool.",
buttons=[
{"label": "Home", "url": "https://applio.org"},
{"label": "Download", "url": "https://applio.org/download"},
],
large_image="logo",
large_text="experimenting with applio",
start=dt.datetime.now().timestamp(),
)
return RPC
except Exception as e:
print(f"An error occurred: {e}")
return None

if __name__ == "__main__":
rpc = rich_presence()

try:
while True:
time.sleep(15)
except KeyboardInterrupt:
rpc.close()
if rpc:
try:
while True:
time.sleep(15)
except KeyboardInterrupt:
rpc.close()
else:
print("Failed to initialize Rich Presence.")

0 comments on commit da7e69a

Please sign in to comment.