From bf84556776ca6d7d80fb5724098339c2b23a6aa9 Mon Sep 17 00:00:00 2001 From: teidesu <86301490+teidesu@users.noreply.github.com> Date: Thu, 24 Jun 2021 00:13:10 +0300 Subject: [PATCH] fix(client): made _handleUpdate method public --- packages/client/scripts/generate-client.js | 2 +- packages/client/src/client.ts | 5 +++-- packages/client/src/methods/files/upload-file.ts | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/client/scripts/generate-client.js b/packages/client/scripts/generate-client.js index 3da6d69e..e1302e73 100644 --- a/packages/client/scripts/generate-client.js +++ b/packages/client/scripts/generate-client.js @@ -107,7 +107,7 @@ async function addSingleMethod(state, fileName) { ) } - const isPrivate = name[0] === '_' + const isPrivate = name[0] === '_' && name !== '_handleUpdate' const isExported = (stmt.modifiers || []).find( (mod) => mod.kind === 92 /* ExportKeyword */ ) diff --git a/packages/client/src/client.ts b/packages/client/src/client.ts index 59222832..a4c8ea00 100644 --- a/packages/client/src/client.ts +++ b/packages/client/src/client.ts @@ -1477,7 +1477,7 @@ export interface TelegramClient extends BaseTelegramClient { * sending a message anywhere. Useful when an `InputFile` is required. * * This method is quite low-level, and you should use other - * methods like {@link sendDocument} that handle this under the hood. + * methods like {@link sendMedia} that handle this under the hood. * * @param params Upload parameters */ @@ -2849,6 +2849,7 @@ export interface TelegramClient extends BaseTelegramClient { users: UsersIndex, chats: ChatsIndex ): void + _handleUpdate(update: tl.TypeUpdates, noDispatch?: boolean): void /** * Catch up with the server by loading missed updates. * @@ -3219,7 +3220,7 @@ export class TelegramClient extends BaseTelegramClient { protected _loadStorage = _loadStorage protected _saveStorage = _saveStorage dispatchUpdate = dispatchUpdate - protected _handleUpdate = _handleUpdate + _handleUpdate = _handleUpdate catchUp = catchUp blockUser = blockUser deleteProfilePhotos = deleteProfilePhotos diff --git a/packages/client/src/methods/files/upload-file.ts b/packages/client/src/methods/files/upload-file.ts index 6c35f02a..e679da88 100644 --- a/packages/client/src/methods/files/upload-file.ts +++ b/packages/client/src/methods/files/upload-file.ts @@ -32,7 +32,7 @@ const OVERRIDE_MIME: Record = { * sending a message anywhere. Useful when an `InputFile` is required. * * This method is quite low-level, and you should use other - * methods like {@link sendDocument} that handle this under the hood. + * methods like {@link sendMedia} that handle this under the hood. * * @param params Upload parameters * @internal