-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
31 lines (26 loc) · 971 Bytes
/
main.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
#!/usr/bin/env python
import time
import sys
from core import *
from discoIPC import ipc
if __name__ == "__main__":
print("Starting Nuclear Throne RPC")
if RUN_TUTORIAL:
if input("Please confirm that your Stream Key is %s, type Y to continue\n" % STREAM_KEY).lower() != "y":
sys.exit()
if input("Please confirm that your Steam64ID is %s, type Y to continue\n" % STEAM_64_ID).lower() != "y":
sys.exit()
s = Session(STREAM_KEY, STEAM_64_ID)
client = ipc.DiscordIPC(DISCORD_CLIENT_ID)
client.connect()
print("Started Nuclear Throne RPC")
while True:
try:
s.update()
client.update_activity(s.generate_presence())
time.sleep(UPDATE_INTERVAL)
print("[%s]: Updated Discord with game info" % time.strftime("%X"))
except KeyboardInterrupt:
print("Exiting Nuclear Throne RPC")
client.disconnect()
sys.exit()