Spaces:
Runtime error
Runtime error
seawolf2357
commited on
Commit
โข
1cb49d1
1
Parent(s):
1f5dbfe
Update app.py
Browse files
app.py
CHANGED
@@ -87,7 +87,7 @@ class MyClient(discord.Client):
|
|
87 |
transcript_msg = "์๋ง ์ ๋ณด๋ฅผ ๊ฐ์ ธ์ค์ง ๋ชปํ์ต๋๋ค."
|
88 |
system_prompt = "์๋ง ์ ๋ณด๊ฐ ์์ด ๋ต๊ธ ์์ฑ์ด ์ ํ๋ฉ๋๋ค."
|
89 |
|
90 |
-
|
91 |
if message.thread:
|
92 |
thread = message.thread
|
93 |
else:
|
@@ -96,9 +96,13 @@ class MyClient(discord.Client):
|
|
96 |
except discord.errors.HTTPException as e:
|
97 |
logging.error(f"์ค๋ ๋ ์์ฑ ์คํจ: {e}")
|
98 |
return
|
99 |
-
|
100 |
-
|
101 |
-
|
|
|
|
|
|
|
|
|
102 |
|
103 |
def extract_video_id(self, url):
|
104 |
video_id_match = re.search(r"(?:v=|\/)([0-9A-Za-z_-]{11}).*", url)
|
|
|
87 |
transcript_msg = "์๋ง ์ ๋ณด๋ฅผ ๊ฐ์ ธ์ค์ง ๋ชปํ์ต๋๋ค."
|
88 |
system_prompt = "์๋ง ์ ๋ณด๊ฐ ์์ด ๋ต๊ธ ์์ฑ์ด ์ ํ๋ฉ๋๋ค."
|
89 |
|
90 |
+
# ์ค๋ ๋ ์ค๋ณต ์์ฑ ๋ฐฉ์ง
|
91 |
if message.thread:
|
92 |
thread = message.thread
|
93 |
else:
|
|
|
96 |
except discord.errors.HTTPException as e:
|
97 |
logging.error(f"์ค๋ ๋ ์์ฑ ์คํจ: {e}")
|
98 |
return
|
99 |
+
|
100 |
+
# ์๋ง ์ ๋ณด๊ฐ ๊ธธ ๊ฒฝ์ฐ ๋ถํ ํ์ฌ ์ ์ก
|
101 |
+
max_length = 2000
|
102 |
+
for i in range(0, len(transcript_msg), max_length):
|
103 |
+
part_msg = transcript_msg[i:i+max_length]
|
104 |
+
await thread.send(part_msg)
|
105 |
+
|
106 |
|
107 |
def extract_video_id(self, url):
|
108 |
video_id_match = re.search(r"(?:v=|\/)([0-9A-Za-z_-]{11}).*", url)
|