24 lines
609 B
Python
24 lines
609 B
Python
import logging
|
||
from aiogram import types
|
||
|
||
from load import dp, bot
|
||
from parser import docs_parse
|
||
|
||
|
||
@dp.message_handler(admin=True, commands=['reload'])
|
||
async def refresh(message: types.Message):
|
||
m = await bot.send_message(
|
||
message.chat.id,
|
||
"Идёт обновление информации..."
|
||
)
|
||
try:
|
||
docs_parse()
|
||
await m.edit_text(
|
||
"Информация о заменах была обновлена!"
|
||
)
|
||
except Exception as e:
|
||
logging.error(e)
|
||
await m.edit_text(
|
||
"Произойшла ошибка!"
|
||
)
|