diff --git a/handlers/__pycache__/start.cpython-310.pyc b/handlers/__pycache__/start.cpython-310.pyc index 43480704..7a6b4b41 100644 Binary files a/handlers/__pycache__/start.cpython-310.pyc and b/handlers/__pycache__/start.cpython-310.pyc differ diff --git a/handlers/start.py b/handlers/start.py index 72e174ed..85501960 100644 --- a/handlers/start.py +++ b/handlers/start.py @@ -3,8 +3,7 @@ from aiogram.filters import Command from aiogram.fsm.context import FSMContext from aiogram.fsm.state import State, StatesGroup from aiogram.types import (CallbackQuery, InlineKeyboardButton, - InlineKeyboardMarkup, Message, - ReplyKeyboardMarkup, KeyboardButton) + InlineKeyboardMarkup, Message) from aiogram.types import BufferedInputFile import os @@ -40,17 +39,9 @@ async def send_welcome_message(chat_id: int): [InlineKeyboardButton(text='πŸ“’ Наш ΠΊΠ°Π½Π°Π»', url=CHANNEL_URL)] ]) - # Π‘ΠΎΠ·Π΄Π°Π΅ΠΌ Reply-ΠΊΠ»Π°Π²ΠΈΠ°Ρ‚ΡƒΡ€Ρƒ снизу - reply_keyboard = ReplyKeyboardMarkup( - keyboard=[ - [KeyboardButton(text='МСню')] # Кнопка "МСню" - ], - resize_keyboard=True # АвтоматичСскоС ΠΈΠ·ΠΌΠ΅Π½Π΅Π½ΠΈΠ΅ Ρ€Π°Π·ΠΌΠ΅Ρ€Π° - ) - - # ΠžΡ‚ΠΏΡ€Π°Π²Π»ΡΠ΅ΠΌ ΠΈΠ·ΠΎΠ±Ρ€Π°ΠΆΠ΅Π½ΠΈΠ΅ с inline-ΠΊΠ»Π°Π²ΠΈΠ°Ρ‚ΡƒΡ€ΠΎΠΉ + # ΠžΡ‚ΠΏΡ€Π°Π²Π»ΡΠ΅ΠΌ ΠΈΠ·ΠΎΠ±Ρ€Π°ΠΆΠ΅Π½ΠΈΠ΅ с ΠΈΠ½Π»Π°ΠΉΠ½-ΠΊΠ»Π°Π²ΠΈΠ°Ρ‚ΡƒΡ€ΠΎΠΉ with open(image_path, 'rb') as image_from_buffer: - message = await bot.send_photo( + await bot.send_photo( chat_id, BufferedInputFile(image_from_buffer.read(), filename="solo_pic.png"), caption=welcome_text, @@ -58,13 +49,6 @@ async def send_welcome_message(chat_id: int): reply_markup=inline_keyboard # Inline-ΠΊΠ»Π°Π²ΠΈΠ°Ρ‚ΡƒΡ€Π° ) - # ОбновляСм сообщСниС, добавляя ΠΊ Π½Π΅ΠΌΡƒ Reply-ΠΊΠ»Π°Π²ΠΈΠ°Ρ‚ΡƒΡ€Ρƒ (Π±Π΅Π· создания Π½ΠΎΠ²ΠΎΠ³ΠΎ сообщСния) - await bot.send_message( - chat_id, - "НаТмитС ΠΊΠ½ΠΎΠΏΠΊΡƒ Π½ΠΈΠΆΠ΅ для доступа ΠΊ мСню:", - reply_markup=reply_keyboard # Reply-ΠΊΠ»Π°Π²ΠΈΠ°Ρ‚ΡƒΡ€Π° - ) - @router.message(Command('start')) async def start_command(message: Message): await send_welcome_message(message.chat.id) @@ -138,4 +122,3 @@ async def receive_feedback(message: types.Message, state: FSMContext): print(f"Ошибка ΠΏΡ€ΠΈ ΠΎΡ‚ΠΏΡ€Π°Π²ΠΊΠ΅ ΠΎΠ±Ρ€Π°Ρ‚Π½ΠΎΠΉ связи: {e}") # Π›ΠΎΠ³ΠΈΡ€ΠΎΠ²Π°Π½ΠΈΠ΅ ошибок await state.clear() - diff --git a/key_management.py b/key_management.py index 0417b7de..9cd058ec 100644 --- a/key_management.py +++ b/key_management.py @@ -103,7 +103,7 @@ async def handle_text(message: Message, state: FSMContext): await process_callback_view_profile(callback_query, state) return - if message.text in ["/start", "МСню"]: + if message.text in ["/start", "/menu"]: await start_command(message) return