Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,8 +8,6 @@ import gradio as gr
|
|
| 8 |
from discord.ext import commands
|
| 9 |
from gradio_client import Client
|
| 10 |
|
| 11 |
-
import logging
|
| 12 |
-
|
| 13 |
bot_ready = asyncio.Event()
|
| 14 |
DISCORD_BOT_TOKEN = os.environ.get("DISCORD_BOT_TOKEN")
|
| 15 |
if DISCORD_BOT_TOKEN is None:
|
|
@@ -83,7 +81,7 @@ async def on_button_click(interaction):
|
|
| 83 |
|
| 84 |
async def try_chaincraft_design(ctx, prompt, private):
|
| 85 |
"""Generates a game design based on a given prompt"""
|
| 86 |
-
|
| 87 |
try:
|
| 88 |
if ctx.guild.id != CHAINCRAFT_GUILD_ID:
|
| 89 |
return
|
|
@@ -423,11 +421,11 @@ with gr.Blocks() as bot_app:
|
|
| 423 |
""")
|
| 424 |
|
| 425 |
async def run_bot():
|
| 426 |
-
|
| 427 |
await bot.start(DISCORD_BOT_TOKEN)
|
| 428 |
await bot_ready.wait()
|
| 429 |
|
| 430 |
threading.Thread(target=bot_app.launch).start()
|
| 431 |
-
|
| 432 |
|
| 433 |
asyncio.run(run_bot())
|
|
|
|
| 8 |
from discord.ext import commands
|
| 9 |
from gradio_client import Client
|
| 10 |
|
|
|
|
|
|
|
| 11 |
bot_ready = asyncio.Event()
|
| 12 |
DISCORD_BOT_TOKEN = os.environ.get("DISCORD_BOT_TOKEN")
|
| 13 |
if DISCORD_BOT_TOKEN is None:
|
|
|
|
| 81 |
|
| 82 |
async def try_chaincraft_design(ctx, prompt, private):
|
| 83 |
"""Generates a game design based on a given prompt"""
|
| 84 |
+
print("Starting chaincraft design thread...")
|
| 85 |
try:
|
| 86 |
if ctx.guild.id != CHAINCRAFT_GUILD_ID:
|
| 87 |
return
|
|
|
|
| 421 |
""")
|
| 422 |
|
| 423 |
async def run_bot():
|
| 424 |
+
print("run_bot: start")
|
| 425 |
await bot.start(DISCORD_BOT_TOKEN)
|
| 426 |
await bot_ready.wait()
|
| 427 |
|
| 428 |
threading.Thread(target=bot_app.launch).start()
|
| 429 |
+
print("run_bot: end")
|
| 430 |
|
| 431 |
asyncio.run(run_bot())
|