This project combines a Discord bot and a Minecraft AI bot, both enhanced with reinforcement learning (RL) capabilities. The bots can learn from their environment and user interactions, allowing for adaptive behavior in both chat and game contexts.
The Discord bot can respond to user messages, while the Minecraft bot can interact with the Minecraft world and learn from gameplay experiences. This dual functionality creates an innovative system where the bots can improve their interactions over time.
-
Discord Bot:
- Responds to user messages with contextually appropriate replies.
- Logs conversations for future learning.
- Admin command to display learning data.
-
Minecraft Bot:
- Connects to a Minecraft server and interacts with the environment.
- Learns from chat interactions and gameplay experiences using reinforcement learning techniques.
- Can perform actions based on learned behaviors.
- Python: For the Discord bot and reinforcement learning model.
- Node.js: For the Minecraft bot using Mineflayer.
- PyTorch: For building and training the reinforcement learning model.
- Discord.py: A Python wrapper for the Discord API.
- Mineflayer: A Minecraft bot framework for Node.js.
- JSON: For shared memory storage.
- Python 3.x: Make sure you have Python installed. You can download it from python.org.
- Node.js: Ensure Node.js is installed. Download it from nodejs.org.
- pip: Python package installer, usually included with Python installations.
-
Clone the Repository:
git clone https://github.com/shaktibiplabDev/minedibot.git cd minedibot -
Install Python Dependencies: Navigate to the Discord bot directory and install the required libraries:
pip install -r requirements.txt
-
Install Node.js Dependencies: Navigate to the Minecraft bot directory and install Mineflayer:
npm install mineflayer
-
Configure Your Tokens:
- Open
discord_bot/main.pyand replaceYOUR_DISCORD_TOKENwith your actual Discord bot token. You can create a bot and get a token from the Discord Developer Portal.
- Open
-
Initialize Shared Memory: The
shared_memory.jsonfile will be automatically created when you run the bot for the first time. -
Run the Bots:
- Start the Discord bot:
python discord_bot/main.py
- Start the Minecraft bot:
node minecraft_bot/bot.js
- Start the Discord bot:
-
Discord Bot Commands:
- Use the command
!talk <message>to interact with the bot. For example:!talk Hello, how are you? - Admin command
!learning_datato view the learning data stored by the bot (requires admin permissions).
- Use the command
-
Minecraft Bot:
- Once the Minecraft bot is running, it will automatically connect to the specified Minecraft server. It will learn from its environment and chat messages, executing actions based on its learning.
Contributions are welcome! If you'd like to contribute, please follow these guidelines:
- Fork the Repository: Create a personal copy of the repository.
- Make Changes: Implement your changes in a new branch.
- Submit a Pull Request: Open a pull request with a description of your changes.
- Ensure code is well-commented for clarity.
- Follow the project's coding standards.
- Test your changes thoroughly before submitting.
This project is licensed under the MIT License. See the LICENSE file for details.
- Thanks to the contributors and the community for their support.
- Special thanks to the maintainers of the libraries used in this project, including Discord.py, Mineflayer, and PyTorch.
For questions or suggestions, feel free to reach out to me through GitHub.