mirror of
https://github.com/civsocit/olgram.git
synced 2025-12-16 20:16:16 +00:00
minor changes
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
Здесь работа с конкретным ботом
|
||||
"""
|
||||
from aiogram import types
|
||||
from aiogram.utils.exceptions import TelegramAPIError
|
||||
from aiogram.utils.exceptions import TelegramAPIError, Unauthorized
|
||||
from olgram.models.models import Bot
|
||||
from server.server import unregister_token
|
||||
|
||||
@@ -11,7 +11,11 @@ async def delete_bot(bot: Bot, call: types.CallbackQuery):
|
||||
"""
|
||||
Пользователь решил удалить бота
|
||||
"""
|
||||
await unregister_token(bot.token)
|
||||
try:
|
||||
await unregister_token(bot.token)
|
||||
except Unauthorized:
|
||||
# Вероятно пользователь сбросил токен или удалил бот, это уже не наши проблемы
|
||||
pass
|
||||
await bot.delete()
|
||||
await call.answer("Бот удалён")
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user