{"id":27354270,"url":"https://github.com/druzai/bot_mc_discord","last_synced_at":"2025-09-04T10:38:55.066Z","repository":{"id":38978527,"uuid":"273091259","full_name":"Druzai/Bot_Mc_discord","owner":"Druzai","description":"Discord bot to manage Minecraft server(s)","archived":false,"fork":false,"pushed_at":"2025-03-26T22:15:15.000Z","size":37017,"stargazers_count":3,"open_issues_count":8,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-12T21:53:46.725Z","etag":null,"topics":["discord-bot","minecraft-java-edition","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Druzai.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-17T22:33:56.000Z","updated_at":"2025-03-26T21:51:10.000Z","dependencies_parsed_at":"2025-01-14T12:44:51.961Z","dependency_job_id":"6576d856-b571-4d31-b8b4-bdb339b47ee4","html_url":"https://github.com/Druzai/Bot_Mc_discord","commit_stats":null,"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Druzai%2FBot_Mc_discord","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Druzai%2FBot_Mc_discord/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Druzai%2FBot_Mc_discord/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Druzai%2FBot_Mc_discord/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Druzai","download_url":"https://codeload.github.com/Druzai/Bot_Mc_discord/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248637822,"owners_count":21137538,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["discord-bot","minecraft-java-edition","python"],"created_at":"2025-04-12T21:53:56.847Z","updated_at":"2025-04-12T21:53:57.404Z","avatar_url":"https://github.com/Druzai.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n   \u003cimg src=\"images/bot.ico\" alt=\"bot icon\"\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003e\n   Bot for Minecraft Server in Discord\n\u003c/h1\u003e\n\n[![Build with pyinstaller](https://github.com/Druzai/Bot_Mc_discord/actions/workflows/bot_build.yml/badge.svg?branch=master)](https://github.com/Druzai/Bot_Mc_discord/actions/workflows/bot_build.yml)\n\n## Main features\n\n\u003e [!IMPORTANT]\n\u003e **This bot designed to work only on 1 Discord server!**\n\n* Managing Minecraft server via Discord bot:\n    * Start the server\n    * Stop the server\n    * Restart the server\n    * Get info about players on the server\n    * Work with server whitelist\n    * Secure authorization\n        * Has options to ban and unban IP-address regardless of whether secure authorization is enabled or not\n            * **But bot can't ban and unban IPv6 addresses using vanilla server!**\n              ([MC-97885](https://bugs.mojang.com/browse/MC-97885))\n        * **If bot sometimes can't register a logged in player, disable `enable_login_check` option in bot config!**\n    * Autoload if the Minecraft server crashes\n    * Auto stop if the Minecraft server online during certain period of time without players\n    * Auto backup at specified intervals and forced backup by member\n        * Auto deleting backup(s) if backup's limit or space exceeded\n        * Bot can handle backup of several world folders\n            * For example, these servers split world data to separate folders: `PaperMC`, `Bukkit` and `Spigot`\n        * **If there are files in backups directory that not in server config, they will be deleted only from server\n          config!**\n    * Make yourself an operator for limited amount of time if your Discord account has association with Minecraft nick\n        * **Bot can't do it when nick has spaces!** (vanilla server limitation)\n* Changing Minecraft servers on the go while server is down\n* Creating menus for quick bot and Minecraft server management\n    * Creating a server menu with buttons and a dropdown to quickly execute common commands\n    * Creating a bot menu with buttons and a dropdown to quickly toggle bot features\n* Setting an optional role in Discord. If set then the bot commands for managing the Minecraft server will require this\n  role from the member\n* Setting an optional admin role in Discord. If set then commands that interacts with Minecraft server commands will\n  execute if member has admin role. Otherwise, member must have `Administrator` permission.\n* Creating optional game chat between Discord text channel and Minecraft server via bot and webhook\n    * Supported mentions in Discord and Minecraft\n        * Also, for better recognition you can create list of associations between Discord member and Minecraft nick\n    * Supported edited messages from Discord and editing messages from Minecraft\n        * Message should start with single `*` or with `*` and space if edited message should start with `**`\n    * Supported Discord reply in message\n    * Supported url links (shortens via `tinyURL` or `clck.ru` if link longer than 256 symbols)\n    * Supported Markdown hyperlinks (e.g. `[link](http://example.com \"title\")`)\n    * Supported stickers in message\n    * Supported attached files to message in Discord\n    * Half supported emojis\n        * Custom emojis are converted to text with their own text name and hyperlink to img of emoji if applicable\n        * Minecraft players can send custom emojis typing `:emoji_name:` (finds first full match, then if nothing is\n          found bot will try to find case-insensitive name)\n        * Most of the standard unicode emojis are not processed by the vanilla Minecraft client\n    * Logging of death messages from Minecraft\n        * Supported custom avatar for death messages\n            * If you set custom avatar and getting standard avatar in webhook message then your image link is invalid!\n        * Supported custom name for death messages if you don't like a default one\n        * If the same death message is repeated in the Minecraft log, bot will group it and send it to Discord with the\n          modifier `(xN)`, where `N` is the number of these messages\n        * Works in versions `1.4.6` and higher\n            * From version `1.4.6` server started logging players' deaths\n            * From version `1.15.0` server started logging villagers' deaths\n            * From version `1.17.1` server started logging named mobs' deaths\n    * Showing low quality preview of an image in Minecraft chat (max - 160 pixels in width)\n        * Can fetch image from links, attachments, stickers and emojis in Discord message\n            * Shows emoji if there is only one emoji in the message\n        * Supported image opacity\n        * Works in versions `1.16.0` and higher\n    * Some features may not work in versions below `1.7.2`!\n* Setting up optional RSS feed. Bot will send new items from feed to Discord text channel via webhook\n* Setting up HTTP(S) proxy separately for different groups of requests\n    * Discord requests\n    * RSS feed check requests\n    * Other requests, such as:\n        * Checking links/images from channel associated with game chat feature\n        * Checking Minecraft snapshot version\n        * Getting shortened links\n\n**How bot converts mentions from Minecraft chat to Discord for game chat:**\n\n| Minecraft               | Discord                 |\n|-------------------------|-------------------------|\n| `@a`                    | `@Minecrafters`         |\n| `@all`                  | `@Minecrafters`         |\n| `@e`                    | `@everyone`             |\n| `@everyone`             | `@everyone`             |\n| `@p`                    | `@here`                 |\n| `@here`                 | `@here`                 |\n| `@AnyRoleOrUserMention` | `@AnyRoleOrUserMention` |\n\n`@Minecrafters` - an optional role in Discord for managing the Minecraft server. If not stated then bot will\nmention `@everyone`.\n\n\u003e [!WARNING]\n\u003e Mentions from Minecraft mustn't contain `@` in them!\n\n## Commands\n\nIf you want to see help on all bot's commands use `help` command when bot is running.\n\n\u003e [!NOTE]\n\u003e Some commands will require an optional role or/and an admin role if you set them in bot config.\n\n## Languages\n\nSupported 2 languages:\n\n* English\n* Russian\n\n## Requirements\n\n* [Python 3.11-3.13](https://www.python.org/downloads/) - only for developing or building an app locally\n* For Linux and macOS\n    * Required installed screen command ([Linux](https://linuxize.com/post/how-to-use-linux-screen/)\n      [macOS](https://brewinstall.org/install-screen-mac-osx/))\n* Minecraft server not lower than version `1.0.0` (vanilla or a modded one)\n    * Run server 1 or 2 times to accept EULA and generate `server.properties`\n    * Query and RCON protocols must be enabled on a server\n        * Bot can automatically enable `query` and `rcon` in `server.properties`\n\n\u003e [!TIP]\n\u003e You can enable config setting to automatically create `server.properties` and `eula.txt` filled with required\n\u003e properties and accepted EULA.\n\n### Required bot intents\n\n* Enable the `Server Members Intent`, the `Presence Intent` and the `Message Content Intent` in\n  section `Privileged Gateway Intents` on the Bot tab of your bot's page on\n  the [Discord developer's portal](https://discord.com/developers/applications).\n\n## Build\n\n### Lib installation\n\nType in command prompt: (you must have [requirements.txt](requirements.txt)\nand [requirements-build.txt](requirements-build.txt) in root folder of the project)\n\n```\npip install -r requirements.txt -r requirements-build.txt\n```\n\nFor macOS you have to update certificates by running script `/Applications/Python 3.XX/Install Certificates.command`\n\n### Build with pyinstaller\n\nIt builds an executable file with bundled Python interpreter.\n\nType in command prompt `make` in root directory of the project to build it.\n\nExecutable file will be in `%project_root_dir%/build_dist`.\n\n### Build with shiv\n\nIt builds an executable archive, but it requires Python to launch!\n\nType in command prompt `make build_pyz` in root directory of the project to build it.\n\nExecutable archive will be in `%project_root_dir%/build_dist`. You can launch it with a double click or via\nPython - `python Discord_bot.pyz`.\n\n## Run\n\n\u003e [!WARNING]\n\u003e **If you're running Minecraft server between versions `1.7.2` and `1.18.0` to avoid critical security\nvulnerability `Log4Shell` do instructions stated in\nthis [article](https://www.minecraft.net/en-us/article/important-message--security-vulnerability-java-edition)!**\n\u003e\n\u003e **Or check if your modded server already has a patch for it!**\n\nFor game chat to work properly with languages other than English, you have to have argument `-Dfile.encoding=UTF-8` when\nyou're executing `*.bat`, `*.cmd`, Windows shortcut, `*.sh` or `*.command` script.\n\n### Windows\n\nJust start bot executable file.\n\nFor the bot to properly start the Minecraft server you have to have `*.bat` or `*.cmd` script (in bot setting you can\nset name for this script) in your root Minecraft server directory! Example of file:\n\n```batch\n@echo off\nrem java_runtime - path to java executable or its alias, default is 'java' alias\nrem                If path has spaces, enclose the string in double quotes! For example: java_runtime=\"path to java runtime\"\nrem min_ram, max_ram - consists how many min and max GB you're allocating for server on start up\nrem your_jar_file - jar file that starts up your server. It can be for vanilla: standard server.jar or for modded server: spigot.jar, forge.jar and etc.\nrem java_parameters - parameters for Minecraft server\nset java_runtime=java\nset min_ram=1\nset max_ram=3\nset your_jar_file=server.jar\nset java_parameters=\nchcp 65001\ncls\ntitle Minecraft Server Console (%max_ram%Gb RAM)\n%java_runtime% -Xms%min_ram%G -Xmx%max_ram%G %java_parameters% -Dfile.encoding=UTF-8 -jar %your_jar_file% nogui\nexit /b\n```\n\nAlso, if you don't want the server console to pop up in front of other windows at startup, you'll need to create\nshortcut by doing these steps:\n\n- Create a shortcut to the `*.bat` or `*.cmd` file. To do so, right-click on the file, click `Create Shortcut`\n- Right-click on the shortcut and choose `Properties`\n- In the `Run`: drop down, choose `Minimized`\n- Click `OK`\n\nAfter creating shortcut you can specify it as start file for bot instead of script in config setup.\n\n### Linux\n\nOn the desktop version of Linux just start bot executable file.\n\nOn the server version of Linux you have to start bot executable file using terminal with screen command! Example:\n\n```\nscreen -dmS %your_session_name% %path_to_bot%/bot_executable_file\n```\n\nFor the bot to properly start the Minecraft server you have to have `*.sh` script (in bot setting you can set name for\nthis script) in your root Minecraft server directory! Example of file:\n\n```shell\n# java_runtime - path to java executable or its alias, default is 'java' alias\n# min_ram, max_ram - consists how many min and max GB you're allocating for server on start up\n# your_jar_file - jar file that starts up your server. It can be for vanilla: standard server.jar or for modded server: spigot.jar, forge.jar and etc.\n# java_parameters - parameters for Minecraft server\njava_runtime='java'\nmin_ram='1G'\nmax_ram='3G'\nyour_jar_file='server.jar'\njava_parameters=''\nexec ${java_runtime} -Xms${min_ram} -Xmx${max_ram} ${java_parameters} -Dfile.encoding=UTF-8 -jar ${your_jar_file} nogui\n```\n\nFor server process bot will start a virtual terminal session via `screen` command with name according to the selected\nserver's name. You can connect to it via `screen -r %selected_server_session_name%`. You can find server name in list\nof virtual sessions - `screen -ls`.\n\n### macOS\n\nOn macOS you should start bot executable file from terminal `%path_to_bot%/bot_executable_file`. Because if you just\ndouble-click on executable file, current working directory will be set as your home directory (`~`) and bot won't\nfind config and key in most cases.\n\nFor the bot to properly start the Minecraft server you have to have `*.command` or `*.sh` script (in bot setting you can\nset name for this script) in your root Minecraft server directory! Example of file can be seen above in [Linux](#linux)\nsection.\n\nFor server process bot will start a virtual terminal session via `screen` command with name according to the selected\nserver's name. You can connect to it via `screen -r %selected_server_session_name%`. You can find server name in list of\nvirtual sessions - `screen -ls`.\n\n## Localization\n\nFor adding or updating/fixing translations:\n\n* If you want to add translations, you need to generate `*.pot` file running\n  script [generate_pot.py](locales/generate_pot.py) (**without admin privilege!**) after you added translations\n  in `*.py` files. Otherwise, if you only want to fix translations, then skip this step.\n* Then you need to update existing `*.po` file yourself for required language or create new one in this\n  path: `%project_root_dir%/locales/%language_code%/LC_MESSAGES/lang.po`.\n* For translations to be updated you also need generate updated `*.mo` file running\n  script [generate_mo.py](locales/generate_mo.py).\n\nOn Linux or macOS you may need to install `gettext`:\n\n* Linux: `sudo apt install gettext`\n* macOS: `brew install gettext`\n\n## Tested platforms\n\n* Windows 10 21H2 or higher (64 bit)\n    * Support for Windows 7 was dropped. Last release built for Python 3.8\n      was [1.4.6](https://github.com/Druzai/Bot_Mc_discord/releases/tag/1.4.6).\n* Linux (Debian-based) (64 bit)\n* macOS 14 or higher (64 bit)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdruzai%2Fbot_mc_discord","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdruzai%2Fbot_mc_discord","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdruzai%2Fbot_mc_discord/lists"}