A comprehensive Telegram bot that analyzes sports and eSports matches using advanced AI (OpenAI GPT-4 and Grok) to provide data-driven insights and predictions.
β Daily Match Collection
- Fetches matches from multiple sports (Football, Basketball, etc.)
- Includes eSports tournaments (League of Legends, CS:GO, Dota 2, Valorant)
- Real-time data from various sports APIs
β Dual AI Analysis
- OpenAI GPT-4 for comprehensive match analysis
- Grok AI for statistical deep-dives
- Combined insights for better accuracy
β Top 20 Safest Predictions
- Safety score algorithm (0-100)
- Confidence ratings from AI models
- Risk level classification (Low/Medium/High)
- Detailed statistics and reasoning
β Comprehensive Statistics
- Team form analysis
- Head-to-head records
- Historical performance data
- Probability calculations
- Node.js 18+ installed
- A Telegram Bot Token (get it from @BotFather)
- OpenAI API Key
- Grok API Key (from x.ai)
git clone https://github.com/yourusername/ReloBet.git
cd ReloBetnpm install- Copy the example environment file:
cp .env.example .env- Edit
.envand add your API keys:
# Get your Telegram Bot Token from @BotFather
TELEGRAM_BOT_TOKEN=your_telegram_bot_token_here
# Your OpenAI API Key
OPENAI_API_KEY=your_openai_api_key_here
# Your Grok API Key from x.ai
GROK_API_KEY=your_grok_api_key_here
# Optional: Sports API Keys for better data
FOOTBALL_API_KEY=your_api_key_here
ESPORTS_API_KEY=your_api_key_here
# Bot Configuration
MAX_PREDICTIONS=20
UPDATE_INTERVAL_HOURS=6- Open Telegram and search for @BotFather
- Send
/newbotcommand - Follow the instructions to create your bot
- Copy the bot token provided
- Go to OpenAI Platform
- Sign up or log in
- Navigate to API Keys section
- Create a new API key
- Copy the key (it starts with
sk-)
- Go to x.ai
- Sign up for API access
- Generate an API key
- Copy the key (it starts with
xai-)
npm startOr for development with auto-reload:
npm run devYou should see:
π€ ReloBet Telegram Bot is running...
π Predictions will auto-update every 6 hours.
Once the bot is running, open Telegram and find your bot:
/start- Start the bot and see welcome message/help- Show available commands/predictions- Get the top 20 safest predictions/refresh- Force refresh predictions (may take a few minutes)/about- Learn more about the bot
The bot fetches daily matches from:
- Sports APIs: Football, Basketball, Tennis, etc.
- eSports APIs: League of Legends, CS:GO, Dota 2, Valorant tournaments
- Mock Data: Fallback data for testing and when APIs are unavailable
Each match is analyzed by two AI systems:
OpenAI GPT-4:
- Win probability calculations
- Tactical analysis
- Key factors identification
- Risk assessment
Grok AI:
- Statistical edge detection
- Historical performance metrics
- Form analysis
- Value rating
The prediction engine combines both AI analyses and calculates:
- Safety Score (0-100): Based on confidence, probability margin, risk level, and data quality
- Win Probabilities: Home/Draw/Away percentages
- Estimated Odds: Fair odds based on probabilities
- Expected Value: Statistical advantage metric
- Risk Level: Low, Medium, or High classification
Predictions are sorted by safety score and the top 20 are selected and displayed with:
- Match details
- Safety score and risk level
- Probabilities and odds
- Key factors
- Detailed statistics
- AI reasoning
ReloBet/
βββ src/
β βββ config/
β β βββ config.js # Configuration management
β βββ services/
β β βββ sportsDataService.js # Sports data collection
β β βββ aiAnalysisService.js # AI analysis (OpenAI & Grok)
β β βββ predictionEngine.js # Prediction generation
β βββ utils/
β β βββ formatter.js # Message formatting utilities
β βββ index.js # Main bot file
βββ .env # Environment variables (not in git)
βββ .env.example # Environment variables template
βββ .gitignore # Git ignore file
βββ package.json # Node.js dependencies
βββ README.md # This file
You can customize the bot behavior in .env:
# Number of predictions to show (default: 20)
MAX_PREDICTIONS=20
# How often to auto-update predictions in hours (default: 6)
UPDATE_INTERVAL_HOURS=6To improve data quality, you can add your own API keys:
- Get a free API key from football-data.org
- Add to
.env:FOOTBALL_API_KEY=your_key_here
- Get a free tier from PandaScore
- Add to
.env:ESPORTS_API_KEY=your_key_here
- Check that your
TELEGRAM_BOT_TOKENis correct - Ensure the bot is running (
npm start) - Check the console for error messages
- Verify your OpenAI and Grok API keys are valid
- Check API key quotas/limits
- Try using
/refreshcommand
- The bot implements automatic retry logic
- Consider upgrading API plans if you hit limits frequently
- Adjust
UPDATE_INTERVAL_HOURSto reduce API calls
- Run
npm installto ensure all dependencies are installed - Check that you're using Node.js 18 or higher
npm run devThis uses Node's --watch flag to auto-restart on file changes.
The bot automatically falls back to mock data when real APIs are unavailable. This is useful for:
- Testing the bot without API keys
- Development without hitting API limits
- Demonstrating the bot's functionality
- Never commit your
.envfile - It contains sensitive API keys - Rotate API keys regularly for security
- Use environment variables for all sensitive data
- Monitor API usage to prevent unauthorized access
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This bot is provided for informational and educational purposes ONLY.
- We do NOT encourage, promote, or facilitate betting activities
- All predictions are statistical analysis and should NOT be considered betting advice
- Users are responsible for complying with local gambling laws
- Past performance does not guarantee future results
- The developers are not liable for any financial losses
Please gamble responsibly. If you or someone you know has a gambling problem, seek help:
- National Council on Problem Gambling: 1-800-522-4700
- gamblingtherapy.org
MIT License - see LICENSE file for details
For issues, questions, or suggestions:
- Open an issue on GitHub
- Contact: [your-email@example.com]
- Built with node-telegram-bot-api
- Powered by OpenAI and Grok
- Sports data from various public APIs
Made with β€οΈ for sports enthusiasts and data lovers
Remember: This is analysis, not advice. Always do your own research!