Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -127,12 +127,18 @@ async def create_or_use_thread_and_send_videos(message, keywords, video_urls):
|
|
127 |
await thread.send(url)
|
128 |
|
129 |
async def find_existing_thread(message):
|
130 |
-
# ์ฑ๋์ ๋ชจ๋ ์ฐ๋ ๋ ๊ฐ์ ธ์ค๊ธฐ
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
if thread.id == message.id:
|
135 |
return thread
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
136 |
return None
|
137 |
|
138 |
if __name__ == "__main__":
|
|
|
127 |
await thread.send(url)
|
128 |
|
129 |
async def find_existing_thread(message):
|
130 |
+
# ์ฑ๋์ ๋ชจ๋ ํ์ฑ ์ฐ๋ ๋ ๊ฐ์ ธ์ค๊ธฐ
|
131 |
+
active_threads = await message.channel.active_threads()
|
132 |
+
for thread in active_threads:
|
133 |
+
if thread.starter_message_id == message.id:
|
|
|
134 |
return thread
|
135 |
+
|
136 |
+
# ์ฑ๋์ ๋ชจ๋ ๋ณด๊ด๋ ์ฐ๋ ๋ ๊ฐ์ ธ์ค๊ธฐ
|
137 |
+
archived_threads = await message.channel.archived_threads().flatten()
|
138 |
+
for thread in archived_threads:
|
139 |
+
if thread.starter_message_id == message.id:
|
140 |
+
return thread
|
141 |
+
|
142 |
return None
|
143 |
|
144 |
if __name__ == "__main__":
|