Skip to content

A bot that will ping the mcstatus.io API to retrieve Status, Version and Player Count. It then takes that information and uses it to create an Embed/Webhook that will be posted to a Discord Channel of your choice.

License

Notifications You must be signed in to change notification settings

NotYourAverageGamer/MCStatus-Bot-for-Discord

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MCStatus Bot for Discord

MCStatus Bot for Discord is a bot designed to fetch the status of Minecraft servers and display that information in a Discord server. It periodically checks the status of Minecraft servers (Java Edition and Bedrock Edition) using user-provided API URLs from mcstatus.io and updates the server status on Discord using webhooks and embeds.

✨ Features

  • Compatible with all versions of Minecraft (Bedrock, Java, Paper, etc.)
  • Fetches and displays the status of Minecraft servers on Discord
  • Updates server status periodically using webhooks and embeds.
  • Supports displaying Server Status, Player Count, Server Version, and Restart Schedule.

💡 Prerequisites

Before using the MCStatus Bot for Discord, make sure you have the following:

  • Node.js installed. (Installing Node.js)
  • A Discord server where you have permissions to add bots and manage webhooks.
  • API URLs for the Minecraft servers you want to monitor. (I use mcstatus.io)
    • Java URL example: https://api.mcstatus.io/v2/status/java/YOUR.SERVER.IP
    • Bedrock URL example: https://api.mcstatus.io/v2/status/bedrock/YOUR.SERVER.IP
  • A Discord webhook URL to send updates to your Discord server. (You can obtain one from Discohook. Formatting is handled in main.js)
  • A .env file with necessary environment variables set (copy/rename example.env for quick-setup).

⚡️ Installation

  1. Download and unzip this repo

    OR clone (click)
    git clone https://github.com/NotYourAverageGamer/MCStatus-Bot-for-Discord.git
  2. Navigate to the directory:

    cd YOUR_PATH_TO/MCStatus-Bot-for-Discord
  3. Install dependencies:

    npm install

🛠️ Config

  • Copy/Rename example.env to .env and fill in the following environment variables:
    • SERVER_NAME: Your server name, to be displayed as the title in the webhook.
    • JAVA_API_URL: API URL for the Java Edition Minecraft server.
    • BEDROCK_API_URL: API URL for the Bedrock Edition Minecraft server.
    • WEBHOOK_URL: Discord webhook URL for posting updates.
    • MESSAGE_ID: ID of the message to edit with new embeds.
    • DYNMAP_URL: Enter Dynmap URL (if applicable).
    • THUMBNAIL_URL: Enter URL to server thumbnail.

🧑‍💻 Usage

To start the bot, run the following command from inside the MCStatus-Bot-for-Discord directory:

npm start

This will initiate the bot, and it will periodically fetch and update the status of the Minecraft servers on your Discord server. (Default is 15 minutes)

📸 Example Images (Icon not included)

🖥️ Desktop (click)
🍎 iOS (click)
🤖 Android (click)

About

A bot that will ping the mcstatus.io API to retrieve Status, Version and Player Count. It then takes that information and uses it to create an Embed/Webhook that will be posted to a Discord Channel of your choice.

Resources

License

Stars

Watchers

Forks