File size: 545 Bytes
5ef0f41
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from flask import Flask
import subprocess
import threading
import time

app = Flask(__name__)

def run_main_script():
    """Function to run the main.py script with the specified arguments."""
    subprocess.run(["nohup", "python3", "main.py", "-a", "2"])

@app.route('/')
def hello():
    return "XEmpire Bot is running!"

if __name__ == '__main__':
    # Start the main.py script in a separate thread
    threading.Thread(target=run_main_script, daemon=True).start()
    
    # Start the Flask web server
    app.run(host='0.0.0.0', port=7860)