async def sendgroupselectionkeyboard(message: types.Message, corpusname: str) -> None:…
- User
async def send_group_selection_keyboard(message: types.Message, corpus_name: str) -> None: group_list = ["..."] # Add the groups for the corpus here markup = create_group_buttons(group_list) await message.answer("📃Выберите группу", reply_markup=markup) add to group_list, groups for the first corpus if selected_corp == "first_corpus": group_list = ["AOE/21", "AOKS/21", "AOIS1/21", "AORT/21", "AOMTs/21", "AOMTs3/22", "AOYu1/21", "AOYu2/21" , "AOE/20", "AOMT/20", "AOKS/20", "AORT/20", "AOMTs/20", "AOPI/20", "AOIS2/21", "AOYU1/20", "AOYu2/20", "AOE /19", "AOKS/19", "AOMT/19", "AORT/19", "AOPI/19", "AOMC/19"], and for the second corpus elif selected_corp == "second_corpus": group_list = ["AOES/34", "AOKS/35", "AOIS1/36"] markup = create_group_buttons(group_list)
codeif callback_query.from_user.id == ADMIN_ID: markup.add(InlineKeyboardButton(text="🔧Change schedule", callback_data="change_path")) await message.reply("📃Select a group", reply_markup=markup) - Assistant
It looks like you want to add groups for two different corpora to the
group_list. You can do this by checking the value ofcorpus_nameand modifying thegroup_listaccordingly. Here's an updated version of your function:pythonasync def send_group_selection_keyboard(message: types.Message, corpus_name: str) -> None: if corpus_name == "first_corpus": group_list = ["AOE/21", "AOKS/21", "AOIS1/21", "AORT/21", "AOMTs/21", "AOMTs3/22", "AOYu1/21", "AOYu2/21", "AOE/20", "AOMT/20", "AOKS/20", "AORT/20", "AOMTs/20", "AOPI/20", "AOIS2/21", "AOYU1/20", "AOYu2/20", "AOE /19", "AOKS/19", "AOMT/19", "AORT/19", "AOPI/19", "AOMC/19"] elif corpus_name == "second_corpus": group_list = ["AOES/34", "AOKS/35", "AOIS1/36"] markup = create_group_buttons(group_list) if message.from_user.id == ADMIN_ID: markup.add(InlineKeyboardButton(text="🔧Change schedule", callback_data="change_path")) await message.answer("📃Выберите группу", reply_markup=markup)