简体   繁体   中英

Problem reading user ID to reply to message. Telegram bot with Aiogram

I am using iogram to create Feedback Bot on Telegram . When a bot receives messages, it forwards them to me, after which I reply to them with bot.send_message (message.reply_to_message.forward_from.id, message.text) . When the user has permission to forward messages in the privacy settings , then everything is fine, but if not , then the ability to reply to the message disappears . The question is: How can I reply to messages if the user has disabled permission to forward messages in the privacy settings?

Chain

Customer -> Bot -> You -> Bot -> Customer

Customer + Bot

In Customer -> Bot and Bot -> Customer communications, participants can see each other.

Thus, even Customers restricts the forwardind of messages, bot can still answer, because it answers to direct (not forwarded) message.

You + Bot

For Bot -> You -> Bot communication use simple (not forwarded) messages.

  1. Just link Customer's message to some ID - your_tracking_id
  2. Add ID to Bot's message, eg:
New issue: #id{your_tracking_id)
Oleg: 
    Hello World
  1. When you reply to Bot's message it can get Customer's message credentials ( chat.id , message.id ) linked with your_tracking_id

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM