Spaces:
Paused
Paused
| 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", "bot.py"]) | |
| def hello(): | |
| return "Interlink Network 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) |