From 3d77d52531e0c5dd08a095ede833dbd22c36b007 Mon Sep 17 00:00:00 2001 From: Painor Date: Tue, 22 Oct 2024 14:48:11 +0100 Subject: [PATCH] Try to fix finish init with empty messages --- gramjs/Version.ts | 2 +- gramjs/client/messageParse.ts | 6 +++--- gramjs/tl/patched/index.ts | 1 + package-lock.json | 4 ++-- package.json | 2 +- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/gramjs/Version.ts b/gramjs/Version.ts index 4fbdc92a..8424d230 100644 --- a/gramjs/Version.ts +++ b/gramjs/Version.ts @@ -1 +1 @@ -export const version = "2.25.14"; \ No newline at end of file +export const version = "2.26.1"; \ No newline at end of file diff --git a/gramjs/client/messageParse.ts b/gramjs/client/messageParse.ts index 2433fffe..085c2496 100644 --- a/gramjs/client/messageParse.ts +++ b/gramjs/client/messageParse.ts @@ -211,7 +211,7 @@ export function _getResponseMessage( return schedMessage; } client._log.warn( - `No randomId in ${request} to map to. returning undefined for ${result}` + `No randomId in ${request} to map to. returning undefined for ${result} (Message was empty)` ); return undefined; } @@ -219,7 +219,7 @@ export function _getResponseMessage( let msg = idToMessage.get(randomToId.get(randomId.toString())!); if (!msg) { client._log.warn( - `Request ${request.className} had missing message mapping ${result.className}` + `Request ${request.className} had missing message mapping ${result.className} (Message was empty)` ); } return msg; @@ -241,7 +241,7 @@ export function _getResponseMessage( } if (warned) { client._log.warn( - `Request ${request.className} had missing message mapping ${result.className}` + `Request ${request.className} had missing message mapping ${result.className} (Message was empty)` ); } const finalToReturn = []; diff --git a/gramjs/tl/patched/index.ts b/gramjs/tl/patched/index.ts index 7deefe9d..55fb123c 100644 --- a/gramjs/tl/patched/index.ts +++ b/gramjs/tl/patched/index.ts @@ -80,6 +80,7 @@ function patchClass(clazz: Function) { function patchAll() { patchClass(Api.Message); patchClass(Api.MessageService); + patchClass(Api.MessageEmpty); } export { patchAll }; diff --git a/package-lock.json b/package-lock.json index 11c4ba06..a352608d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "telegram", - "version": "2.25.15", + "version": "2.26.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "telegram", - "version": "2.25.15", + "version": "2.26.2", "license": "MIT", "dependencies": { "@cryptography/aes": "^0.1.1", diff --git a/package.json b/package.json index 769da8a8..fb0c9c01 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "telegram", - "version": "2.25.15", + "version": "2.26.2", "description": "NodeJS/Browser MTProto API Telegram client library,", "main": "index.js", "types": "index.d.ts",