make discord presence id a constant

This commit is contained in:
csd4ni3l
2025-05-01 19:08:07 +02:00
parent 04222b4999
commit 9733602fa3
3 changed files with 6 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
import arcade, arcade.gui, asyncio, pypresence, time, json, copy
from utils.preload import button_texture, button_hovered_texture, theme_sound
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(1363780625928028200)
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(1363780625928028200)
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(1363780625928028200)
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

View File

@@ -9,6 +9,7 @@ CELL_SIZE = 10
SPACING = 2
NEIGHBORS = [(-1, 0), (-1, 1), (-1, -1),(0, 0), (0, 1), (0, -1), (1, 0), (1, 1), (1, -1)]
discord_presence_id = 1363780625928028200
log_dir = 'logs'
menu_background_color = arcade.color.DARK_SLATE_GRAY