-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
49 lines (40 loc) · 1.52 KB
/
main.py
File metadata and controls
49 lines (40 loc) · 1.52 KB
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
45
46
47
48
49
import os
try:
from pypresence import Presence
except:
if os.name == "nt":
os.system("python -m pip install pypresence")
else:
os.system("python3 -m pip install pypresence")
application_id = "DISCORD APP ID HERE"
RPC = Presence(client_id = application_id)
RPC.connect()
def rpcUpdate(RPC, buttonsOn, buttons, textOn, details, state, image, imagecaption):
if (buttonsOn):
if (textOn):
RPC.update(buttons=buttons, details=details, state=state, large_image = image, large_text = imagecaption)
else:
RPC.update(buttons=buttons, large_image = image, large_text = imagecaption)
else:
if (textOn):
RPC.update(details=details,state=state,large_image=image,large_text=imagecaption)
else:
RPC.update(large_image=image,large_text=imagecaption)
buttons = [{
"label": "My Website", # Top button text.
"url": "https://freakish.dev" # Top button link.
},
{
"label": "Follow Me!", # Bottom button text.
"url": "https://github.com/SomeRandom-Dev" # Bottom button link.
}
]
TOPTEXT = "please stop looking"
BOTTOMTEXT = "at my profile :)"
IMAGEKEY = "KEY" # The image key, from the list above
IMAGECAPTION = "CAPTION" # The text showed when the image is hovered over
buttonsenabled = True # Set to false to disable the buttons.
textenabled = True # Set to false to disable the text.
rpcUpdate(RPC, buttonsenabled, buttons, textenabled, TOPTEXT, BOTTOMTEXT, IMAGEKEY, IMAGECAPTION)
while True:
input()