seawolf2357 commited on
Commit
13feae4
โ€ข
1 Parent(s): 9c071a8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -0
app.py CHANGED
@@ -64,13 +64,18 @@ class MyClient(discord.Client):
64
  return
65
  if self.is_processing:
66
  return
 
67
  self.is_processing = True
68
  try:
69
  response = await generate_response(message)
 
 
 
70
  await message.channel.send(response)
71
  finally:
72
  self.is_processing = False
73
 
 
74
  def is_message_in_specific_channel(self, message):
75
  return message.channel.id == SPECIFIC_CHANNEL_ID or (
76
  isinstance(message.channel, discord.Thread) and message.channel.parent_id == SPECIFIC_CHANNEL_ID
 
64
  return
65
  if self.is_processing:
66
  return
67
+
68
  self.is_processing = True
69
  try:
70
  response = await generate_response(message)
71
+ # ๋น„์–ด ์žˆ๋Š” ์‘๋‹ต์„ ํ™•์ธํ•˜๊ณ  ์ฒ˜๋ฆฌ
72
+ if response.strip() == "":
73
+ response = "์ฃ„์†กํ•ฉ๋‹ˆ๋‹ค, ์ œ๊ณตํ•  ์ˆ˜ ์žˆ๋Š” ์ •๋ณด๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค."
74
  await message.channel.send(response)
75
  finally:
76
  self.is_processing = False
77
 
78
+
79
  def is_message_in_specific_channel(self, message):
80
  return message.channel.id == SPECIFIC_CHANNEL_ID or (
81
  isinstance(message.channel, discord.Thread) and message.channel.parent_id == SPECIFIC_CHANNEL_ID