🐛 Исправление: await перед get_busy_times + возврат emoji
- booking.py: добавлен await перед get_busy_times (ошибка TypeError: coroutine is not iterable) - menu.py: возвращены emoji вместо текстовых меток - time_slots.py: возвращены emoji ❌/✅ вместо [X]/[V] - Проблема была в том, что booking_service использует async def, а вызов в booking.py был без await
This commit is contained in:
@@ -3,18 +3,18 @@ from aiogram.types import ReplyKeyboardMarkup, KeyboardButton
|
|||||||
menu = ReplyKeyboardMarkup(
|
menu = ReplyKeyboardMarkup(
|
||||||
keyboard=[
|
keyboard=[
|
||||||
[KeyboardButton(text="/start")],
|
[KeyboardButton(text="/start")],
|
||||||
[KeyboardButton(text="[services]")],
|
[KeyboardButton(text="\U0001f4cb \u0423\u0441\u043b\u0443\u0433\u0438")],
|
||||||
[KeyboardButton(text="[book]")],
|
[KeyboardButton(text="\U0001f4c5 \u0417\u0430\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f")],
|
||||||
[KeyboardButton(text="[mybookings]")],
|
[KeyboardButton(text="\U0001f4c4 \u041c\u043e\u0438 \u0437\u0430\u043f\u0438\u0441\u0438")],
|
||||||
[KeyboardButton(text="[contacts]")],
|
[KeyboardButton(text="\U0001f4de \u041a\u043e\u043d\u0442\u0430\u043a\u0442\u044b")],
|
||||||
[KeyboardButton(text="[about]")],
|
[KeyboardButton(text="\u2139\ufe0f \u041e \u043d\u0430\u0441")],
|
||||||
],
|
],
|
||||||
resize_keyboard=True
|
resize_keyboard=True
|
||||||
)
|
)
|
||||||
|
|
||||||
cancel_menu = ReplyKeyboardMarkup(
|
cancel_menu = ReplyKeyboardMarkup(
|
||||||
keyboard=[
|
keyboard=[
|
||||||
[KeyboardButton(text="cancel")]
|
[KeyboardButton(text="\u274c \u041e\u0442\u043c\u0435\u043d\u0430")]
|
||||||
],
|
],
|
||||||
resize_keyboard=True
|
resize_keyboard=True
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ def get_time_keyboard(busy_times):
|
|||||||
for slot in TIME_SLOTS:
|
for slot in TIME_SLOTS:
|
||||||
busy = slot in busy_times
|
busy = slot in busy_times
|
||||||
if busy:
|
if busy:
|
||||||
label = "[X] " + slot
|
label = "\u274c" + " " + slot
|
||||||
else:
|
else:
|
||||||
label = "[V] " + slot
|
label = "\u2705" + " " + slot
|
||||||
row.append(InlineKeyboardButton(text=label, callback_data="time_" + slot))
|
row.append(InlineKeyboardButton(text=label, callback_data="time_" + slot))
|
||||||
if len(row) == 3:
|
if len(row) == 3:
|
||||||
buttons.append(row)
|
buttons.append(row)
|
||||||
|
|||||||
Reference in New Issue
Block a user