Skip to content
TheChatArchiveThe Chat Archive
gpt-3.5-turbo-0613· openaiHugging Face Suzhen/CodeChat

in bash make a script to set your rich presence for the duration the bash script is…

  1. User

    in bash make a script to set your rich presence for the duration the bash script is running

  2. 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:

    1. Install the required dependency (discord-rpc) using pip:
    pip install pypresence
    
    1. 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
    
    1. 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.

    2. Set executable permissions for the script:

    chmod +x rich_presence.sh
    
    1. Run the script using:
    ./rich_presence.sh
    

    This script will execute the Rich Presence setup and keep it active as long as the script is running.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.