An intelligent auto-reply bot for League of Legends client that uses Google Gemini AI to generate natural responses to your friends' messages.
✅ Smart Friend Detection: Only replies to messages from friends, not your own messages
✅ Account Name Mapping: Shows friend names instead of conversation IDs
✅ AI-Powered Responses: Uses Google Gemini AI to generate natural, contextual replies
✅ Fast Response Time: 4-5 second cooldown between replies
✅ Conversation History: AI maintains context across multiple messages
✅ Fallback Mode: Works without AI with simple pre-set replies
- Python 3.8+
- League of Legends Client running
- Google Gemini API key (for AI features)
- Install dependencies:
pip install -r requirements.txt- Set up your Gemini API key:
# Windows
set GEMINI_API_KEY=your_api_key_here
# Linux/Mac
export GEMINI_API_KEY=your_api_key_hereOr enter it when prompted when running the bot.
- Go to Google AI Studio
- Sign in with your Google account
- Click "Create API Key"
- Copy your API key
- Start League of Legends client and log in
- Run the bot:
python main.py- The bot will:
- Connect to League Client
- Show your logged-in account
- Start monitoring messages
- Auto-reply to friends with AI-generated responses
In auto_reply.py, change:
COOLDOWN_SECONDS = 5 # Change to 4-10 seconds as neededIn ai_reply.py, edit the system_prompt to match your style:
self.system_prompt = """You are responding as a League of Legends player...
Your personality:
- Add your personality traits here
- Customize response style
- Add preferred phrases
"""If you don't provide an API key, the bot will use a simple reply:
reply = "Đang bận, 5 phút nữa chơi"You can change this in auto_reply.py in the on_message method.
- LCU Connection: Connects to League Client via WebSocket API
- Message Detection: Monitors incoming chat messages
- Friend Filtering: Checks if message is from a friend (not from you)
- Name Resolution: Maps conversation IDs to friend names
- AI Response: Generates contextual reply using Claude AI
- Send Reply: Sends message back through LCU API
Bot not starting:
- Make sure League Client is running
- Check if you have admin privileges (may be required)
No AI responses:
- Verify your API key is correct
- Check your internet connection
- Bot will fall back to simple replies if AI fails
Not replying to messages:
- Check cooldown settings (may need to wait 5 seconds)
- Verify message is from a friend, not from you
- Check console for error messages
main.py- Entry point, handles setupauto_reply.py- Main bot logic and message handlinglcu_auth.py- League Client authenticationlcu_chat.py- Chat API functionsai_reply.py- AI response generationrequirements.txt- Python dependencies
This bot uses the Google Gemini API. The free tier includes:
- 60 requests per minute
- Generous token limits
- Check Gemini API pricing for current rates
- Bot only reads/sends chat messages, doesn't interact with game
- All communication is local (League Client on your machine)
- API key is never shared or logged
- You can stop the bot anytime with Ctrl+C
MIT License - Feel free to modify and use as needed!