Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,12 @@
|
|
| 1 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
def launch_bot():
|
| 4 |
return "The Movie Provider Bot is running in the background. Interact via Telegram."
|
|
@@ -6,7 +14,6 @@ def launch_bot():
|
|
| 6 |
with gr.Blocks() as demo:
|
| 7 |
gr.Markdown("# 🎬 TheMovieProviderBot Interface")
|
| 8 |
gr.Markdown("Interact with the bot on Telegram.")
|
| 9 |
-
gr.File(label="📦 Download Bot Files", value="static/setup.zip")
|
| 10 |
gr.Button("Start Bot").click(launch_bot)
|
| 11 |
|
| 12 |
demo.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
import subprocess
|
| 3 |
+
import threading
|
| 4 |
+
|
| 5 |
+
# Run the bot in background
|
| 6 |
+
def run_bot():
|
| 7 |
+
subprocess.Popen(["python3", "bot/main.py"])
|
| 8 |
+
|
| 9 |
+
threading.Thread(target=run_bot, daemon=True).start()
|
| 10 |
|
| 11 |
def launch_bot():
|
| 12 |
return "The Movie Provider Bot is running in the background. Interact via Telegram."
|
|
|
|
| 14 |
with gr.Blocks() as demo:
|
| 15 |
gr.Markdown("# 🎬 TheMovieProviderBot Interface")
|
| 16 |
gr.Markdown("Interact with the bot on Telegram.")
|
|
|
|
| 17 |
gr.Button("Start Bot").click(launch_bot)
|
| 18 |
|
| 19 |
demo.launch()
|