@azteam/telegram-api
Advanced tools
Comparing version 1.1.78 to 1.1.79
@@ -286,20 +286,9 @@ "use strict"; | ||
value: function parseMessage(data) { | ||
if (data.callback_query) { | ||
var _data$callback_query = data.callback_query, | ||
from = _data$callback_query.from, | ||
message = _data$callback_query.message; | ||
return { | ||
messageType: _constant.USER_MESSAGE_TYPE.CALLBACK, | ||
userId: from.id, | ||
text: data.callback_query.data, | ||
groupId: message.chat.id, | ||
place: message.chat.type | ||
}; | ||
} | ||
var messageData = data.message || data.edited_message; | ||
if (messageData) { | ||
var _from = messageData.from, | ||
var from = messageData.from, | ||
chat = messageData.chat, | ||
text = messageData.text, | ||
entities = messageData.entities; | ||
entities = messageData.entities, | ||
messageId = messageData.message_id; | ||
if (entities) { | ||
@@ -313,3 +302,4 @@ var entity = entities[0]; | ||
messageType: _constant.USER_MESSAGE_TYPE.COMMAND, | ||
userId: _from.id, | ||
messageId: messageId, | ||
userId: from.id, | ||
text: parseText, | ||
@@ -325,3 +315,4 @@ groupId: chat.id, | ||
messageType: _constant.USER_MESSAGE_TYPE.TEXT, | ||
userId: _from.id, | ||
messageId: messageId, | ||
userId: from.id, | ||
groupId: chat.id, | ||
@@ -328,0 +319,0 @@ place: chat.type, |
{ | ||
"name": "@azteam/telegram-api", | ||
"version": "1.1.78", | ||
"version": "1.1.79", | ||
"description": "N/A", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -127,17 +127,5 @@ import HttpClient from '@azteam/http-client'; | ||
static parseMessage(data) { | ||
if (data.callback_query) { | ||
const {from, message} = data.callback_query; | ||
return { | ||
messageType: USER_MESSAGE_TYPE.CALLBACK, | ||
userId: from.id, | ||
text: data.callback_query.data, | ||
groupId: message.chat.id, | ||
place: message.chat.type, | ||
}; | ||
} | ||
const messageData = data.message || data.edited_message; | ||
if (messageData) { | ||
const {from, chat, text, entities} = messageData; | ||
const {from, chat, text, entities, message_id: messageId} = messageData; | ||
@@ -153,2 +141,3 @@ if (entities) { | ||
messageType: USER_MESSAGE_TYPE.COMMAND, | ||
messageId, | ||
userId: from.id, | ||
@@ -165,2 +154,3 @@ text: parseText, | ||
messageType: USER_MESSAGE_TYPE.TEXT, | ||
messageId, | ||
userId: from.id, | ||
@@ -167,0 +157,0 @@ groupId: chat.id, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
30028
542