我和telegraf在Node.js上有电报机器人。当有人加入我的Telegram supergroup时,我会得到下面这些道具的msg object:
msg.update.message: {
from: {...}
chat: {
id: -1891113454123,
title: 'Title Group',
type: 'supergroup'
},
date: 1570365406,
new_chat_participant: {
id: 746732141,
is_bot: true,
first_name: 'someBot',
username: 'someBot'
},
new_chat_member: {
id: 746732141,
is_bot: true,
first_name: 'someBot',
username: 'someBot'
},
}
msg.updateSubTypes: [ 'new_chat_members' ],我想用新用户的id做一些业务逻辑,但是我不确定我应该用哪一个:new_chat_participant.id还是new_chat_member.id?它们之间有什么区别?
发布于 2019-10-07 00:00:16
您应该使用new_chat_member。他们已将April 2016中的字段重命名。所以我会用新名字。
我猜他们现在保留旧的是为了向后兼容。
https://stackoverflow.com/questions/58257396
复制相似问题