Answer the question
In order to leave comments, you need to log in
Why isn't a keyboard message sent by id?
@dp.message_handler(state=oprosnik.Q7, content_types=ContentTypes.TEXT)
async def vopros6(message: Message, state: FSMContext):
kted = message.text
if message.text.lower() not in kted:
return
gg = message.from_user.id
await bot.send_message(chat_id=ADMIN, text=f'Опыт в сфере игр: {italic(kted)} ({gg}\n)',
parse_mode=ParseMode.MARKDOWN, reply_markup=item_all)
await message.answer('✨Вы заполнили анкету, ждите ответа от модерации✨')
await oprosnik.Q8.set()
@dp.message_handler(state=oprosnik.Q8)
async def qweqw(message: Message):
if 'Принять заявку✅' in message.text:
await message.bot.send_message(chat_id=gg, text='Вы приняты ✅', reply_markup=all_accept)
elif 'Отклонить заявку' in message.text:
await message.answer('Вам отклонили заявку')
await oprosnik.Q9
Answer the question
In order to leave comments, you need to log in
2 hours is not enough)
do you have the qweqw function included in the vipros6 function ? if so, does it work at all when sending a message to the bot? As far as I understand it shouldn't.
And if you made a typo when composing the question, then the gg variable is simply not defined in this function. Store the value in state.
Try moving in this direction:
@dp.message_handler(state=oprosnik.Q7, content_types=ContentTypes.TEXT)
async def vopros6(message: Message, state: FSMContext):
kted = message.text
if message.text.lower() not in kted:
return
await state.update_data(gg=message.from_user.id)
await bot.send_message(chat_id=ADMIN, text=f'Опыт в сфере игр: {italic(kted)} ({gg}\n)',
parse_mode=ParseMode.MARKDOWN, reply_markup=item_all)
await message.answer('✨Вы заполнили анкету, ждите ответа от модерации✨')
await oprosnik.Q8.set()
@dp.message_handler(state=oprosnik.Q8)
async def qweqw(message: Message, state: FSMContext):
user_data = await state.get_data()
gg = user_data['gg']
if 'Принять заявку✅' in message.text:
await message.bot.send_message(chat_id=gg, text='Вы приняты ✅', reply_markup=all_accept)
elif 'Отклонить заявку' in message.text:
await message.answer('Вам отклонили заявку')
await oprosnik.Q9
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question