fantaxy commited on
Commit
f9ca11b
ยท
verified ยท
1 Parent(s): 55e2ebd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -7
app.py CHANGED
@@ -84,18 +84,15 @@ class MyClient(discord.Client):
84
  await self.text_to_speech_and_send(channel, response_text)
85
  finally:
86
  self.is_processing = False
87
-
88
  async def find_or_create_private_thread(self, message, thread_name):
89
- # ํ•ด๋‹น ๋ฉ”์‹œ์ง€ ์ฑ„๋„์—์„œ ๋ชจ๋“  ์“ฐ๋ ˆ๋“œ๋ฅผ ๊ฒ€์ƒ‰
90
- threads = await message.channel.threads()
91
- # ์ด๋ฏธ ์กด์žฌํ•˜๋Š” ์“ฐ๋ ˆ๋“œ ๊ฒ€์ƒ‰
92
- for thread in threads:
93
  if thread.name == thread_name and not thread.archived:
94
  return thread
95
  # ์ƒˆ๋กœ์šด ํ”„๋ผ์ด๋น— ์“ฐ๋ ˆ๋“œ ์ƒ์„ฑ
96
  return await message.channel.create_thread(name=thread_name, message=message, auto_archive_duration=60, type=discord.ChannelType.private_thread)
97
-
98
-
99
  def is_message_in_specific_channel(self, message):
100
  return message.channel.id == SPECIFIC_CHANNEL_ID or (
101
  isinstance(message.channel, discord.Thread) and message.channel.parent_id == SPECIFIC_CHANNEL_ID
 
84
  await self.text_to_speech_and_send(channel, response_text)
85
  finally:
86
  self.is_processing = False
87
+
88
  async def find_or_create_private_thread(self, message, thread_name):
89
+ # ์กด์žฌํ•˜๋Š” ์“ฐ๋ ˆ๋“œ ๊ฒ€์ƒ‰
90
+ for thread in message.channel.threads: # threads๋Š” ์ด์ œ ๋ฆฌ์ŠคํŠธ๋‚˜ ๋ฐ˜๋ณต ๊ฐ€๋Šฅํ•œ ๊ฐ์ฒด์ผ ๊ฒƒ์ž…๋‹ˆ๋‹ค.
 
 
91
  if thread.name == thread_name and not thread.archived:
92
  return thread
93
  # ์ƒˆ๋กœ์šด ํ”„๋ผ์ด๋น— ์“ฐ๋ ˆ๋“œ ์ƒ์„ฑ
94
  return await message.channel.create_thread(name=thread_name, message=message, auto_archive_duration=60, type=discord.ChannelType.private_thread)
95
+ \
 
96
  def is_message_in_specific_channel(self, message):
97
  return message.channel.id == SPECIFIC_CHANNEL_ID or (
98
  isinstance(message.channel, discord.Thread) and message.channel.parent_id == SPECIFIC_CHANNEL_ID