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)