@azteam/telegram-api
Advanced tools
Comparing version 1.1.76 to 1.1.77
@@ -265,3 +265,5 @@ "use strict"; | ||
reply_markup: JSON.stringify({ | ||
inline_keyboard: menu | ||
keyboard: [menu], | ||
one_time_keyboard: true, | ||
resize_keyboard: true | ||
}) | ||
@@ -284,7 +286,11 @@ })); | ||
if (data.callback_query) { | ||
var from = data.callback_query.from; | ||
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 | ||
text: data.callback_query.data, | ||
groupId: message.chat.id, | ||
place: message.chat.type | ||
}; | ||
@@ -297,4 +303,3 @@ } | ||
text = messageData.text, | ||
entities = messageData.entities, | ||
message_id = messageData.message_id; | ||
entities = messageData.entities; | ||
if (entities) { | ||
@@ -307,3 +312,2 @@ var entity = entities[0]; | ||
return { | ||
messageId: message_id, | ||
messageType: _constant.USER_MESSAGE_TYPE.COMMAND, | ||
@@ -320,3 +324,2 @@ userId: _from.id, | ||
return { | ||
messageId: message_id, | ||
messageType: _constant.USER_MESSAGE_TYPE.TEXT, | ||
@@ -323,0 +326,0 @@ userId: _from.id, |
{ | ||
"name": "@azteam/telegram-api", | ||
"version": "1.1.76", | ||
"version": "1.1.77", | ||
"description": "N/A", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -107,2 +107,3 @@ import HttpClient from '@azteam/http-client'; | ||
} | ||
async sendReplyCallback(id, replyID, message, menu) { | ||
@@ -116,3 +117,5 @@ return this.client.post(`${this.endpoint}/sendMessage`, { | ||
reply_markup: JSON.stringify({ | ||
inline_keyboard: menu, | ||
keyboard: [menu], | ||
one_time_keyboard: true, | ||
resize_keyboard: true, | ||
}), | ||
@@ -124,3 +127,3 @@ }); | ||
if (data.callback_query) { | ||
const {from} = data.callback_query; | ||
const {from, message} = data.callback_query; | ||
@@ -131,2 +134,4 @@ return { | ||
text: data.callback_query.data, | ||
groupId: message.chat.id, | ||
place: message.chat.type, | ||
}; | ||
@@ -137,3 +142,3 @@ } | ||
if (messageData) { | ||
const {from, chat, text, entities, message_id} = messageData; | ||
const {from, chat, text, entities} = messageData; | ||
@@ -148,3 +153,2 @@ if (entities) { | ||
return { | ||
messageId: message_id, | ||
messageType: USER_MESSAGE_TYPE.COMMAND, | ||
@@ -161,3 +165,2 @@ userId: from.id, | ||
return { | ||
messageId: message_id, | ||
messageType: USER_MESSAGE_TYPE.TEXT, | ||
@@ -164,0 +167,0 @@ userId: from.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
30455
555