From fa17d78fbc9e55f55bd75271fd781500d69f239a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Dur=C3=A1n?= Date: Thu, 28 Apr 2016 20:11:37 +0200 Subject: [PATCH] Revisar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit la nueva API cambia new_chat_participant por new_chat_member. Hay que revisar que la libreria que uses del bot de telegram tambiƩn haya hecho el cambio para la linea 142 bot.on > Renamed the fields new_chat_participant and left_chat_participant of the Message object to new_chat_member and left_chat_member. --- src/main.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.js b/src/main.js index 0bf53a3..60c5a35 100644 --- a/src/main.js +++ b/src/main.js @@ -139,12 +139,12 @@ function init(bot_user) { /// Only welcome people to the main group, /// and only (of course) if the added user isn't the bot - bot.on('new_chat_participant', function (msg) { - if ( msg.new_chat_participant.id === bot_user.id ) + bot.on('new_chat_member', function (msg) { + if ( msg.new_chat_member.id === bot_user.id ) return; if ( msg.chat.id === GROUPS.main_group_id ) - this.sendMessage(msg.chat.id, utils.render(WELCOME_MESSAGE, { name: msg.new_chat_participant.first_name })) + this.sendMessage(msg.chat.id, utils.render(WELCOME_MESSAGE, { name: msg.new_chat_member.first_name })) .catch(utils.DEFAULT_PROMISE_ERROR_HANDLER); });