replace-bot/handlers/callback/timetable.py
2023-02-19 00:51:52 +02:00

21 lines
509 B
Python

import io
import json
from aiogram import types
from load import dp, bot
from keyboards.inline.timetable import timetable
@dp.callback_query_handler(lambda c: c.data.split("|")[0] == "timetable")
async def callback_table(query: types.CallbackQuery):
message = query.message
group = query.data.split("|")[1]
file = timetable(group)
for f in file:
await bot.send_photo(
message.chat.id,
io.BytesIO(open(f, 'rb').read())
)
await query.answer()