update
This commit is contained in:
		
							parent
							
								
									a1dab565e2
								
							
						
					
					
						commit
						b973e430cf
					
				@ -74,6 +74,24 @@ menu_1_1 = types.ReplyKeyboardMarkup(
 | 
				
			|||||||
)
 | 
					)
 | 
				
			||||||
#----------------------------------------
 | 
					#----------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# menu_2
 | 
				
			||||||
 | 
					#----------------------------------------
 | 
				
			||||||
 | 
					button_menu_2 = [
 | 
				
			||||||
 | 
					    [types.KeyboardButton(text="🏢 Стать партнёром")],
 | 
				
			||||||
 | 
					    [types.KeyboardButton(text="📄 Виды сотрудничества")],
 | 
				
			||||||
 | 
					    [types.KeyboardButton(text="🏠 Главная")],
 | 
				
			||||||
 | 
					]
 | 
				
			||||||
 | 
					menu_2 = types.ReplyKeyboardMarkup(
 | 
				
			||||||
 | 
					    keyboard=button_menu_2,
 | 
				
			||||||
 | 
					    resize_keyboard=True,
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					menu_2_2_inline_add = [
 | 
				
			||||||
 | 
					    [types.InlineKeyboardButton(text="Виды сотрудничества с СПбГЭТУ ЛЭТИ им Ульянова (Ленина)]", url=INFO_MESSAGES['link_menu_2_2'])],
 | 
				
			||||||
 | 
					]
 | 
				
			||||||
 | 
					menu_2_2_inline = types.InlineKeyboardMarkup(inline_keyboard=menu_2_2_inline_add)
 | 
				
			||||||
 | 
					#----------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# main menu inline
 | 
					# main menu inline
 | 
				
			||||||
#----------------------------------------
 | 
					#----------------------------------------
 | 
				
			||||||
menu_1_1_1_inline_add = [
 | 
					menu_1_1_1_inline_add = [
 | 
				
			||||||
@ -101,10 +119,10 @@ menu_1_3_inline_add = [
 | 
				
			|||||||
]
 | 
					]
 | 
				
			||||||
menu_1_3_inline = types.InlineKeyboardMarkup(inline_keyboard=menu_1_3_inline_add)
 | 
					menu_1_3_inline = types.InlineKeyboardMarkup(inline_keyboard=menu_1_3_inline_add)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
menu_2_inline_add = [
 | 
					# menu_2_inline_add = [
 | 
				
			||||||
    [types.InlineKeyboardButton(text="Виды сотрудничества с СПбГЭТУ ЛЭТИ", url=INFO_MESSAGES['link_rabotod'])],
 | 
					#     [types.InlineKeyboardButton(text="Виды сотрудничества с СПбГЭТУ ЛЭТИ", url=INFO_MESSAGES['link_rabotod'])],
 | 
				
			||||||
]
 | 
					# ]
 | 
				
			||||||
menu_2_inline = types.InlineKeyboardMarkup(inline_keyboard=menu_2_inline_add)
 | 
					# menu_2_inline = types.InlineKeyboardMarkup(inline_keyboard=menu_2_inline_add)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
menu_3_inline_add = [
 | 
					menu_3_inline_add = [
 | 
				
			||||||
    [types.InlineKeyboardButton(text="Подписаться на Telegram-канал", url=INFO_MESSAGES['public_telegram'])],
 | 
					    [types.InlineKeyboardButton(text="Подписаться на Telegram-канал", url=INFO_MESSAGES['public_telegram'])],
 | 
				
			||||||
 | 
				
			|||||||
@ -20,6 +20,13 @@ menu_1_1_message = 'Выберите, что вас интересует:'
 | 
				
			|||||||
menu_1_2_message = 'Подготовь своё резюме правильно! Советы и инструкции доступны здесь:'
 | 
					menu_1_2_message = 'Подготовь своё резюме правильно! Советы и инструкции доступны здесь:'
 | 
				
			||||||
menu_1_3_message = 'Для оформления договора на практику или стажировку воспользуйтесь этим инструментом:'
 | 
					menu_1_3_message = 'Для оформления договора на практику или стажировку воспользуйтесь этим инструментом:'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					menu_2_1_message = """Станьте партнёром СПбГЭТУ ЛЭТИ и получите доступ к следующим возможностям:\n
 | 
				
			||||||
 | 
					- Управление вакансиями через интеграцию с hh.ru и "Работа в России".\n
 | 
				
			||||||
 | 
					- Автоматическая обработка откликов.\n
 | 
				
			||||||
 | 
					- Прямой доступ к студентам и выпускникам.\n
 | 
				
			||||||
 | 
					- Участие в событиях университета.\n"""
 | 
				
			||||||
 | 
					menu_2_2_message = 'Для обсуждения форматов сотрудничества пишите нам:\n\nsupport@facultetus.ru'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
MESSAGES = {
 | 
					MESSAGES = {
 | 
				
			||||||
    'start': start_message,
 | 
					    'start': start_message,
 | 
				
			||||||
    'error': error_message,
 | 
					    'error': error_message,
 | 
				
			||||||
@ -38,6 +45,9 @@ MESSAGES = {
 | 
				
			|||||||
    'menu_1_1': menu_1_1_message,
 | 
					    'menu_1_1': menu_1_1_message,
 | 
				
			||||||
    'menu_1_2': menu_1_2_message,
 | 
					    'menu_1_2': menu_1_2_message,
 | 
				
			||||||
    'menu_1_3': menu_1_3_message,
 | 
					    'menu_1_3': menu_1_3_message,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    'menu_2_1': menu_2_1_message,
 | 
				
			||||||
 | 
					    'menu_2_2': menu_2_2_message,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# info
 | 
					# info
 | 
				
			||||||
@ -51,14 +61,14 @@ MESSAGES = {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
# link_menu_1_2_message = f'https://t.me/doctor_what' # (✍️ Советы по резюме)
 | 
					# link_menu_1_2_message = f'https://t.me/doctor_what' # (✍️ Советы по резюме)
 | 
				
			||||||
# link_menu_1_3_message = f'https://t.me/doctor_what' # (📄 Оформление договора)
 | 
					# link_menu_1_3_message = f'https://t.me/doctor_what' # (📄 Оформление договора)
 | 
				
			||||||
from app.settings.info import public_telegram_message, public_vk_message, link_rabotod_message, \
 | 
					from app.settings.info import public_telegram_message, public_vk_message, \
 | 
				
			||||||
    link_menu_1_1_1_message, link_menu_1_1_2_message, link_menu_1_1_3_message, \
 | 
					    link_menu_1_1_1_message, link_menu_1_1_2_message, link_menu_1_1_3_message, \
 | 
				
			||||||
    link_menu_1_2_message, link_menu_1_3_message
 | 
					    link_menu_1_2_message, link_menu_1_3_message, link_menu_2_2_message
 | 
				
			||||||
 | 
					
 | 
				
			||||||
INFO_MESSAGES = {
 | 
					INFO_MESSAGES = {
 | 
				
			||||||
    'public_telegram': public_telegram_message,
 | 
					    'public_telegram': public_telegram_message,
 | 
				
			||||||
    'public_vk': public_vk_message,
 | 
					    'public_vk': public_vk_message,
 | 
				
			||||||
    'link_rabotod': link_rabotod_message,
 | 
					    #'link_rabotod': link_rabotod_message,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    'link_menu_1_1_1': link_menu_1_1_1_message,
 | 
					    'link_menu_1_1_1': link_menu_1_1_1_message,
 | 
				
			||||||
    'link_menu_1_1_2': link_menu_1_1_2_message,
 | 
					    'link_menu_1_1_2': link_menu_1_1_2_message,
 | 
				
			||||||
@ -66,5 +76,7 @@ INFO_MESSAGES = {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    'link_menu_1_2': link_menu_1_2_message,
 | 
					    'link_menu_1_2': link_menu_1_2_message,
 | 
				
			||||||
    'link_menu_1_3': link_menu_1_3_message,
 | 
					    'link_menu_1_3': link_menu_1_3_message,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    'link_menu_2_2': link_menu_2_2_message,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										
											BIN
										
									
								
								app/photos/2_1/1.jpg
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								app/photos/2_1/1.jpg
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 105 KiB  | 
@ -3,13 +3,15 @@ bot_link = 'test_BOT'
 | 
				
			|||||||
feedback_link = 'test_FeedBack_Bot'
 | 
					feedback_link = 'test_FeedBack_Bot'
 | 
				
			||||||
public_link = 'test_Public'
 | 
					public_link = 'test_Public'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public_telegram_message = 'https://publictelegrammessage.ru'
 | 
					public_telegram_message = 'https://t.me/crk_leti'
 | 
				
			||||||
public_vk_message = 'https://publicvkmessage.ru'
 | 
					public_vk_message = 'https://vk.com/crk_leti'
 | 
				
			||||||
link_rabotod_message = 'https://linkrabotodmessage.ru' # (🤝 Работодателям)
 | 
					#link_rabotod_message = 'https://linkrabotodmessage.ru' # (🤝 Работодателям)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
link_menu_1_1_1_message = 'https://linkmenu111message.ru' # (📚 Стажировки)
 | 
					link_menu_1_1_1_message = 'https://facultetus.ru/university/etu' # (📚 Стажировки)
 | 
				
			||||||
link_menu_1_1_2_message = 'https://linkmenu112message.ru' # (🛠 Практики)
 | 
					link_menu_1_1_2_message = 'https://vk.com/wall-60890114?q=%23практики' # (🛠 Практики)
 | 
				
			||||||
link_menu_1_1_3_message = 'https://linkmenu113message.ru' # (💼 Вакансии)
 | 
					link_menu_1_1_3_message = 'https://t.me/crk_leti' # (💼 Вакансии)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
link_menu_1_2_message = 'https://linkmenu12message.ru' # (✍️ Советы по резюме)
 | 
					link_menu_1_2_message = 'https://vk.com/@crk_leti-kak-sostavit-rezume-sovety-i-rekomendacii-ot-ekspertov' # (✍️ Советы по резюме)
 | 
				
			||||||
link_menu_1_3_message = 'https://linkmenu13message.ru' # (📄 Оформление договора)
 | 
					link_menu_1_3_message = 'https://docs.google.com/forms/d/13Cx5DkKDyqU-p6-RE2rVM795_VFurskvRh-fl6q56pY/viewform?edit_requested=true' # (📄 Оформление договора)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					link_menu_2_2_message = 'https://facultetus.ru/' # (Виды сотрудничества с СПбГЭТУ ЛЭТИ им Ульянова (Ленина)])
 | 
				
			||||||
							
								
								
									
										52
									
								
								debug.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										52
									
								
								debug.py
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,52 @@
 | 
				
			|||||||
 | 
					import platform
 | 
				
			||||||
 | 
					import sys
 | 
				
			||||||
 | 
					from datetime import datetime
 | 
				
			||||||
 | 
					import os
 | 
				
			||||||
 | 
					import pytz
 | 
				
			||||||
 | 
					import aiogram
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def get_debug_info():
 | 
				
			||||||
 | 
					    try:
 | 
				
			||||||
 | 
					        # Системная информация
 | 
				
			||||||
 | 
					        system_name = platform.system()
 | 
				
			||||||
 | 
					        system_version = platform.version()
 | 
				
			||||||
 | 
					        system_release = platform.release()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        # Версия Python
 | 
				
			||||||
 | 
					        python_version = sys.version
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        # Версия aiogram
 | 
				
			||||||
 | 
					        aiogram_version = aiogram.__version__
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        # Локация сервера
 | 
				
			||||||
 | 
					        server_location = os.getenv('SERVER_LOCATION', 'Неизвестно')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        # Время сервера
 | 
				
			||||||
 | 
					        server_time = datetime.now(pytz.utc).strftime('%Y-%m-%d %H:%M:%S UTC')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        # Информация о процессоре
 | 
				
			||||||
 | 
					        processor_info = platform.processor()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        # Информация о машине
 | 
				
			||||||
 | 
					        machine_info = platform.machine()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        # Возвращаем массив с данными
 | 
				
			||||||
 | 
					        return {
 | 
				
			||||||
 | 
					            "System Name": system_name,
 | 
				
			||||||
 | 
					            "System Version": system_version,
 | 
				
			||||||
 | 
					            "System Release": system_release,
 | 
				
			||||||
 | 
					            "Python Version": python_version,
 | 
				
			||||||
 | 
					            "Aiogram Version": aiogram_version,
 | 
				
			||||||
 | 
					            "Server Location": server_location,
 | 
				
			||||||
 | 
					            "Server Time": server_time,
 | 
				
			||||||
 | 
					            "Processor Info": processor_info,
 | 
				
			||||||
 | 
					            "Machine Info": machine_info,
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    except Exception as e:
 | 
				
			||||||
 | 
					        return {"Error": str(e)}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if __name__ == "__main__":
 | 
				
			||||||
 | 
					    # Для отладки: вывод информации
 | 
				
			||||||
 | 
					    debug_info = get_debug_info()
 | 
				
			||||||
 | 
					    for key, value in debug_info.items():
 | 
				
			||||||
 | 
					        print(f"{key}: {value}")
 | 
				
			||||||
							
								
								
									
										22
									
								
								server.py
									
									
									
									
									
								
							
							
						
						
									
										22
									
								
								server.py
									
									
									
									
									
								
							@ -8,7 +8,7 @@ from aiogram.fsm.context import FSMContext
 | 
				
			|||||||
from aiogram.fsm.state import State, StatesGroup
 | 
					from aiogram.fsm.state import State, StatesGroup
 | 
				
			||||||
from aiogram.fsm.storage.memory import MemoryStorage
 | 
					from aiogram.fsm.storage.memory import MemoryStorage
 | 
				
			||||||
from aiogram.filters import Command, StateFilter
 | 
					from aiogram.filters import Command, StateFilter
 | 
				
			||||||
from aiogram.types import Message
 | 
					from aiogram.types import Message, FSInputFile
 | 
				
			||||||
from aiogram.utils.keyboard import InlineKeyboardBuilder
 | 
					from aiogram.utils.keyboard import InlineKeyboardBuilder
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import app.keyboards as kb
 | 
					import app.keyboards as kb
 | 
				
			||||||
@ -150,6 +150,14 @@ async def cancel_handler(message: Message, state: FSMContext) -> None:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
@dp.message(Command("start"))
 | 
					@dp.message(Command("start"))
 | 
				
			||||||
async def process_start_command(message: types.Message):
 | 
					async def process_start_command(message: types.Message):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    debug = True
 | 
				
			||||||
 | 
					    if debug:
 | 
				
			||||||
 | 
					        from debug import get_debug_info
 | 
				
			||||||
 | 
					        debug_info = get_debug_info()
 | 
				
			||||||
 | 
					        answer = "\n".join([f"{key}: {value}" for key, value in debug_info.items()])
 | 
				
			||||||
 | 
					        await message.answer(answer)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    checkAccess = await check_access(message)
 | 
					    checkAccess = await check_access(message)
 | 
				
			||||||
    if checkAccess:
 | 
					    if checkAccess:
 | 
				
			||||||
        await message.answer(MESSAGES['start'], reply_markup=kb.main_menu)
 | 
					        await message.answer(MESSAGES['start'], reply_markup=kb.main_menu)
 | 
				
			||||||
@ -188,7 +196,7 @@ async def do_main_menu(message: Message, state: FSMContext):
 | 
				
			|||||||
        elif txt == '📚 Студентам':
 | 
					        elif txt == '📚 Студентам':
 | 
				
			||||||
            return await message.answer(MESSAGES['menu_1'], reply_markup=kb.menu_1)
 | 
					            return await message.answer(MESSAGES['menu_1'], reply_markup=kb.menu_1)
 | 
				
			||||||
        elif txt == '🤝 Работодателям':
 | 
					        elif txt == '🤝 Работодателям':
 | 
				
			||||||
            return await message.answer(MESSAGES['menu_2'], reply_markup=kb.menu_2_inline)
 | 
					            return await message.answer(MESSAGES['menu_2'], reply_markup=kb.menu_2)
 | 
				
			||||||
        elif txt == 'ℹ️ О центре':
 | 
					        elif txt == 'ℹ️ О центре':
 | 
				
			||||||
            return await message.answer(MESSAGES['menu_3'], reply_markup=kb.menu_3_inline)
 | 
					            return await message.answer(MESSAGES['menu_3'], reply_markup=kb.menu_3_inline)
 | 
				
			||||||
        # elif txt == '📰 Подписка на новости':
 | 
					        # elif txt == '📰 Подписка на новости':
 | 
				
			||||||
@ -209,6 +217,16 @@ async def do_main_menu(message: Message, state: FSMContext):
 | 
				
			|||||||
            return await message.answer(MESSAGES['menu_1_1_2'], reply_markup=kb.menu_1_1_2_inline)
 | 
					            return await message.answer(MESSAGES['menu_1_1_2'], reply_markup=kb.menu_1_1_2_inline)
 | 
				
			||||||
        elif txt == '💼 Вакансии':
 | 
					        elif txt == '💼 Вакансии':
 | 
				
			||||||
            return await message.answer(MESSAGES['menu_1_1_3'], reply_markup=kb.menu_1_1_3_inline)
 | 
					            return await message.answer(MESSAGES['menu_1_1_3'], reply_markup=kb.menu_1_1_3_inline)
 | 
				
			||||||
 | 
					        # Работодателям (2)
 | 
				
			||||||
 | 
					        elif txt == '🏢 Стать партнёром':
 | 
				
			||||||
 | 
					            photo = FSInputFile('app/photos/2_1/1.jpg')  # Используем FSInputFile для локального файла
 | 
				
			||||||
 | 
					            return await bot.send_photo(message.from_user.id, photo, caption=MESSAGES['menu_2_1'])
 | 
				
			||||||
 | 
					            # photo = InputFile('app/photos/2_1/1.jpg')
 | 
				
			||||||
 | 
					            # print("photo", photo)
 | 
				
			||||||
 | 
					            # return await bot.send_photo(message.from_user.id, photo, MESSAGES['menu_2_1'])
 | 
				
			||||||
 | 
					            #return await message.answer(MESSAGES['menu_2_1'])
 | 
				
			||||||
 | 
					        elif txt == '📄 Виды сотрудничества':
 | 
				
			||||||
 | 
					            return await message.answer(MESSAGES['menu_2_2'], reply_markup=kb.menu_2_2_inline)
 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
            return await message.answer(MESSAGES['usestart'])
 | 
					            return await message.answer(MESSAGES['usestart'])
 | 
				
			||||||
    # Для выведения ошибок
 | 
					    # Для выведения ошибок
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user