M
M
mandico2021-02-03 18:54:15
Python
mandico, 2021-02-03 18:54:15

Can't send response to Telgram bot?

Good, I'm trying to make a support system, I made the function of sending sms to the chat, but I can't send a response to the bot

@dp.message_handler(state = Registr.Echo)
async def Emailreggroup(message: types.Message, state: FSMContext):
    chat_id = message.chat.id
    text = message.text

    if chat_id == config.FEEDBACK_CHAT_ID:
        reply = message.reply_to_message
        if reply: 
            await bot.send_message(
                chat_id=reply.forward_from.id,
                text=text,
            )
        else: 
            await bot.send_message(
                chat_id=chat_id,
                text='Сделай переслать, чтобы ответить автору',
            )
        
    else:
        await bot.forward_message(
            chat_id = config.FEEDBACK_CHAT_ID,
            from_chat_id = chat_id,
            message_id = message.message_id
        )
        await bot.send_message(
            chat_id=chat_id,
            text='Сообщение отправлено ожидай ответа',
        )

601ac71e0f8dd145031611.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
mandico, 2021-02-03
@mandico

I solved this problem, but a new one appeared (

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question