Spaces:
Running
Running
seawolf2357
commited on
Commit
โข
13feae4
1
Parent(s):
9c071a8
Update app.py
Browse files
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
|