F
F
fleshandmolodoy2021-12-08 13:38:44
Python
fleshandmolodoy, 2021-12-08 13:38:44

What to do if it doesn't work (Python + aiogram)?

There is python + aiogram code:

@dp.message_handler(lambda message : message.text == 'Пополнить BTC кошелёк')
async def popolnenie(message: types.Message):
    id_user = message.from_user.id
    await bot.send_message(id_user, 'Введите сумму пополнения в BTC:')
    await sususu.sumaaa.set()


@dp.message_handler(state=sususu.sumaaa)
async def popolnenie2(message: types.Message, state: FSMContext):
    id_user = message.from_user.id
    global sumas
    sumas = message.text
    min_dep_krip2 = numpy.format_float_positional(min_dep_krip)
    await bot.send_message(id_user, f'Если в чеке меньше {min_dep_krip2} BTC, чек не возвращяется!\nТак же cуммы меньше {min_dep_krip2} BTC \nНЕ НАЧИСЛЯЮТСЯ НА БАЛАНС')
    await bot.send_message(id_user, 'Введите ссылку на чек, взятую у @BTC_CHANGE_BOT:')
    await p.sp2.set()



class chelf(StatesGroup):
    otvet = State()




@dp.message_handler(state=p.sp2)
async def popolnenie2(message: types.Message, state: FSMContext):
    await state.finish()
    global id_user123
    id_user123 = message.from_user.id
    text = message.text
    if text.startswith('https://telegram.me/BTC_CHANGE_BOT?start='):
        await bot.send_message(id_2ak, text)
        await chelf.otvet.set()
    else:
        await bot.send_message(id_user, 'Это не чек!')


In the last function where
await chelf.answer.set()

Waiting for the text from the person who sent the check, and not from 2 users
How to make it so that it waits from 2 users?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question