seawolf2357 commited on
Commit
4f3c619
·
verified ·
1 Parent(s): 204d278

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -2
app.py CHANGED
@@ -20,6 +20,12 @@ CHANNEL_ID = 1269529561914413106
20
  @bot.event
21
  async def on_ready():
22
  print(f'{bot.user} has connected to Discord!')
 
 
 
 
 
 
23
 
24
  @bot.event
25
  async def on_message(message):
@@ -48,8 +54,9 @@ async def on_message(message):
48
  except asyncio.TimeoutError:
49
  await message.channel.send("Image generation timed out. Please try again.")
50
  except Exception as e:
51
- await message.channel.send(f"An error occurred: {str(e)}")
52
- print(f"Error in on_message: {str(e)}")
 
53
 
54
  @bot.event
55
  async def on_disconnect():
 
20
  @bot.event
21
  async def on_ready():
22
  print(f'{bot.user} has connected to Discord!')
23
+ try:
24
+ # Simple API call to test connection
25
+ gradio_client.predict("test", api_name="/infer_t2i")
26
+ print("Gradio API connection successful")
27
+ except Exception as e:
28
+ print(f"Gradio API connection failed: {str(e)}")
29
 
30
  @bot.event
31
  async def on_message(message):
 
54
  except asyncio.TimeoutError:
55
  await message.channel.send("Image generation timed out. Please try again.")
56
  except Exception as e:
57
+ error_message = f"An error occurred: {str(e)}"
58
+ await message.channel.send(error_message)
59
+ print(f"Error in on_message: {error_message}")
60
 
61
  @bot.event
62
  async def on_disconnect():