Telegram bot for finding and displaying Minecraft crafting recipes. Automatically extracts recipe information from Minecraft Wiki and sends screenshots of crafting tables to users.
- Search crafting recipes by item name
- Support for English and Russian languages
- Automatic screenshot generation from Minecraft Wiki
- Caching for improved performance
- Handles various item name formats
- Java 17+ and Maven 3.6+ (for local build)
- OR Docker and Docker Compose (recommended)
- Telegram Bot Token from @BotFather
Docker setup includes Chrome and all dependencies, ensuring platform-independent deployment.
git clone https://github.com/allenvox/craftifyer-bot.git
cd craftifyer-botCreate .env file:
cp .env.example .env
# Edit .env and add your TELEGRAM_BOT_TOKENBuild and run:
docker compose up -dView logs:
docker compose logs -fStop:
docker compose downgit clone https://github.com/allenvox/craftifyer-bot.git
cd craftifyer-bot
mvn clean packageSet environment variable:
export TELEGRAM_BOT_TOKEN="your_bot_token_here"Run:
java -jar target/craftifyer-bot-1.0-SNAPSHOT.jarCommands:
/start- Start bot/help- Show help/craft <item name>- Get crafting recipe
Examples:
/craft iron trapdoor
/craft diamond sword
/craft факел
You can also send item name directly without /craft command.
src/main/kotlin/com/craftifyer/bot/
├── config/ # Configuration and constants
│ ├── BotConfig.kt
│ └── Messages.kt
├── handlers/ # Command handlers
│ └── CommandHandler.kt
├── services/ # Business logic
│ ├── RecipeService.kt # Main recipe service
│ ├── WikiScraper.kt # Web scraping with Selenium
│ └── CacheService.kt # Screenshot caching
├── utils/ # Utilities
│ ├── LanguageDetector.kt
│ └── ItemNameNormalizer.kt
└── Main.kt # Entry point
- User sends
/craft <item>or item name CommandHandler→RecipeService.getRecipeImageFile()RecipeServicechecksCacheServicefor cached screenshot- If not cached,
WikiScraper:- Detects language via
LanguageDetector - Generates name variants via
ItemNameNormalizer - Loads wiki page with Selenium
- Finds crafting recipe table
- Takes screenshot of the table element
- Detects language via
- Screenshot saved to cache via
CacheService CommandHandlersends screenshot to user via Telegram API
- RecipeService: Coordinates cache and scraper, handles recipe retrieval
- WikiScraper: Manages Selenium WebDriver, scrapes Minecraft Wiki pages
- CacheService: Two-level caching (memory + disk), auto-cleanup of old files
- CommandHandler: Processes Telegram commands and messages
- LanguageDetector: Detects Cyrillic characters for Russian language support
- ItemNameNormalizer: Normalizes item names, generates search variants
Settings in BotConfig.kt:
PAGE_LOAD_TIMEOUT_MS- Page load timeout (default: 3000ms)CACHE_TTL_DAYS- Cache TTL (default: 7 days)WIKI_BASE_URL_EN/WIKI_BASE_URL_RU- Wiki URLs