switch-bots
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -47,3 +47,2 @@ "use strict"; | ||
}); | ||
console.log(this._handlers); | ||
} | ||
@@ -50,0 +49,0 @@ onMessage(handler) { |
@@ -325,3 +325,2 @@ "use strict"; | ||
.parseFromData(data, this); | ||
console.log(message.commandParams); | ||
await handler.fn(message); | ||
@@ -328,0 +327,0 @@ } |
@@ -26,2 +26,3 @@ "use strict"; | ||
} | ||
requestData.inline_markup = requestData.inlineMarkup; | ||
const message = await client.request(requestUrl, { | ||
@@ -36,2 +37,6 @@ method: "POST", | ||
const requestData = { ...params }; | ||
if (!requestData.id) { | ||
requestData.id = messageId; | ||
} | ||
; | ||
// Handle inline markup | ||
@@ -112,3 +117,3 @@ if (requestData.inlineMarkup) { | ||
async function getMessage(client, messageId) { | ||
const response = await client.request(`${endpoints_1.Endpoints.CHAT_SERVICE_URL}/v1/message/${messageId}`, { | ||
const response = await client.request(`${endpoints_1.Endpoints.CHAT_SERVICE_URL}/v1/message/findOne/${messageId}`, { | ||
method: "GET", | ||
@@ -115,0 +120,0 @@ }); |
@@ -44,5 +44,5 @@ "use strict"; | ||
static parseMessageFromJson(data, client) { | ||
let message = data?.details | ||
let message = data?.id ? data : (data?.details | ||
? data["details"]["message"] | ||
: data["message"]; | ||
: data["message"]); | ||
const response = new Message({ | ||
@@ -57,3 +57,5 @@ message: message["message"], | ||
response.personalChat = message["personalChat"]; | ||
response.sender = (0, user_1.parseSender)(data?.details ? data["details"]["sender"] : message["senderInfo"]); | ||
if (data?.details?.sender || message.senderInfo) { | ||
response.sender = (0, user_1.parseSender)(data?.details?.sender || message.senderInfo); | ||
} | ||
if (data?.details?.receiver) { | ||
@@ -60,0 +62,0 @@ response.receiver = (0, user_1.parseSender)(data["details"]["receiver"]); |
{ | ||
"name": "switch-bots", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Switch API TypeScript SDK for building bots and applications", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
136517
3217
3