├── requirements.txt ├── LICENSE ├── 1XBetCrashUpdater.py ├── Dockerfile ├── 1XBetCrash.csv ├── .github └── workflows │ └── python-package.yml ├── Crash.py └── README.md /requirements.txt: -------------------------------------------------------------------------------- 1 | pandas==2.2.2 2 | scikit-learn==1.5.0 3 | telebot==0.0.5 4 | selenium==4.21.0 5 | webdriver-manager==4.0.1 -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | # MIT License 2 | 3 | ## Copyright (c) [2023] [Sheekovic] 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /1XBetCrashUpdater.py: -------------------------------------------------------------------------------- 1 | import time 2 | from selenium import webdriver 3 | from selenium.webdriver.common.by import By 4 | from selenium.webdriver.chrome.options import Options 5 | from selenium.webdriver.chrome.service import Service 6 | from webdriver_manager.chrome import ChromeDriverManager 7 | 8 | # Define the URL of the website 9 | url = "https://1xbet.com/en/allgamesentrance/crash" 10 | chrome_options = Options() 11 | chrome_options.add_argument('--headless') 12 | chrome_options.add_argument('--no-sandbox') 13 | chrome_options.add_argument('--disable-dev-shm-usage') 14 | 15 | 16 | driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=chrome_options) 17 | 18 | while True: 19 | try: 20 | # Navigate to the website 21 | driver.get(url) 22 | multiplier_element = driver.find_element(By.CSS_SELECTOR,'.c-events-table__multiplier') 23 | 24 | while not multiplier_element.is_displayed(): 25 | time.sleep(0.1) 26 | 27 | # Get the multiplier value 28 | multiplier = float(multiplier_element.text[1:]) 29 | print(f"Multiplier: {multiplier}") 30 | 31 | except Exception as e: 32 | print(f"Error: {e}") 33 | time.sleep(1) 34 | driver.quit() 35 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.12.1 2 | 3 | WORKDIR /app 4 | COPY . /app 5 | 6 | # Install Python dependencies 7 | RUN pip install -r requirements.txt 8 | 9 | # Install necessary packages and dependencies for Chrome, ChromeDriver, and Xvfb 10 | RUN apt-get update && \ 11 | apt-get install -y wget unzip xvfb libxi6 libgconf-2-4 libnss3 libxss1 libasound2 libgbm-dev && \ 12 | wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \ 13 | echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list && \ 14 | apt-get update && \ 15 | apt-get install -y google-chrome-stable && \ 16 | rm -rf /var/lib/apt/lists/* && \ 17 | apt-get clean && \ 18 | wget https://chromedriver.storage.googleapis.com/LATEST_RELEASE -O /tmp/chromedriver_latest && \ 19 | CHROMEDRIVER_VERSION=$(cat /tmp/chromedriver_latest) && \ 20 | wget https://chromedriver.storage.googleapis.com/${CHROMEDRIVER_VERSION}/chromedriver_linux64.zip -P /tmp && \ 21 | unzip /tmp/chromedriver_linux64.zip -d /usr/local/bin && \ 22 | rm /tmp/chromedriver_linux64.zip /tmp/chromedriver_latest 23 | 24 | # Start Xvfb and run the script 25 | CMD ["bash", "-c", "Xvfb :99 -screen 0 1024x768x16 & export DISPLAY=:99 && python 1XBetCrashUpdater.py"] 26 | -------------------------------------------------------------------------------- /1XBetCrash.csv: -------------------------------------------------------------------------------- 1 | Time,Number of players,Total bets,Multiplier 2 | 12:31,4860,285149.22,19.47 3 | 12:32,5485,347475.08,8.5 4 | 12:32,4889,279895.61,16.85 5 | 12:33,4722,264369.12,7.92 6 | 12:33,4631,261669.26,2.19 7 | 12:34,3821,219453.32,2.7 8 | 12:34,4496,270534.03,3.01 9 | 12:34,4770,301274.78,3.87 10 | 12:35,5089,299381.68,1.96 11 | 12:35,4403,240094.04,2.17 12 | 12:36,3925,190591.12,2.37 13 | 12:36,5239,190591.12,1 14 | 1:26,8196,223971,5.21 15 | 1:27,9383,222971,1.60 16 | 1:27,8675,2206530,2.76 17 | 1:28,9000,2206358.21,1.72 18 | 1:28,8771,2350131.48,2.50 19 | 4:08,5184,357567.09,1.17 20 | 4:09,5318,396546.91,24.11 21 | 4:10,6411,396561.83,29.02 22 | 4:10,5603,333743.85,3.62 23 | 4:11,4931,259121.34,1.21 24 | 4:11,3674,261000,1.5 25 | 4:11,4387,270558,1.28 26 | 4:12,4845,303408.57,9.25 27 | 4:12,6602,347718.52,8.51 28 | 4:13,6071,318053,1.22 29 | 4:13,4313,235103,6.68 30 | 4:13,6317,309663,1.38 31 | 4:14,5565,313130,5.29 32 | 4:14,6243,292935,2.5 33 | 4:15,6030,306941.68,23.38 34 | 4:15,6523,340012.87,1.89 35 | 4:16,5666,312296,1.04 36 | 4:16,5666,312296,1.02 37 | 4:16,5475,345128.82,1.29 38 | 4:16,5963,386395,1.9 39 | 4:17,6939,422143,3.87 40 | 4:17,7503,415809.22,6.1 41 | 4:18,7298,368386.97,1.81 42 | 4:18,6207,337980,1.11 43 | 4:18,5464,317772,1.15 44 | 4:19,6092,335788.3,5.42 45 | 4:19,7580,3964088,1.49 46 | 4:19,6759,416790,1.07 47 | 4:20,6284,386665,1.23 48 | 4:20,6148,361375,1.33 49 | 4:20,6282,392739.77,1.52 -------------------------------------------------------------------------------- /.github/workflows/python-package.yml: -------------------------------------------------------------------------------- 1 | # This workflow installs Python dependencies, runs tests, and lints with various Python versions 2 | # For more information, see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python 3 | 4 | name: Python package 5 | 6 | on: 7 | push: 8 | branches: [ "master" ] 9 | pull_request: 10 | branches: [ "master" ] 11 | 12 | jobs: 13 | build: 14 | 15 | runs-on: ubuntu-latest 16 | strategy: 17 | fail-fast: false 18 | matrix: 19 | python-version: ["3.8", "3.9", "3.10"] 20 | 21 | steps: 22 | - name: Checkout code 23 | uses: actions/checkout@v3 24 | 25 | - name: Set up Python ${{ matrix.python-version }} 26 | uses: actions/setup-python@v3 27 | with: 28 | python-version: ${{ matrix.python-version }} 29 | 30 | - name: Install dependencies 31 | run: | 32 | python -m pip install --upgrade pip 33 | pip install flake8 pytest 34 | if [ -f requirements.txt ]; then pip install -r requirements.txt; fi 35 | 36 | - name: Lint with flake8 37 | run: | 38 | # Stop the build if there are Python syntax errors or undefined names 39 | flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics 40 | # Exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide 41 | flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics 42 | 43 | - name: Test with pytest 44 | run: | 45 | pytest 46 | -------------------------------------------------------------------------------- /Crash.py: -------------------------------------------------------------------------------- 1 | import pandas as pd 2 | from sklearn.preprocessing import StandardScaler 3 | from sklearn.linear_model import LinearRegression 4 | from sklearn.tree import DecisionTreeRegressor 5 | from sklearn.ensemble import RandomForestRegressor 6 | from sklearn.neural_network import MLPRegressor 7 | from sklearn.model_selection import train_test_split 8 | import telebot 9 | from telebot.types import Message 10 | 11 | # Load the data into a Pandas DataFrame 12 | df = pd.read_csv('1XBetCrash.csv') 13 | 14 | # Extract the 'Multiplier' column from the DataFrame 15 | y = df['Multiplier'] 16 | 17 | # Drop the 'Time' and 'Multiplier' columns from the DataFrame 18 | X = df.drop(columns=['Time', 'Multiplier']) 19 | 20 | # Normalize the data using StandardScaler 21 | scaler = StandardScaler() 22 | X = scaler.fit_transform(X) 23 | 24 | # Split the data into training and test sets 25 | train_X, test_X, train_y, test_y = train_test_split(X, y, test_size=0.3, random_state=123) 26 | 27 | # Train multiple models 28 | linear_reg = LinearRegression() 29 | linear_reg.fit(train_X, train_y) 30 | 31 | tree_reg = DecisionTreeRegressor(random_state=123) 32 | tree_reg.fit(train_X, train_y) 33 | 34 | forest_reg = RandomForestRegressor(n_estimators=100, random_state=123) 35 | forest_reg.fit(train_X, train_y) 36 | 37 | nn_reg = MLPRegressor(hidden_layer_sizes=(100,), max_iter=1000, random_state=123) 38 | nn_reg.fit(train_X, train_y) 39 | 40 | # Create a Telegram bot object 41 | bot = telebot.TeleBot('YOUR_TOKEN') 42 | 43 | # Define the handler function for the '/predict' command 44 | @bot.message_handler(commands=['predict']) 45 | def handle_predict(message: Message): 46 | # Get the chat ID of the user who sent the message 47 | chat_id = message.chat.id 48 | 49 | # Use the trained models to predict the next 10 values of the multiplier 50 | for model in [linear_reg, tree_reg, forest_reg, nn_reg]: 51 | predictions = [] 52 | for i in range(1, 11): 53 | next_X = X[-i].reshape(1, -1) 54 | next_y = model.predict(next_X)[0] 55 | predictions.append("Prediction {}: {}".format(i, next_y)) 56 | 57 | # Send a separate message for each model's predictions 58 | bot.send_message(chat_id=chat_id, text="Based on Model: {}".format(model.__class__.__name__)) 59 | bot.send_message(chat_id=chat_id, text='\n'.join(predictions)) 60 | 61 | # Start the bot 62 | bot.polling() -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 🚀🚀 1XBetCrash Prediction Bot 2 | 3 | This is a Telegram bot that predicts the next 10 values of the 'Multiplier' column in the `1XBetCrash.csv` dataset using multiple regression models. 4 | 5 | ## 📋 Table of Contents 6 | 7 | - [Installation](#installation) 8 | - [Usage](#run) 9 | - [Contributing](#contributing) 10 | - [License](#license) 11 | 12 | ## Installation 13 | 14 | ### ✅Step 1: Set Up Docker and Remote WSL 15 | 16 | To run this project, you will use Docker and Remote WSL. Follow these steps to set up your environment: 17 | 18 | 1. ✅ **Install Docker**: 19 | - Download and install Docker Desktop from [Docker's official website](https://www.docker.com/products/docker-desktop). 20 | - Ensure Docker is running. 21 | 22 | 2.✅ **Enable WSL 2**: 23 | 24 | - Follow the instructions on [Microsoft's official documentation](https://docs.microsoft.com/en-us/windows/wsl/install) to enable WSL 2. 25 | - Install a WSL 2 Linux distribution (e.g., Ubuntu) from the Microsoft Store. 26 | 27 | 3.✅ **Configure Docker to Use WSL 2**: 28 | 29 | - Open Docker Desktop and go to Settings. 30 | - Under the General tab, enable "Use the WSL 2 based engine". 31 | - Go to the Resources tab, then WSL Integration, and enable integration with your installed Linux distribution. 32 | 33 | 4.✅ **Install VS Code and Remote WSL Extension**: 34 | 35 | - Download and install Visual Studio Code from [Microsoft's official website](https://code.visualstudio.com/). 36 | - Install the "Remote - WSL" extension from the VS Code marketplace. 37 | 38 | ### ✅ Step 2: Install Python in WSL 39 | 40 | Open your WSL terminal and run the following commands to install Python and the necessary libraries: 41 | 42 | 1.✅ **Update package list**: 43 | 44 | 45 | sudo apt-get update 46 | 47 | 48 | 2.✅ **Install Python 3.6 and pip**: 49 | 50 | 51 | 52 | sudo apt-get install python3-pip 53 | pip3 install --upgrade pip 54 | 55 | 56 | 57 | 58 | 3.✅ **Install required libraries**: 59 | 60 | 61 | pip install pandas scikit-learn telebot 62 | 63 | 64 | ### ✅ Step 3: Clone the Repository 65 | 66 | If you haven't already, clone your project repository: 67 | 68 | 69 | git clone https://github.com/aa-sikkkk/FortuneTeller.git 70 | 71 | 72 | ### ✅ Step 4: Create and Configure the Telegram Bot 73 | 74 | 1.Open Telegram and search for @BotFather. 75 | 2.Start a chat with @BotFather and use the /start command. 76 | 3.Use the /newbot command to create a new bot. 77 | 4.Follow the prompts to set the bot's name and username. 78 | 5.Once created, @BotFather will provide you with an API token. Save this token. 79 | 80 | Update the ```1XBetCrashUpdater.py``` to extract the multiplier values from the Crash Game ``` 81 | 82 | ## RUN 83 | 84 | ### ✅ Step 5: Run the ```Crash.py``` file 85 | 86 | Once ```the Crash.py``` script is running, you can send it the /predict command to your bot to get the predictions for the next 10 values of the 'Multiplier' column. 87 | 88 | ![Screenshot (23)](https://github.com/aa-sikkkk/FortuneTeller/assets/152005759/e62b1650-6379-4814-80c0-b35b875fe824) 89 | 90 | 91 | ## Contributing 92 | 93 | Contributions are always welcome! If you would like to contribute to this project, you can enhance the 1XBetCrashUpdater.py file to automatically update the ```1XBetCrash.csv file.``` This will help improve the accuracy of the models that rely on the 'Multiplier' column. 94 | 95 | ### ℹ️ℹ️ Steps to Contribute 96 | 97 | - Fork the repository. 98 | - Clone the forked repository to your local machine. 99 | - Modify the ```1XBetCrashUpdater.py``` file to update the ```1XBetCrash.csv``` file. 100 | - Test your modifications to ensure they work as expected. 101 | - Commit your changes and push them to your forked repository. 102 | - Submit a pull request to have your changes reviewed and merged into the main repository. 103 | 104 | Thank you for your contributions! 105 | 106 | ## License 107 | 108 | This project is licensed under the MIT License - see the [License](https://github.com/aa-sikkkk/FortuneTeller/blob/master/LICENSE) file for details. 109 | --------------------------------------------------------------------------------