File size: 977 Bytes
938411e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from pypresence import Presence
import datetime as dt
import time


def rich_presence():
    client_id = "1144714449563955302"
    RPC = Presence(client_id)
    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()

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