Example of Discord status automatically updating based on currently playing title.
- The game icon is displayed on the Discord's RP.
- The console currently being played is also displayed.
- Hovering over the game icon displays the user's overall achievements status about the current game. (e.g "31 of 138 achieved | 22 %")
- Displays the user's story progress percentage at the last part of the rich presence message about the current game. (e.g "...some rich presence message | Story Progress: 48 %")
- A first button that redirects to the user's RA profile. (Don't worry, I made an option to turn this off)
- If the username display is turned off, the first button will have the link to the RetroAchievements website instead.
- A second button that redirects to the current game info inside the RetroAchievements website.
- Discord's Rich Presence will get cleared after you stopped playing for 5 minutes (default). (You can modify this duration inside the
config.inifile) - Optimized game title.
- Optimized game status.
- In order for this script to work, your emulator must be logged into RetroAchievements. RetroAchievements integration is supported in most mainstream emulators, but support may vary.
- You must obtain your RetroAchievements Web API Key in order for this script to authenticate to RA APIs. You can obtain your API key in your RetroAchievement settings. Credentials are stored on your local device.
- It is optional, but recommended that you provide your own Discord Client ID. This requires creating a Discord Application and obtaining the Client ID from the "OAuth2" tab. The name of your Application will be refelected in your Discord status. By default, a Discord Application shared between users of this script is used.
In this way, you don't need to install Python and its packages.
- Run the
Discord RA Rich Presence.exefile. - A
config.inifile will be generated and your RA credentials will be put inside of it. - Modify the
config.inifile if you need to adjust some default settings. (Like the timeout limit, refresh rate, or even your entered credentials) Note: Running it silently/in the background isn't allowed with theexefile. You need to follow the instructions below to implement it.
The following instructions assume Windows OS, but may be translated to similar commands for Mac/Linux.
- Install Python. (It works currently at version 3.13.1)
- In your command line, ensure that python is installed correctly by entering this command:
py --version(Windows)python3 --version(Mac). - Run the command,
py -m pip install -r requirements.txt. Make sure that you're running this command in this directory. - Open Discord App. (NOTE: Discord App should always be opened first before running the
run.batfile.) - Go to Discord > User Settings > Activity Privacy. Toggle on
Share your detected activity with others. - Run the
run.batfile (Windows) or run the script directly via Python (Mac/Linux), enter your credentials,usernameandapi keyfrom RetroAchievements.
Note: You may alternatively store your credentials via environment variables RETROACHIEVEMENTS_USERNAME, RETROACHIEVEMENTS_API_KEY, and DISCORD_CLIENT_ID. If set, they will be used by default.
After running the script a config.ini file will be created in the same directory. The credentials that you've submitted are stored in this config file.
- Run the
batRunner.vbsfile instead of therun.bat. (You can only do this once you've configured your credentials and your rich presence works already.) Otherwise, run yourrun.batfile. - Since running the
batRunner.vbsfile makes the process not visible on the taskbar, you need to run thebatStopper.batto stop the rich presence from working. (Otherwise, the other way is to stopPythonfrom running on your task manager) - It is also possible to make the
batRunner.vbsfile to run as startup app.
Make a shortcut of the file > Windows + R > Typeshell:startup, then press Enter > Place the shortcut in this directory.
If you want to keep the rich presence running, you can just edit theconfig.inifile and modify thekeepRunningvalue. By default, it is set toFalse. Turn this toTrueif you want to keep it running without idling.
- Start Discord. If Discord is not officially supported on your OS, you may need an alternative client such as LegCord, for example. Official clients are recommended, use alternative clients at your own risk.
- Ensure you have Python installed correctly via the instructions above.
- Run the following command in your terminal:
nohup python RARPC.py > rarpc-logs.log 2>&1 &. This command will run the script in the background until the device is shutdown. Logs are redirected torarpc-logs.log.
Note: dylanb124 is working on a solution to run this in the background after device shutdown/reboot, such as via systemd. Currently, there are issues accessing the Discord RPC when the service is run via systemd.
- If ever you don't want your username to have a redirection button on your Discord RP, just edit the
config.inifile and modify the value inside thedisplayUsernametoFalse. By default, this isTrue. Notice the capital letters in the True and False as wrong cases may result to an error. - Save the changes you made, close the
run.batfile, and open it again to reflect changes. - If you're using the
exefile, just refer to step 2 and do the same thing.
All the configurations inside the config.ini file can be modified based on your preferences. Just make sure to follow the proper syntax to avoid errors.
- Always open the Discord App first before running the script or the exe file.