gpt4 book ai didi

telegram - 从 Telegram Bot API 获取回复消息

转载 作者:行者123 更新时间:2023-12-03 14:50:00 47 4
gpt4 key购买 nike

我正在开发一个机器人,我希望用户在回复之前的消息时调用它。因此,您将使用 bot 命令回复消息。

例如
用户 1: Hello World
用户 2:(回复 Hello World)/command 测试消息

现在我只能获取命令中直接发送的文本(“测试消息”),而不能获取第一条消息(“Hello World”)。据他们documentation , 我应该可以从 reply_to_message 得到它.但是,我在 webhook 的日志中看到的只是这个。

event: {
body: {
update_id: 5632431,
message: {
message_id: 43,
from: {
id: < my_user_id > ,
first_name: 'User 2',
username: 'user_2_username',
language_code: 'en'
},
chat: {
id: < chat_id > ,
title: < chat_name > ,
type: 'group',
all_members_are_administrators: true
},
date: 1498342725,
text: '/command test message',
entities: [{
type: 'bot_command',
offset: 0,
length: 5
}]
}
}
}


难道我做错了什么?有人有收到回复消息的经验吗?
任何帮助,将不胜感激。

最佳答案

转到@BotFather,然后关闭 privacy mode
/setprivacy — 设置您的机器人在添加到群组时将接收哪些消息。禁用隐私模式后,机器人将接收所有消息。

设置后,您可能需要将您的机器人重新添加到组中。

关于telegram - 从 Telegram Bot API 获取回复消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44741746/

47 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com