you don’t need to write the code completely, just show where to change or add something…
- User
you don’t need to write the code completely, just show where to change or add something else, make the user, after selecting the case, no longer show the choice of the case at startup by checking the id if his id is from one case, if he wants to change the case, then enters the /edit command, which allows you to change the case and deletes its id from the file and transfers it to another from selection corps
import logging import pandas as pd import re import io import asyncio import sqlite3 from aiogram import Bot, Dispatcher, types from aiogram.contrib.middlewares.logging import LoggingMiddleware from aiogram.types import InlineKeyboardButton, InlineKeyboardMarkup from aiogram.utils import executor from aiogram.types import CallbackQueryAPI_TOKEN = '6084658919:AAGcYQUODSWD8g0LJ8Ina6FcRZTLxg92s2w'
logging.basicConfig(level=logging.INFO)
bot = Bot(token=API_TOKEN)
dp = Dispatcher(bot) dp.middleware.setup(LoggingMiddleware())
ADMIN_ID = 6068499378 file_dir = r'C:\Users\Administrator\Desktop\1' file_path = None
teachers_file_path = r"C:\Users\Administrator\Desktop\kollektiv.xlsx" id_file_path = r"C:\Users\Administrator\Desktop\id_klient.txt"
def create_group_buttons(groups): markup = InlineKeyboardMarkup() rows = [groups[i:i + 3] for i in range(0, len(groups), 3)]
for row in rows: buttons = [InlineKeyboardButton(text=group, callback_data=f"group:{group}") for group in row] markup.row(*buttons) return markupdef get_schedule1(filepath, group): if group == "АОЭ/21": col = 1 elif group == "АОКС/21": col = 2 elif group == "АОИС1/21": col = 3 elif group == "АОРТ/21": col = 4 elif group == "АОМЦ/21": col = 5 elif group == "АОМЦ3/22": col = 6 elif group == "АОЮ1/21": col = 7 elif group == "АОЮ2/21": col = 8 elif group == "АОЭ/20": col = 1 elif group == "АОМТ/20": col = 2 elif group == "АОКС/20": col = 3 elif group == "АОРТ/20": col = 4 elif group == "АОМЦ/20": col = 5 elif group == "АОПИ/20": col = 6 elif group == "АОИС2/21": col = 7 elif group == "АОЮ1/20": col = 8 elif group == "АОЮ2/20": col = 9 elif group == "АОЭ/19": col = 10 elif group == "АОКС/19": col = 11 elif group == "АОМТ/19": col = 12 elif group == "АОРТ/19": col = 13 elif group == "АОПИ/19": col = 14 elif group == "АОМЦ/19": col = 15 else: return "Группа не найдена."
if file_path is None: return "Расписание отсутсвует." df = pd.read_excel(file_path, sheet_name='Лист1', header=None, engine='xlrd') schedule = "" if group in ["АОЭ/20", "АОМТ/20", "АОКС/20", "АОРТ/20", "АОМЦ/20", "АОПИ/20", "АОИС2/21", "АОЮ1/20", "АОЮ2/20", "АОЭ/19", "АОКС/19", "АОМТ/19", "АОРТ/19", "АОПИ/19", "АОМЦ/19"]: lessons_range = range(25, 40, 3) else: lessons_range = range(6, 21, 3) for i in lessons_range: lessons = "\n".join(df.iloc[i:i + 3, col].dropna().astype(str).tolist()) schedule += f"Урок {int((i-lessons_range.start)/3) + 1}:\n{lessons}\n\n" return scheduledef get_teacher(teachers_filepath, query): teachers_df = pd.read_excel(teachers_filepath, sheet_name='Лист1', header=None, usecols=[0, 8], engine='openpyxl')
- Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.