The Website Monitoring Bot is a simple yet powerful tool designed to keep track of the availability of a specified website. It periodically sends requests to the target URL and reacts accordingly by sending colour-coded messages to indicate the status: green for up, orange for potential issues, red for confirmed downtime, and blue for maintenance mode.
- The bot is built with Discord.js v14 using JavaScript
- Uses Axios to ping the site
- Request Monitoring: Regularly checks the specified website's availability.
- Color-Coded Messages: Responds with different color-coded messages based on the website's status.
- Automatic Reaction: Takes action based on the website's status after a series of consecutive requests.
- Maintenance Mode: Allows you to manually set the bot to maintenance mode, temporarily stopping the requests.
- Config file: Easy to edit config file
-
Clone the repository:
git clone https://github.com/IPQow/discord-uptime-pinger cd discord-uptime-pinger
-
Install dependencies:
Since this bot is written in JavaScript, ensure you have Node.js installed. You can install the required dependencies using:
npm install
-
Configure the bot:
Open the
config.js
file and update the following parameters:
To customize the bot's configuration, follow these steps:
-
Open the
config.js
file in a text editor. -
Modify the following parameters:
TOKEN: 'BOT_TOKEN',
// Your Discord bot tokenURL_TO_PING: 'URL_TO_PING',
// The URL of the website you want to monitorSTATUS_CHANNEL_ID: 'MAIN_STATUS_CHANNEL_ID',
// Discord channel ID to send the status messages to (public)LOG_CHANNEL_ID: 'LOG_CHANNEL_ID',
// Discord channel ID to send log messages to (private)MAINTENANCE_USER_ID: 'USER_ID',
// Discord user ID that can activate/deactivate maintenance modeSERVICENAME: 'Example',
// Name of the service being monitoredSTATUSPAGE: 'https://status.example.com/',
// URL to the service's status pagePINGTIME: '300000',
// Time in milliseconds between each ping (default: 300000 - 5 minutes)ORANGETRIES: 3,
// Number of consecutive pings triggering an orange status messageDOWNTRIES: 10,
// Number of consecutive pings confirming service downtime and triggering a red status messageGREEN: 'https://github.com/IPQow/discord-uptime-pinger/blob/main/assets/online.png?raw=true',
// URL to the green status imageRED: 'https://github.com/IPQow/discord-uptime-pinger/blob/main/assets/offline.png?raw=true',
// URL to the red status imageBLUE: 'https://github.com/IPQow/discord-uptime-pinger/blob/main/assets/maintenance.png?raw=true',
// URL to the blue status imageORANGE: 'https://github.com/IPQow/discord-uptime-pinger/blob/main/assets/maybe.png?raw=true',
// URL to the orange status image
-
Save the changes.
Potential issues embed - Orange
Maintenance mode enable - Blue
Maintenance mode disable - Blue
Maintenance mode message showcase - Blue
Logs when service initially stops responding
-
Start the bot:
node uptime.js
-
Interact with the bot:
- Type "maintenance" followed my a reason to activate maintenance mode. (e.g. "maintenance upgrading versions")
- The bot will automatically respond with appropriate messages based on the website's status.
- Green Message: "The website is up and running smoothly."
- Orange Message: "The website may be experiencing issues. Checking again..."
- Red Message: "The website is down. Confirming the issue..."
- Blue Message: "Maintenance mode activated. The service is currently undergoing maintenance."
Contributions are welcome! Feel free to open issues or submit pull requests to enhance the bot's functionality or fix any issues.
This project is licensed under the MIT License - see the LICENSE file for details.