seawolf2357 commited on
Commit
6c46430
ยท
verified ยท
1 Parent(s): 5e42677

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -5
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
- threads = await message.channel.threads()
132
- # ์ฃผ์–ด์ง„ ๋ฉ”์‹œ์ง€์™€ ์—ฐ๊ด€๋œ ์“ฐ๋ ˆ๋“œ๋ฅผ ์ฐพ๊ธฐ
133
- for thread in threads:
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__":