【问题标题】:Problem reading user ID to reply to message. Telegram bot with Aiogram读取用户 ID 以回复消息时出现问题。带有 Aiogram 的 Telegram 机器人
【发布时间】:2021-02-06 15:59:18
【问题描述】:

我正在使用 iogramTelegram 上创建 Feedback Bot。当机器人收到消息时,它会将它们转发给我,然后我用bot.send_message (message.reply_to_message.forward_from.id, message.text) 回复它们。当用户在隐私设置中有权限转发消息,那么一切都很好,但如果没有,那么就可以回复消息消失。问题是:如果用户在隐私设置中禁用了转发消息的权限,我该如何回复消息?

【问题讨论】:

    标签: python python-3.x


    【解决方案1】:

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

    客户 + 机器人

    Customer -> BotBot -> Customer 通信中,参与者可以看到彼此。

    因此,即使客户限制了消息的转发,机器人仍然可以回答,因为它回答的是直接(未转发)消息。

    你+机器人

    对于Bot -> You -> Bot 通信,请使用简单(未转发)消息。

    1. 只需将客户的消息链接到某个 ID - your_tracking_id
    2. 在 Bot 的消息中添加 ID,例如:
    New issue: #id{your_tracking_id)
    Oleg: 
        Hello World
    
    1. 当您回复 Bot 的消息时,它可以获得与 your_tracking_id 关联的客户消息凭据(chat.idmessage.id

    【讨论】:

      猜你喜欢
      • 2018-10-05
      • 2022-07-06
      • 1970-01-01
      • 2022-11-11
      • 2020-10-26
      • 2021-03-09
      • 2018-02-03
      • 2020-12-12
      • 1970-01-01
      相关资源
      最近更新 更多