Welcome to the Discord Activity Tracker Bot repository. This bot monitors configured users and broadcasts their Discord activities to specified channels. It includes optional Spotify track details and rotates through predefined status messages.
- Activity Tracking: Tracks what users are playing, listening to, or watching in real-time.
- Spotify Integration: Displays details about songs being played on Spotify.
- Rotating Status Messages: Cycles through a predefined list of statuses every hour.
- Dynamic User Management: Supports user configuration via users.json for flexible activity tracking across multiple users.
- Docker Support: Easy to deploy and manage using Docker.
This bot is developed using:
- Discord.js
- Node.js
- TypeScript
- Docker for simplified deployment
To set up the Discord Activity Tracker Bot, follow these instructions:
-
Clone the Repository: Clone the repository to your machine or server.
git clone https://github.com/nicokempe/discord-tracker.git
-
Set Up Environment Variables:
-
Copy the
.env.examplefile to a new file named.env.cp .env.example .env
-
Edit the
.envfile and replace the placeholder value with your actual Discord bot token.DISCORD_TOKEN=your_actual_discord_bot_token
-
Configure User Tracking: The bot allows tracking multiple users dynamically through a users.json file. This file specifies which users the bot should track and in which channels to post updates.
Create a
configdirectory in the project root and add your ownusers.jsonfile. This file is not included in the repository and must be supplied by you.Example
users.json:{ "users": [ { "userId": "1234567890", "channelId": "9876543210", "broadcast": false, "prefix": ":boom:", "mentionUser": true }, { "userId": "0987654321", "channelId": "5678901234", "broadcast": true, "prefix": ":star:", "mentionUser": false } ] }The
broadcastflag controls how updates are phrased. When set totrue, updates are formatted for a public channel with the user's name. Iffalse, messages address the user directly. -
Docker Setup: Make sure Docker is installed on your system. Use the
Dockerfileto build and run the bot with Docker.Build and run with Docker:
docker build -t discord-tracker . docker run -d --name discord-tracker -v $(pwd)/config:/usr/src/app/config discord-tracker
- The
users.jsonshould be placed inside theconfigfolder in your project root, and Docker will mount this directory at runtime.
- The
-
Start the Bot: After setting everything up, start the bot. It will automatically begin tracking the specified users and post updates to the designated channels.
After setting up, the bot will automatically start tracking the users specified in users.json and rotate its status. It will also post updates about their activities in the designated Discord channels. Ensure the bot has the necessary permissions in your Discord server to function properly.
Contributions to the Discord Activity Tracker Bot are welcome. Please feel free to fork the repository, make your changes, and submit a pull request. For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under the MIT License - see the LICENSE file for details.