Giter Club home page Giter Club logo

minecraft-player-count-js's Introduction

Discord Minecraft Bot

This is a Discord bot built using the discord.js library. The bot retrieves the player count of a Minecraft server and displays it as its activity status in a Discord server.

Features

  • Automatically updates the player count every minute
  • Displays the player count as the bot's activity status
  • Handles server offline scenarios gracefully

Technologies Used

  • Discord.js - A powerful JavaScript library for interacting with the Discord API.
  • replit.com - Used for hosting the bot and ensuring it stays online.
  • cron-job.org - Used for scheduling regular updates and keeping the bot online 24/7. Be sure to copy the Replit URL to the cron job.

Setup

  1. Clone the repository:
  2. Install the required dependencies:
  3. Set up the environment variable:
  • Create a file named .env in the project root directory.

  • Add the following line to the .env file, replacing <discord_token> with your Discord bot token:

    DISCORD_TOKEN=<discord_token>
    
  1. Update the apiURL variable in the index.js file with the URL of your Minecraft server API.
  2. Run the bot:
  3. The bot will log in to Discord and display the initial status. It will then update the status every minute based on the number of players online. You can now invite the bot to your Discord server and it will automatically monitor and display the Minecraft server status.

Note: Ensure that you have Node.js and npm installed on your system before running the bot. Feel free to customize the bot's activity and appearance by modifying the code as needed.

minecraft-player-count-js's People

Contributors

kasumabalidps avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.