class Support(StatesGroup):
Question = State()
Answer = State()
async def cmd_help(message: types.Message):
await message.answer("Какой у вас вопрос?")
await Support.Question.set()
async def process_question(message: types.Message, state: FSMContext):
question = message.text
user_id = message.chat.id
question_with_hashtag = f"{question} #id{user_id}"
await bot.send_message(chat_id=user_id, text=question_with_hashtag)
async with state.proxy() as data:
data['Answer'] = question_with_hashtag
async with state.proxy() as data:
printwithhashtag = data['Answer']
print(printwithhashtag)
await Support.Answer.set()
async def process_answer(message: types.Message, state: FSMContext):
txt = message.text
async with state.proxy() as data:
questionwithhashtag = data['Answer']
await state.finish()
user_id = int(questionwithhashtag.split('#id')[1])
print(user_id)
await bot.send_message(chat_id=user_id, text=txt)
await state.finish()