class Form(StatesGroup):
number = State()
@dp.message_handler(commands=['test'])
async def players(message: types.Message):
await Form.number.set()
await message.reply('Твое число:')
@dp.message_handler(state=Form.number)
async def process_name(message: types.Message, state: FSMContext):
async with state.proxy() as data:
data['number'] = message.text
await message.reply(f"Твое число: {message.text}")
id='1', title="Текст1",
message_text="Текст2",
input_message_content=types.InputTextMessageContent(
message_text="Текст3"))
async def test111():
user_id = message.from_user.id
keyboard = types.InlineKeyboardMarkup()
callback_button1 = types.InlineKeyboardButton(text="повторить", callback_data="test1")
keyboard.add(callback_button1)
rrr = str(random.randint(1, 51))
return rrr, keyboard
@dp.message_handler(commands=['test'])
async def test(message, rrr, keyboard):
await message.reply(f'Твое число{rrr}', reply_markup=keyboard)
if data == "button1":
if call.from_user.id == user_id:
await bot.edit_message_text(chat_id=call.message.chat.id, message_id=call.message.message_id, text='id совпал')
else:
await bot.edit_message_text(chat_id=call.message.chat.id, message_id=call.message.message_id, text='id не совпал')