diff options
Diffstat (limited to 'handlers/all.py')
| -rw-r--r-- | handlers/all.py | 16 |
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 @@ | |||
| 1 | from shared.instances import dp | ||
| 2 | from aiogram import types as t | ||
| 3 | |||
| 4 | |||
| 5 | @dp.errors_handler() | ||
| 6 | async 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 | ||
