【问题标题】:Reply to user's message from group using telegram bot pytelegrambotapi使用电报机器人 pytelegrambotapi 从组回复用户的消息
【发布时间】:2022-11-10 18:45:43
【问题描述】:

所以,我正在创建机器人以获得支持。它的工作原理非常简单:用户向机器人发送消息,机器人将其发送到私人群组。在私人团体中有来自支持的人。他们只应该回复转发的消息

所以,我已经完成了第一部分 - 将消息从机器人转发到组。如何在我的私人群组中回复此消息并使用 pytelegrambotapi 库将其转发回来?

在这里您可以看到消息如何发送到私人群组

@bot.channel_post_handler(content_types = ['text'])#citySupportName
def process_step2(message):
    bot.forward_message(0000000000, message.chat.id, message.message_id)
    bot.send_message(message.chat.id, "Operator is here!")

【问题讨论】:

  • 我尝试了 bot.copy_message,尝试转发消息,reply_to,但没有任何帮助。或者我得到“机器人无法向机器人发送消息”

标签: python api bots telegram


【解决方案1】:

也许你必须添加这样的聊天类型:

@bot.message_handler(content_types=["text"], chat_types=["private", "group"])

【讨论】:

    【解决方案2】:

    我也有同样的问题。你找到解决这个问题的方法了吗?

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-09-24
    • 2020-08-27
    • 2022-10-19
    • 2020-08-17
    • 1970-01-01
    相关资源
    最近更新 更多