This Telegram Bot acts as an assistant who recommends video games to you, based on your Steam library.
- Connect Your Steam Account: Simply provide your public Steam profile URL to get started.
- Fetch and Cache Library: Retrieves your entire game library, including playtime, and caches game details to speed up future requests.
- AI-Powered Suggestions: The bot has an option for chatting with AI, where it can give suggestions both based on owned and unowned games. It can understand more complex filters than the ones integrated into the "Categories" section and give more accurate recommendations (based on preference description).
- Filters and options:
- Find unplayed games (less than 1 hour playtime)
- Find short games: games where progress can be saved at any time
- Randomly pick a game from the library
- Smart Analysis: provide insight into the user's playing trends
- AI Chat: use natural language to discuss about games and preferences
- Categories: multi/single filtering options for game genres/categories/tags
- Shooter
- RPG
- Strategy
- Story Rich
- Co-Op
- Horror
- Chill/Relaxing
- Action
- Open World
- Comedy
- Sci-Fi
- Fantasy
- Interactive UI: A clean, menu-driven interface using Telegram's inline keyboards.
- Profile Management: Easily switch between different Steam profiles.
- Bot Framework: The bot is built using the
python-telegram-botlibrary, managing user states and interactions through aConversationHandler. - Steam Integration: The
steam.pymodule handles all communication with the Steam Web API. It resolves vanity URLs, fetches owned games, and retrieves detailed game information like genres and categories. - AI Enrichment:
gemini_chat.pyintegrates with the Google Gemini API. It takes the user's library, sends it to the AI for analysis. This process runs asynchronously to avoid blocking the bot. - Recommender Logic: The
recommender.pymodule contains the various filter functions used to suggest games.
-
Clone the Repository
git clone <your-repository-url> cd steam_games
-
Install Dependencies It's recommended to use a virtual environment.
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
Create a
requirements.txtfile with the following content:python-telegram-bot requests google-generativeai
Then install the packages:
pip install -r requirements.txt
-
Configure API Keys Create a file named
API_keys.pyin the root directory and add your keys:# Get from BotFather on Telegram TELEGRAM_TOKEN = "YOUR_TELEGRAM_BOT_TOKEN" # Get from https://steamcommunity.com/dev/apikey STEAM_API_KEY = "YOUR_STEAM_WEB_API_KEY" # Get from https://aistudio.google.com/app/apikey GEMINI_API_KEY = "YOUR_GEMINI_API_KEY"
-
Run the Bot Execute the
bot.pyscript to start the bot.python bot.py
-
Extra For development:
- Add
API_keys.pyto your.gitignorefile to keep your keys private. - The bot saves
game_cache.jsonandgemini_history.jsonfiles locally. It is recommended to also add those to.gitignore
- Add
- Find your bot on Telegram and send the
/startcommand. - The bot will ask for your Steam Profile URL. Send a valid, public profile URL.
- The bot will fetch your library, and the AI will perform its analysis.
- Once loaded, you can use the inline keyboard buttons to explore your library, get recommendations, and view analysis.