Skip to content

Sugusdaddy/ReloBet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

34 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ReloBet - Telegram Sports Analysis Bot

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.

⚠️ DISCLAIMER: This bot provides informational and educational content ONLY. It does NOT encourage or promote betting activities. All predictions are based on statistical analysis and should not be considered as betting advice.

Features

βœ… 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

Installation

Prerequisites

  • Node.js 18+ installed
  • A Telegram Bot Token (get it from @BotFather)
  • OpenAI API Key
  • Grok API Key (from x.ai)

Step 1: Clone the Repository

git clone https://github.com/yourusername/ReloBet.git
cd ReloBet

Step 2: Install Dependencies

npm install

Step 3: Configure Environment Variables

  1. Copy the example environment file:
cp .env.example .env
  1. Edit .env and 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

Step 4: Get Your API Keys

Telegram Bot Token

  1. Open Telegram and search for @BotFather
  2. Send /newbot command
  3. Follow the instructions to create your bot
  4. Copy the bot token provided

OpenAI API Key

  1. Go to OpenAI Platform
  2. Sign up or log in
  3. Navigate to API Keys section
  4. Create a new API key
  5. Copy the key (it starts with sk-)

Grok API Key

  1. Go to x.ai
  2. Sign up for API access
  3. Generate an API key
  4. Copy the key (it starts with xai-)

Usage

Start the Bot

npm start

Or for development with auto-reload:

npm run dev

You should see:

πŸ€– ReloBet Telegram Bot is running...
πŸ“Š Predictions will auto-update every 6 hours.

Telegram Commands

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

How It Works

1. Data Collection

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

2. AI Analysis

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

3. Prediction Engine

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

4. Top 20 Selection

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

Project Structure

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

Configuration

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=6

Adding Your Own Sports APIs

To improve data quality, you can add your own API keys:

Football Data

  1. Get a free API key from football-data.org
  2. Add to .env: FOOTBALL_API_KEY=your_key_here

eSports Data

  1. Get a free tier from PandaScore
  2. Add to .env: ESPORTS_API_KEY=your_key_here

Troubleshooting

Bot not responding

  • Check that your TELEGRAM_BOT_TOKEN is correct
  • Ensure the bot is running (npm start)
  • Check the console for error messages

No predictions generated

  • Verify your OpenAI and Grok API keys are valid
  • Check API key quotas/limits
  • Try using /refresh command

API Rate Limits

  • The bot implements automatic retry logic
  • Consider upgrading API plans if you hit limits frequently
  • Adjust UPDATE_INTERVAL_HOURS to reduce API calls

Module not found errors

  • Run npm install to ensure all dependencies are installed
  • Check that you're using Node.js 18 or higher

Development

Running in Development Mode

npm run dev

This uses Node's --watch flag to auto-restart on file changes.

Testing with Mock Data

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

Security

  • Never commit your .env file - 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

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

Legal & Disclaimer

⚠️ IMPORTANT LEGAL NOTICE

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:

License

MIT License - see LICENSE file for details

Support

For issues, questions, or suggestions:

Credits


Made with ❀️ for sports enthusiasts and data lovers

Remember: This is analysis, not advice. Always do your own research!

About

Decentralized prediction market platform

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors