make discord presence id a constant

This commit is contained in:
csd4ni3l
2025-05-01 19:06:26 +02:00
parent c8971cc8ae
commit fb5691bcf7
3 changed files with 6 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
import arcade, arcade.gui, asyncio, pypresence, time, copy, json
from utils.preload import button_texture, button_hovered_texture
from utils.constants import button_style
from utils.constants import button_style, discord_presence_id
from utils.utils import FakePyPresence
class Main(arcade.gui.UIView):
@@ -22,7 +22,7 @@ class Main(arcade.gui.UIView):
except:
asyncio.set_event_loop(asyncio.new_event_loop())
try:
self.pypresence_client = pypresence.Presence(1360953272843632680)
self.pypresence_client = pypresence.Presence(discord_presence_id)
self.pypresence_client.connect()
self.pypresence_client.start_time = time.time()
except:
@@ -33,7 +33,7 @@ class Main(arcade.gui.UIView):
# get start time from old object
start_time = copy.deepcopy(self.pypresence_client.start_time)
try:
self.pypresence_client = pypresence.Presence(1360953272843632680)
self.pypresence_client = pypresence.Presence(discord_presence_id)
self.pypresence_client.connect()
self.pypresence_client.start_time = start_time
except:

View File

@@ -2,7 +2,7 @@ import copy, pypresence, json, os
import arcade, arcade.gui
from utils.constants import button_style, dropdown_style, slider_style, settings
from utils.constants import button_style, dropdown_style, slider_style, settings, discord_presence_id
from utils.utils import FakePyPresence
from utils.preload import button_texture, button_hovered_texture, theme_sound
@@ -180,7 +180,7 @@ class Settings(arcade.gui.UIView):
self.pypresence_client.close()
del self.pypresence_client
try:
self.pypresence_client = pypresence.Presence(1360953272843632680)
self.pypresence_client = pypresence.Presence(discord_presence_id)
self.pypresence_client.connect()
self.pypresence_client.update(state='In Settings', details='Modifying Settings', start=start_time)
self.pypresence_client.start_time = start_time