Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -129,12 +129,16 @@ async def on_message(message):
|
|
129 |
# Check if the message is from the bot itself to prevent a loop
|
130 |
if message.author == client.user:
|
131 |
return
|
|
|
|
|
|
|
|
|
|
|
132 |
print(message.content)
|
133 |
|
134 |
-
is_debug = "
|
135 |
async with message.channel.typing():
|
136 |
-
|
137 |
-
response, debug_info = await handle_chat(message.content.replace("<debug>", "").replace("</debug>", ""))
|
138 |
|
139 |
print(response)
|
140 |
sent_message = await message.reply(response)
|
|
|
129 |
# Check if the message is from the bot itself to prevent a loop
|
130 |
if message.author == client.user:
|
131 |
return
|
132 |
+
|
133 |
+
# Exit the function if the bot is not mentioned
|
134 |
+
if f'<@{client.user.id}>' not in message.content:
|
135 |
+
return
|
136 |
+
|
137 |
print(message.content)
|
138 |
|
139 |
+
is_debug = "debug:" in message.content
|
140 |
async with message.channel.typing():
|
141 |
+
response, debug_info = await handle_chat(message.content.replace("debug:", ""))
|
|
|
142 |
|
143 |
print(response)
|
144 |
sent_message = await message.reply(response)
|