violet/test.py
2022-12-27 15:58:42 +01:00

20 lines
516 B
Python

# TODO Test this on Windows
import platform
import subprocess
# Check the operating system
os_name = platform.system()
# Set the Discord binary path based on the operating system
if os_name == 'Windows':
discord_path = 'C:\Program Files (x86)\Discord\Discord.exe'
elif os_name == 'Darwin': # macOS
discord_path = '/Applications/Discord.app/Contents/MacOS/Discord'
else:
# Assume Linux
discord_path = '/usr/bin/discord'
# Open Discord using the default binary path
subprocess.run([discord_path])