gpt-3.5-turbo-0613· openai
Suzhen/CodeChat
in bash make a script to set your rich presence for the duration the bash script is…
- User
in bash make a script to set your rich presence for the duration the bash script is running
- Assistant
To set your Discord Rich Presence for the duration that the bash script is running, you'll need to use the Discord RPC Library. Follow the steps below to achieve this:
- Install the required dependency (discord-rpc) using pip:
pip install pypresence- Create a new bash script, for example
rich_presence.sh, and add the following code to it:
#!/bin/bash # Function to set the Rich Presence set_rich_presence() { cd "path/to/discord-rpc/library" # Change this path to where your discord-rpc library is located # Replace the values in the next four lines with your own details CLIENT_ID="your_client_id" DETAILS="Your Status Details" STATE="Your Status State" LARGE_IMAGE_KEY="your_large_image_key" ./rich_presence.py "$CLIENT_ID" "$DETAILS" "$STATE" "$LARGE_IMAGE_KEY" & PID=$! # Storing the process ID wait $PID # Wait for the process to finish running } # Call the function to set the Rich Presence set_rich_presence-
Replace the placeholder values in the script with your own details. These details can be obtained after creating a Discord application and setting up Rich Presence.
-
Set executable permissions for the script:
chmod +x rich_presence.sh- Run the script using:
./rich_presence.shThis script will execute the Rich Presence setup and keep it active as long as the script is running.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.