This script is a wrapper for the Pypresence package that allows for configuration and customization of Discord User Rich Presences.
This project utilizes the following technologies and packages:
Step 1: Ensure you have the latest python3 and pip3 installed.
# check that python is installed
python3 --version
# check that pip3 is installed
pip3 --version
Step 2: Install the dependencies by running the setup.py
script.
# install dependencies
python3 setup.py install --user
Step 3: Create an application on the Discord Developers Portal and copy the clientId
on the OAuth2 tab.
Step 4: Make an .env
file with the following key-value pairs.
# enviroment variables
CLIENT_ID=<CLIENT_ID>
JSON_FILE_PATH=<FILE_PATH>
SLEEP_DELAY_MS=<INTEGER>
Step 5: Edit the config.json
to match the art assets in the Rich Presence tab of your Discord application. For more information on these fields see the Pypresence documentation here.
// configuration fields for rich presence
{
"state": "<YOUR_STATE_HERE>",
"details": "<YOUR_DETAILS_HERE>",
"start": 1,
"end": 10,
"large_image": "<LARGE_IMAGE_NAME>",
"large_text": "<LARGE_IMAGE_HOVER_TEXT>",
"small_image": "<SMALL_IMAGE_NAME>",
"small_text": "<SMALL_IMAGE_HOVER_TEXT>",
"party_id" : null,
"party_size": [1, 10],
"join": null,
"spectate": null,
"match": null,
"buttons": [
{"label": "<EXAMPLE_SITE_1>", "url": "<URL_1_HERE>"},
{"label": "<EXAMPLE_SITE_2>", "url": "<URL_2_HERE>"}
],
"instance": true
}
Step 6: Start the script with the following command:
# start rich presence
python3 main.py
Step 7: Show off your custom rich presence on Discord!