最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

python - Why does the message not have the properties it should have? Aiogram - Stack Overflow

programmeradmin2浏览0评论
@dp.message(WriteAppeal.message) 
async def wrote(message: Message, state: FSMContext): 
    await bot.forward_message(chat_id=CHANNEL_ID, from_chat_id=message.chat.id, message_id=message.message_id) 
    await message.answer('Обращение благополучно отправлено!')
@dp.message(Command('answer')) 
async def answering(message: Message): 
    try: 
        msg = message.reply_to_message 
    except AttributeError: return

    print(msg.forward_from_chat)
    print(msg.message_thread_id, msg.sender_chat)

    await bot.send_message(msg.chat.id, f'Ответ на ваше обращение: \n {message.text}',     reply_to_message_id=msg.message_id)

A message that is forwarded to another chat does not have the properties of the forwarded message.

Print data returns None everywhere.

How can I get the message id and the chat id from which the message was forwarded?

I tried to take all these id from forward_origin, but it only gave me MessageOriginUser, which doesn't contain anything I need. And I tried to try the method that is written in print

发布评论

评论列表(0)

  1. 暂无评论