diff options
| author | Igor <50257429+igorechek06@users.noreply.github.com> | 2021-10-15 14:07:38 +0900 |
|---|---|---|
| committer | Igor <50257429+igorechek06@users.noreply.github.com> | 2021-10-15 14:07:38 +0900 |
| commit | 1f8b8b67b81c5ae86980d9129f3a88db61165698 (patch) | |
| tree | a41c32a99a8081c05d52615f648af48bc54570cd /handlers/all.py | |
| parent | a700c5db181d823f540595cf766e2eddbd4648a8 (diff) | |
| download | karpov_ai_bot-1f8b8b67b81c5ae86980d9129f3a88db61165698.tar.gz karpov_ai_bot-1f8b8b67b81c5ae86980d9129f3a88db61165698.zip | |
Фотки в gif для абьюз телеграм
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 | ||
