Kanhshsh commited on
Commit
69a921f
Β·
verified Β·
1 Parent(s): eceb86e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -23,7 +23,7 @@ def launch_bot():
23
  return "βœ… Bot launched successfully."
24
 
25
  def get_logs():
26
- return logs[-2000:] # Show last 2000 characters
27
 
28
  with gr.Blocks() as demo:
29
  gr.Markdown("# 🎬 TheMovieProviderBot Interface")
@@ -31,10 +31,12 @@ with gr.Blocks() as demo:
31
  gr.Markdown("[πŸ“¦ Click here to download bot files](static/setup.zip)")
32
 
33
  with gr.Row():
34
- gr.Button("Start Bot").click(launch_bot)
35
- gr.Button("πŸ” Refresh Logs")
36
 
37
  log_output = gr.Textbox(label="πŸ“„ Bot Logs", lines=20)
38
- demo.load(get_logs, None, log_output, every=3)
 
 
39
 
40
  demo.launch()
 
23
  return "βœ… Bot launched successfully."
24
 
25
  def get_logs():
26
+ return logs[-2000:]
27
 
28
  with gr.Blocks() as demo:
29
  gr.Markdown("# 🎬 TheMovieProviderBot Interface")
 
31
  gr.Markdown("[πŸ“¦ Click here to download bot files](static/setup.zip)")
32
 
33
  with gr.Row():
34
+ launch_btn = gr.Button("πŸš€ Start Bot")
35
+ refresh_btn = gr.Button("πŸ” Refresh Logs")
36
 
37
  log_output = gr.Textbox(label="πŸ“„ Bot Logs", lines=20)
38
+
39
+ launch_btn.click(fn=launch_bot, outputs=None)
40
+ refresh_btn.click(fn=get_logs, outputs=log_output)
41
 
42
  demo.launch()