Update ubot/core/helpers/client.py
Browse files
ubot/core/helpers/client.py
CHANGED
|
@@ -15,7 +15,14 @@ class PY:
|
|
| 15 |
|
| 16 |
@bot.on_message(message_filters)
|
| 17 |
async def wrapped_func(client, message):
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
return wrapped_func
|
| 21 |
|
|
|
|
| 15 |
|
| 16 |
@bot.on_message(message_filters)
|
| 17 |
async def wrapped_func(client, message):
|
| 18 |
+
try:
|
| 19 |
+
await func(client, message)
|
| 20 |
+
except Exception as e:
|
| 21 |
+
LOGGER(__name__).error(f"Error in BOT handler for {command}: {e}")
|
| 22 |
+
try:
|
| 23 |
+
await message.reply(f"<b>❌ Error:</b> <code>{e}</code>")
|
| 24 |
+
except:
|
| 25 |
+
pass
|
| 26 |
|
| 27 |
return wrapped_func
|
| 28 |
|