Upd logs
parent
069ce87453
commit
a6028da0ff
5
main.py
5
main.py
|
@ -284,6 +284,9 @@ async def message_handler(message: Message):
|
|||
markup_start = ReplyKeyboardMarkup(keyboard=[[KeyboardButton(text="Запустить Бот")]])
|
||||
markup_shutdown = ReplyKeyboardMarkup(keyboard=[[KeyboardButton(text="Остановить Бот")]])
|
||||
if message.text == "Запустить Бот":
|
||||
if PARSER_ALIVE:
|
||||
await message.answer("Бот уже запущен", reply_markup=markup_shutdown)
|
||||
return
|
||||
PARSER_ALIVE = True
|
||||
for chat_id in s.get_users():
|
||||
await bot.send_message(chat_id,
|
||||
|
@ -292,6 +295,8 @@ async def message_handler(message: Message):
|
|||
parser_thread.start()
|
||||
return
|
||||
if message.text == "Остановить Бот":
|
||||
if not PARSER_ALIVE:
|
||||
await message.answer("Бот уже остановлен", reply_markup=markup_start)
|
||||
for chat_id in s.get_users():
|
||||
await bot.send_message(chat_id,
|
||||
f"Пользователь {message.from_user.full_name} остановил бот",
|
||||
|
|
Loading…
Reference in New Issue