Spaces:
seawolf2357
/
Running on CPU Upgrade

seawolf2357 commited on
Commit
273191f
โ€ข
1 Parent(s): 3afb0fb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -87,8 +87,12 @@ class MyClient(discord.Client):
87
 
88
  self.is_processing = True
89
  try:
90
- # ์ƒˆ๋กœ์šด ์Šค๋ ˆ๋“œ ์ƒ์„ฑ
91
- thread = await message.channel.create_thread(name=f"์งˆ๋ฌธ: {message.author.name}", message=message)
 
 
 
 
92
  if self.is_math_question(message.content):
93
  text_response = await self.handle_math_question(message.content)
94
  await self.send_message_with_latex(thread, text_response)
@@ -98,6 +102,8 @@ class MyClient(discord.Client):
98
  finally:
99
  self.is_processing = False
100
 
 
 
101
  def is_message_in_specific_channel(self, message):
102
  return message.channel.id == SPECIFIC_CHANNEL_ID or (
103
  isinstance(message.channel, discord.Thread) and message.channel.parent_id == SPECIFIC_CHANNEL_ID
 
87
 
88
  self.is_processing = True
89
  try:
90
+ if isinstance(message.channel, discord.Thread):
91
+ thread = message.channel # ์ด๋ฏธ ์Šค๋ ˆ๋“œ ์•ˆ์— ์žˆ์œผ๋ฏ€๋กœ ํ•ด๋‹น ์Šค๋ ˆ๋“œ๋ฅผ ์‚ฌ์šฉ
92
+ else:
93
+ # ์ƒˆ๋กœ์šด ์Šค๋ ˆ๋“œ ์ƒ์„ฑ
94
+ thread = await message.channel.create_thread(name=f"์งˆ๋ฌธ: {message.author.name}", message=message)
95
+
96
  if self.is_math_question(message.content):
97
  text_response = await self.handle_math_question(message.content)
98
  await self.send_message_with_latex(thread, text_response)
 
102
  finally:
103
  self.is_processing = False
104
 
105
+
106
+
107
  def is_message_in_specific_channel(self, message):
108
  return message.channel.id == SPECIFIC_CHANNEL_ID or (
109
  isinstance(message.channel, discord.Thread) and message.channel.parent_id == SPECIFIC_CHANNEL_ID