-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdiscord_rp.py
44 lines (39 loc) · 1.07 KB
/
discord_rp.py
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
40
41
42
43
44
# Discord Rich Presence
from discordrp import Presence
import time
import os
# Set title
os.system("title Discord Rich Presence")
# Set time
time_local = time.localtime()
time_current = time.strftime("%H:%M:%S", time_local)
# Discord Client ID
client_id = "000000000000000000"
with Presence(client_id) as presence:
# Set data
print("Discord Connected!")
presence.set(
{
"details": "Example Details",
"state": "Example State",
"timestamps": {
"start": int(time.time())
},
"assets": {
"large_image": "example-large-key",
"large_text": "Large Text Hover",
"small_image": "example-small-key",
"small_text": "Small Text Hover",
},
"buttons": [
{
"label": "Example Button",
"url": "https://github.com/TriForceX",
},
],
}
)
# End
print(f"Status Started at {time_current}")
while True:
time.sleep(15)