aboutsummaryrefslogtreecommitdiff
path: root/handlers/all.py
diff options
context:
space:
mode:
Diffstat (limited to 'handlers/all.py')
-rw-r--r--handlers/all.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/handlers/all.py b/handlers/all.py
new file mode 100644
index 0000000..10ba92d
--- /dev/null
+++ b/handlers/all.py
@@ -0,0 +1,16 @@
1from shared.instances import dp
2from aiogram import types as t
3
4
5@dp.errors_handler()
6async def errors_handler(upd: t.Update, err: Exception):
7 txt = "Я хз что произошло, но да \n"
8 txt += f" {err.__class__.__name__}: {' '.join(err.args)}"
9
10 if upd.message:
11 await upd.message.answer(txt)
12 elif upd.callback_query:
13 await upd.callback_query.answer(txt)
14 else:
15 return
16 return True