Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -138,14 +138,14 @@ async def on_message(message):
|
|
138 |
|
139 |
is_debug = "debug:" in message.content
|
140 |
async with message.channel.typing():
|
141 |
-
|
142 |
-
|
143 |
print(response)
|
144 |
sent_message = await message.reply(response)
|
145 |
|
146 |
# Create a thread from the sent message
|
147 |
if is_debug:
|
148 |
-
thread = await sent_message.create_thread(name="Debug Thread", auto_archive_duration=60)
|
149 |
|
150 |
# Send a message in the created thread
|
151 |
await thread.send(debug_info)
|
|
|
138 |
|
139 |
is_debug = "debug:" in message.content
|
140 |
async with message.channel.typing():
|
141 |
+
cleaned_message=message.content.replace("debug:", "").replace(f'<@{client.user.id}>',"")
|
142 |
+
response, debug_info = await handle_chat(cleaned_message)
|
143 |
print(response)
|
144 |
sent_message = await message.reply(response)
|
145 |
|
146 |
# Create a thread from the sent message
|
147 |
if is_debug:
|
148 |
+
thread = await sent_message.create_thread(name=f"""Debug Thread: '{cleaned_message}'""", auto_archive_duration=60)
|
149 |
|
150 |
# Send a message in the created thread
|
151 |
await thread.send(debug_info)
|