This is a Node.js application that uses Discord.js to check the status of a specific Discord user and sends notifications to a Discord channel based on the user's status. It periodically checks the status of the user and notifies you if it becomes available or unavailable.
Step 1: Clone the Repository
First, you need to clone the repository to your local machine. You can do this by running the following command in your terminal:
git clone https://github.com/Bennobear/Discord-Status-Tracker.gitStep 2: Install Node.js Dependencies
Navigate to the project directory and install the required Node.js packages using npm. Run the following command in your terminal:
cd discord-status-tracker
npm installStep 3: Configure the Application
Before you can use the application, you need to configure it. Create or edit .env file in the project directory and set the following parameters:
TOKEN=YOUR_DISCORD_BOT_TOKEN
SERVER_ID=ID_OF_SERVER
CHANNEL_ID=YOUR_DISCORD_CHANNEL_ID
TARGET_USER_ID=ID_OF_DISCORD_USER
TOKEN: Replace with your Discord bot token.SERVER_ID: Replace with the Discord server ID.CHANNEL_ID: Replace with the Discord channel ID.TARGET_USER_ID: Replace with the User ID.
Step 1: Run the Application
After configuring the .env file, you can run the application using the following command:
node discord_tracker.jsStep 2: Monitor User Status
The application will log in to Discord using the provided token and start checking the status of the user every minute.
Step 3: Receive Notifications
If the status changes (from Offline to Online or vice versa), the application will send a notification to the specified Discord channel.
Step 4: Continuous Monitoring
You can keep the application running to continuously monitor the user's status. It will automatically check and notify you according to the configured interval.
This project uses the following Node.js packages:
- discord.js: A library for interacting with the Discord API.
- dotenv: Loads environment variables from a .env file into process.env.
Railway.app is a platform that simplifies the deployment of Node.js applications. Follow these steps to deploy the Discord Status Checker app on Railway.app:
-
Railway Account: Sign up for an account on Railway.
-
GitHub Repository: Ensure your Discord Status Checker app is hosted on a GitHub repository.
-
Discord Bot Token: Obtain a Discord bot token from the Discord Developer Portal.
-
Create a New Project on Railway:
- Log in to your Railway account.
- Click on the "New Project" button.
- Choose a name for your project and select Node.js as the project type.
- Connect your GitHub repository where the Discord Status Checker app is hosted.
-
Configure Environment Variables:
- Go to your Railway project dashboard.
- Navigate to the "Settings" tab.
- Click on the "Environment Variables" section.
- Add the following environment variables:
TOKEN: Your Discord bot token.SERVER_ID: The ID of the Discord server.CHANNEL_ID: The ID of the Discord channel.TARGET_USER_ID: The ID of the Discord user to track.
-
Deploy Your Application:
- Once you've configured everything, click on the "Deploy" button in your Railway project dashboard.
- Railway will automatically deploy your Discord Status Checker app.
- Once the deployment is complete, your app will be live and running on Railway.
-
Monitor Your Application:
- Railway provides logs and metrics to monitor your deployed application.
- You can view logs and metrics from your Railway project dashboard.
-
Continuous Deployment:
- Connect your GitHub repository to enable continuous deployment on Railway.
- Any changes you push to your GitHub repository will automatically trigger a new deployment on Railway.