Warning
THIS REPOSITORY IS ONLY FOR EDUCATIONAL PURPOSES AND IS NOT INTENDED FOR BREAKING DISCORD'S TERMS OF SERVICE. USE AT YOUR OWN RISK.
A rich presence integration for Discord, allowing you to display custom activity statuses for your Discord account.
- Features
- Prerequisites
- Installation
- Configuration
- Usage
- Commands
- Docker Support
- Troubleshooting
- Contributing
- License
- Set custom Discord Rich Presence status
- Multiple account support via token-based authentication
- Control via Discord bot commands
- Status customization (name, details, state, images, timestamps)
- Keep-alive server option
- Docker support
- Command-line interface
- Node.js (version 22.16.0 or higher)
- npm (included with Node.js)
- A Discord account and user token
- A Discord bot token (for command control)
- A server or always-on machine to host the application
-
Clone the repository:
git clone https://github.com/aarush0101/Rich-Presence.git cd Rich-Presence -
Install dependencies:
npm install
-
Create a configuration file by copying the example:
cp .env.example .env
-
Edit the
.envfile with your settings (see Configuration)
-
Clone the repository:
git clone https://github.com/aarush0101/Rich-Presence.git cd Rich-Presence -
Create and configure your
.envfile as above -
Build and run the Docker container:
docker build -t rich-presence . docker run -d --name rich-presence --env-file .env rich-presence
The application is configured via the .env file. Copy the .env.example file and modify the values as needed:
| Variable | Description |
|---|---|
START |
Set to true to enable the application |
BOT_TOKEN |
Your Discord bot token for command control |
USER_TOKENS |
Comma-separated list of Discord user tokens to set Rich Presence for |
PREFIX |
Command prefix for the bot (e.g., !) |
| Variable | Description |
|---|---|
NAME |
Activity name (e.g., "Minecraft") |
DETAILS |
First line of Rich Presence (e.g., "Playing Hypixel") |
STATE |
Second line of Rich Presence (e.g., "In Progress") |
TYPE |
Activity type (0: Playing, 1: Streaming, 2: Listening, 3: Watching, 5: Competing) |
STATUS |
User status (online, idle, dnd, invisible) |
LARGE_IMAGE_URL |
URL for the large image (use mp: prefix for media proxy URLs) |
LARGE_TEXT |
Text shown when hovering over the large image |
SMALL_IMAGE_URL |
URL for the small image (use mp: prefix for media proxy URLs) |
SMALL_TEXT |
Text shown when hovering over the small image |
TIMESTAMPS |
Set to true to show elapsed time |
| Variable | Description |
|---|---|
SERVER_ID |
Specific server ID for the bot (optional) |
START_SERVER |
Set to true to enable the keep-alive HTTP server |
PORT |
Port for the keep-alive server (default: 8080) |
HOST |
Host for the keep-alive server (default: localhost) |
NO_ACTIVITY |
Set to true to disable Rich Presence activity |
Run the application using npm:
npm startOr directly with Node.js:
node index.jsUsing the provided shell script:
./start.shOnce the bot is running, you can control it using commands in a Discord server where the bot is present:
| Command | Description |
|---|---|
!help |
Show available commands |
!ping |
Check if the bot is responsive |
!start |
Start Rich Presence for all configured tokens |
!start <index> |
Start Rich Presence for a specific token by index |
!stop |
Stop Rich Presence for all tokens |
!stop <index> |
Stop Rich Presence for a specific token by index |
!restart |
Restart Rich Presence for all tokens |
!restart <index> |
Restart Rich Presence for a specific token by index |
!status |
Check the status of Rich Presence connections |
!status <index> <status> |
Change the status for a specific token (online, idle, dnd, invisible) |
The application includes a Dockerfile for containerized deployment:
# Build the image
docker build -t rich-presence .
# Run the container
docker run -d --name rich-presence --env-file .env rich-presence
# View logs
docker logs rich-presence
# Stop the container
docker stop rich-presence-
Invalid Token Error
- Ensure your user tokens and bot token are valid and properly formatted
- Check if the tokens have the necessary permissions
-
Connection Errors
- Check your internet connection
- Verify the Discord Gateway URL in settings.conf
- Ensure you're not being rate-limited by Discord
-
Bot Not Responding
- Verify the bot is online
- Check if the bot has the necessary permissions
- Ensure the prefix is correctly set in the .env file
-
Activity Not Showing
- Check if
NO_ACTIVITYis set tofalse - Ensure
TYPEis not set to 4 (which is not allowed) - Verify your URLs are correctly formatted
- Check if
The application logs information to the console. Look for error messages that might indicate the source of problems.
Contributions are welcome! Please read the CONTRIBUTING.md file for guidelines.
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Commit your changes:
git commit -am 'Add some feature' - Push to the branch:
git push origin feature-name - Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.