View on GitHub:
github.com/sukhrobyangibaev/Dota-Data-Bot

Dota Data Bot is an open-source Telegram bot that brings Dota 2 statistics, live match updates, and predictive analytics directly to your chat. Built with Python and the python-telegram-bot library, it leverages the OpenDota API and machine learning models to provide rich, interactive insights for Dota 2 players, fans, and analysts.

Whether you want to check your recent matches, analyze pro player stats, track live games, or even predict match outcomes, Dota Data Bot makes it easy—all within Telegram.

Key Features

  • Player & Match Search: Instantly look up pro players, public matches, and detailed player stats.

img

  • Favourite Players: Add and manage your favourite Dota 2 players for quick access to their stats.

img

  • Live Match Tracking: Get real-time updates on ongoing matches and leagues, including team names, scores, and net worth leads.

img

  • Player Analytics: View win/loss ratios, recent matches, hero stats, peer stats, totals, leaver status, and wordclouds of chat activity.

img

  • Match Outcome Prediction: Uses pre-trained machine learning models to predict the likely winner of ongoing matches based on in-game features.

img

  • Rich Telegram Integration: Custom keyboards, inline buttons, and formatted messages for a seamless user experience.
  • Persistent Storage: All user data and preferences are stored in MongoDB for reliability and scalability.
  • Error Handling: Robust error reporting and developer notifications for smooth operation.

Technical Architecture

  • Backend: Written in Python, using python-telegram-bot for asynchronous Telegram API integration.
  • Database: Uses MongoDB to store users, chats, favourite players, and cached data.
  • Machine Learning: Integrates multiple pre-trained classifiers (Random Forest, Gradient Boosting, etc.) for match prediction.
  • Data Sources: Fetches live and historical data from the OpenDota API.
  • Plotting: Generates hero and peer statistics plots with matplotlib.
  • Conversation Flows: Multi-step guided conversations for searching, adding players, and navigating stats.
  • Environment Configuration: Uses dotenv for secure management of API keys and database URIs.

Example Workflow

  1. User starts the bot:
    The bot presents a main menu with options like searching matches, viewing player stats, and tracking live games.
  2. Player stats:
    Enter a Dota 2 account ID to view detailed stats, recent matches, hero performance, and more.
  3. Favourite players:
    Add your favourite players for one-tap access to their stats and match history.
  4. Live matches:
    Browse ongoing public and league matches, with real-time updates and analytics.
  5. Match prediction:
    Select a live league match to see predicted outcomes based on in-game data and ML models.

Technologies Used

  • Python 3
  • python-telegram-bot
  • MongoDB
  • AsyncIO
  • pymongo
  • gensim (for embeddings)
  • matplotlib
  • dotenv
  • scikit-learn (for model training, not included in repo)

This project demonstrates how Telegram bots can bring advanced analytics and real-time data to gaming communities, making Dota 2 stats and predictions accessible to everyone.