• Как передать значение переменной в другую функцию?

    @Corn385 Автор вопроса
    Если я правильно понял, то так должно выглядит?
    async def cm_start(message : types.Message):
        await FSMAdmin.all_game.set()
        await message.answer('Введите количество игр, которое вы сыграли:')
        moon = message.text
        return moon
    
    async def load_win(moon, message : types.Message, state: FSMContext):
        async with state.proxy() as data: 
            data['names'] = moon
            data['id_tg'] = message.from_user.id
            data['all_game'] = message.text
        await FSMAdmin.next()
        await message.answer('Введите количество побед:')
  • Как передать значение переменной в другую функцию?

    @Corn385 Автор вопроса
    Василий, dp.register_message_handler(load_win, state=FSMAdmin.all_game)
  • Как создать клавиши с названиями из списка?

    @Corn385 Автор вопроса
    Vindicar, Спасибо за помощь, но не мог бы ты посмотреть мой последний вопрос про машину состояния?
  • Как создать клавиши с названиями из списка?

    @Corn385 Автор вопроса
    Vindicar,
    async def choice_cat(message):
    	CATs = cur.execute(f'SELECT name FROM cathlete WHERE id = ?', (message.from_user.id, )).fetchall()
    	astt = ReplyKeyboardMarkup(resize_keyboard=True)
    	for i in CATs:
    		astt.add(KeyboardButton(i[0]))
    		fsa = astt.add(KeyboardButton(i[0]))
    		print(fsa)


    В тг ничего не меняется. В консоль выводит:
    {"keyboard": [[{"text": "print"}], [{"text": "print"}]], "resize_keyboard": true}
    {"keyboard": [[{"text": "print"}], [{"text": "print"}], [{"text": "enter"}], [{"text": "enter"}]], "resize_keyboard": true}
    {"keyboard": [[{"text": "print"}], [{"text": "print"}], [{"text": "enter"}], [{"text": "enter"}], [{"text": "delete"}], [{"text": "delete"}]], "resize_keyboard": true}
    {"keyboard": [[{"text": "print"}], [{"text": "print"}], [{"text": "enter"}], [{"text": "enter"}], [{"text": "delete"}], [{"text": "delete"}], [{"text": "add"}], [{"text": "add"}]], "resize_keyboard": true}
    {"keyboard": [[{"text": "print"}], [{"text": "print"}], [{"text": "enter"}], [{"text": "enter"}], [{"text": "delete"}], [{"text": "delete"}], [{"text": "add"}], [{"text": "add"}], [{"text": "home"}], [{"text": "home"}]], "resize_keyboard": true}
  • Как создать клавиши с названиями из списка?

    @Corn385 Автор вопроса
    Vindicar, очень странно...
    Выдает тоже самое
  • Как создать клавиши с названиями из списка?

    @Corn385 Автор вопроса
    только вот кнопки не создаются.
    если вывести что делает цикл в консоль, то получается такая картина:
    {"keyboard": [[{"text": ["print"]}], [{"text": ["print"]}]], "resize_keyboard": true}
    {"keyboard": [[{"text": ["print"]}], [{"text": ["print"]}], [{"text": ["enter"]}], [{"text": ["enter"]}]], "resize_keyboard": true}
    {"keyboard": [[{"text": ["print"]}], [{"text": ["print"]}], [{"text": ["enter"]}], [{"text": ["enter"]}], [{"text": ["delete"]}], [{"text": ["delete"]}]], "resize_keyboard": true}
    {"keyboard": [[{"text": ["print"]}], [{"text": ["print"]}], [{"text": ["enter"]}], [{"text": ["enter"]}], [{"text": ["delete"]}], [{"text": ["delete"]}], [{"text": ["add"]}], [{"text": ["add"]}]], "resize_keyboard": true}
    {"keyboard": [[{"text": ["print"]}], [{"text": ["print"]}], [{"text": ["enter"]}], [{"text": ["enter"]}], [{"text": ["delete"]}], [{"text": ["delete"]}], [{"text": ["add"]}], [{"text": ["add"]}], [{"text": ["home"]}], [{"text": ["home"]}]], "resize_keyboard": true}