Spaces:
Running
Running
import gradio as gr | |
import subprocess | |
import threading | |
# Run the bot in background | |
def run_bot(): | |
subprocess.Popen(["python3", "bot/main.py"]) | |
threading.Thread(target=run_bot, daemon=True).start() | |
def launch_bot(): | |
return "The Movie Provider Bot is running in the background. Interact via Telegram." | |
with gr.Blocks() as demo: | |
gr.Markdown("# π¬ TheMovieProviderBot Interface") | |
gr.Markdown("Interact with the bot on Telegram.") | |
gr.Button("Start Bot").click(launch_bot) | |
demo.launch() | |