forked from TowarzyszFatCat/doccli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdiscord_integration.py
32 lines (22 loc) · 926 Bytes
/
discord_integration.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
import time
import pypresence.exceptions
from pypresence import Presence, ActivityType
discord_data = ["Menu główne", "Ładowanie..."]
start_time = None
try:
client_ID = '1206583480771936318'
RPC = Presence(client_ID)
RPC.connect()
start_time = time.time()
except: # ojojoj niebezpiecznie
pass
def update_rpc(first_line, second_line):
global discord_data
discord_data = [first_line, second_line]
def set_running(bool):
global running
running = bool
def start_rpc():
while running:
RPC.update(activity_type=ActivityType.WATCHING, state=discord_data[1], details=discord_data[0], large_image='icon_1', large_text="Doccli - oglądaj anime bezpośrednio ze swojego terminalu!", buttons=[{"label": "GitHub", "url": "https://github.com/TowarzyszFatCat/doccli"}, {"label": "Discord Projektu", "url": "https://discord.gg/FgfSM7bSEK"}], start=start_time)
time.sleep(5)