Skip to content

Commit

Permalink
Try to fix finish init with empty messages
Browse files Browse the repository at this point in the history
  • Loading branch information
painor committed Oct 22, 2024
1 parent 2e8eff3 commit 3d77d52
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion gramjs/Version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const version = "2.25.14";
export const version = "2.26.1";
6 changes: 3 additions & 3 deletions gramjs/client/messageParse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,15 +211,15 @@ 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;
}
if (!isArrayLike(randomId)) {
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;
Expand All @@ -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 = [];
Expand Down
1 change: 1 addition & 0 deletions gramjs/tl/patched/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ function patchClass(clazz: Function) {
function patchAll() {
patchClass(Api.Message);
patchClass(Api.MessageService);
patchClass(Api.MessageEmpty);
}

export { patchAll };
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit 3d77d52

Please sign in to comment.