Discord Bot for Minecraft Server
This project is a Discord bot designed for Minecraft communities. It allows displaying useful information, rules, IPs, links, and support to users through commands.
Main Features
- Commands
/guia,/reglas,/ip,/discord,/soporte,/tienda. - Responses with rich messages (embeds) and configurable data.
- Easy to extend and maintain thanks to its modular structure.
Project Structure
bot-template-mc/
├── src/
│ ├── commands/ # Individual bot commands
│ ├── config/ # Sensitive configuration (token, IPs, etc.)
│ └── index.js # Main bot file
├── package.json # Dependencies and scripts
├── .gitignore # Files to ignore in git
├── LICENSE # Project license
└── README.md # This fileInstallation and Configuration
1. Clone the repository
git clone https://github.com/FeliponsioDev/bot-template-mc
cd bot-template-mc2. Install dependencies
npm install3. Configure the bot
Copy the example configuration file and edit it:
cp src/config/config.json src/config/config.jsonEdit src/config/config.json and put your Discord bot token and your server data.
Note: Don't upload your
config.jsonto GitHub! It's already in the.gitignore.
4. Start the bot locally
node src/index.jsHow does the config.json file work?
The src/config/config.json file is fundamental for the bot's operation. All sensitive and configurable data is stored here, such as the bot token, server IPs, links, and Discord channel IDs.
If this file is not created, you can create a folder called config and create the config.json file.
Example of config.json:
{
"token": "HERE_YOUR_BOT_TOKEN",
"ip_java": "play.yourserver.com",
"ip_bedrock": "bedrock.yourserver.com",
"puerto_bedrock": 19132,
"discord_invite": "https://discord.gg/yourinvitecode",
"tienda_url": "https://store.yourserver.com",
"canal_ayuda": "HELP_CHANNEL_ID",
"canal_tickets": "TICKETS_CHANNEL_ID"
}Explanation of fields:
token: Your Discord bot token (never share it or upload it to GitHub!).ip_java: IP of your Minecraft Java server.ip_bedrock: IP of your Minecraft Bedrock server.puerto_bedrock: Port of your Bedrock server (default 19132).discord_invite: Invitation link to your Discord server.tienda_url: Link to your server's store (if you have one).canal_ayuda: ID of the Discord channel where users can ask for help.canal_tickets: ID of the Discord channel for creating support tickets.
This file allows the bot to be easily configurable and adaptable to any community without needing to modify the source code.
Cloud Deployment
Render.com
- Create an account at Render.
- Create a new "Web Service" service and connect your repository.
- In "Start Command" put:
node src/index.js - In "Environment" add a
NODE_VERSIONvariable (eg:18or the one you use). - Upload your
config.jsonmanually from the Render dashboard (don't upload it to git). - Ready! The bot will run automatically.
Vercel/Netlify
Important: Vercel and Netlify are designed for web apps (HTTP), not for Discord bots that require persistent processes. They are not recommended for bots, but you can use Railway or Render for bots.
If you still want to try:
- Use an adapter like vercel-node-server to keep the process alive (not recommended for production).
- Upload your code and configure the start command the same as in Render.
Adding New Commands
- Create a
.jsfile insrc/commands/following the format of existing ones. - The bot will load them automatically when starting.
License
This project is licensed under the MIT license. See the LICENSE file for more details.
💬 Support
Developed with 💙 by Revers Studio