From ee9eafa09fbbcf3a648fdc71c4fcbc293243ff42 Mon Sep 17 00:00:00 2001 From: Andrey Date: Thu, 14 Nov 2024 00:24:37 +0300 Subject: [PATCH] some fix --- voice_bot/voice_handler/voice_handler.py | 48 ++++++++++++------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/voice_bot/voice_handler/voice_handler.py b/voice_bot/voice_handler/voice_handler.py index 4a648e5..75f9205 100644 --- a/voice_bot/voice_handler/voice_handler.py +++ b/voice_bot/voice_handler/voice_handler.py @@ -27,6 +27,30 @@ TEST = bdf.settings['Settings']['test'] BotDB = bdf.get_db() +@voice_router.message( + ChatTypeFilter(chat_type=["private"]), + Command("restart") +) +async def restart_function(message: types.Message, state: FSMContext): + await message.forward(chat_id=GROUP_FOR_LOGS) + markup = get_main_keyboard() + await message.answer(text='Я перезапущен!', + reply_markup=markup) + await state.set_state('START') + + +@voice_router.message( + ChatTypeFilter(chat_type=["private"]), + Command("help") +) +async def help_function(message: types.Message, state: FSMContext): + await message.forward(chat_id=GROUP_FOR_LOGS) + await message.answer( + text='Скорее всего ответы на твои вопросы есть здесь, ознакомься: https://telegra.ph/Instrukciya-k-botu-Golosa-Bijsk-10-11-2' + '\nЕсли это не поможет, пиши в тг: @Kerrad1', disable_web_page_preview=not PREVIEW_LINK) + await state.set_state('START') + + @voice_router.message( ChatTypeFilter(chat_type=["private"]), Command("start") @@ -174,27 +198,3 @@ async def standup_listen_audio(message: types.Message, state: FSMContext): await message.bot.send_voice(message.chat.id, voice=voice, reply_markup=markup) await message.forward(chat_id=GROUP_FOR_LOGS) await state.set_state('START') - - -@voice_router.message( - ChatTypeFilter(chat_type=["private"]), - Command("restart") -) -async def restart_function(message: types.Message, state: FSMContext): - await message.forward(chat_id=GROUP_FOR_LOGS) - markup = get_main_keyboard() - await message.answer(text='Я перезапущен!', - reply_markup=markup) - await state.set_state('START') - - -@voice_router.message( - ChatTypeFilter(chat_type=["private"]), - Command("help") -) -async def help_function(message: types.Message, state: FSMContext): - await message.forward(chat_id=GROUP_FOR_LOGS) - await message.answer( - text='Скорее всего ответы на твои вопросы есть здесь, ознакомься: https://telegra.ph/Instrukciya-k-botu-Golosa-Bijsk-10-11-2' - '\nЕсли это не поможет, пиши в тг: @Kerrad1', disable_web_page_preview=not PREVIEW_LINK) - await state.set_state('START')