Skip to content

Bennobear/Discord-Status-Tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dicord Status Checker

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.

Table of Contents

Installation

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.git

Step 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 install

Step 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.

Usage

Step 1: Run the Application

After configuring the .env file, you can run the application using the following command:

node discord_tracker.js

Step 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.

Dependencies

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.

Miscellaneous

Deploying Discord Status Checker on Railway.app

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:

Prerequisites:

  1. Railway Account: Sign up for an account on Railway.

  2. GitHub Repository: Ensure your Discord Status Checker app is hosted on a GitHub repository.

  3. Discord Bot Token: Obtain a Discord bot token from the Discord Developer Portal.

Deployment Steps:

  1. 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.
  2. 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.
  3. 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.
  4. Monitor Your Application:

    • Railway provides logs and metrics to monitor your deployed application.
    • You can view logs and metrics from your Railway project dashboard.
  5. 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.

Releases

No releases published

Packages

 
 
 

Contributors