Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -137,19 +137,19 @@ async def on_message(message):
|
|
137 |
|
138 |
|
139 |
is_debug = "<debug>" in message.content
|
|
|
|
|
|
|
|
|
|
|
|
|
140 |
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
# Create a thread from the sent message
|
148 |
-
if is_debug:
|
149 |
-
thread = await sent_message.create_thread(name="Debug Thread", auto_archive_duration=60)
|
150 |
-
|
151 |
-
# Send a message in the created thread
|
152 |
-
await thread.send(debug_info)
|
153 |
|
154 |
|
155 |
# Run the bot with your token
|
|
|
137 |
|
138 |
|
139 |
is_debug = "<debug>" in message.content
|
140 |
+
async with message.channel.typing():
|
141 |
+
# Respond with "pong" if the message contains "ping"
|
142 |
+
response, debug_info = handle_chat(message.content.replace("<debug>","").replace("</debug>",""))
|
143 |
+
|
144 |
+
print(response)
|
145 |
+
sent_message = await message.channel.send(response)
|
146 |
|
147 |
+
# Create a thread from the sent message
|
148 |
+
if is_debug:
|
149 |
+
thread = await sent_message.create_thread(name="Debug Thread", auto_archive_duration=60)
|
150 |
+
|
151 |
+
# Send a message in the created thread
|
152 |
+
await thread.send(debug_info)
|
|
|
|
|
|
|
|
|
|
|
|
|
153 |
|
154 |
|
155 |
# Run the bot with your token
|