Skip to content

Commit

Permalink
9d854d2c209f11d7f0090aa8309a33bbd6d4c7a1
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Apr 3, 2024
1 parent 3d857fd commit 2b2112f
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 0 deletions.
4 changes: 4 additions & 0 deletions esm/client/1_business_connection_manager.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { enums, types } from "../2_tl.js";
import { C } from "./0_types.js";
export type BusinessConnectionManagerUpdate = types.UpdateBotBusinessConnect;
export declare class BusinessConnectionManager {
#private;
constructor(c: C);
getBusinessConnection(id: string): Promise<import("../3_types.js").BusinessConnection>;
static canHandleUpdate(update: enums.Update): update is BusinessConnectionManagerUpdate;
handleUpdate(update: BusinessConnectionManagerUpdate): Promise<void>;
}
6 changes: 6 additions & 0 deletions esm/client/1_business_connection_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,11 @@ export class BusinessConnectionManager {
return await constructBusinessConnection(connection_, __classPrivateFieldGet(this, _BusinessConnectionManager_c, "f").getEntity);
}
}
static canHandleUpdate(update) {
return update instanceof types.UpdateBotBusinessConnect;
}
async handleUpdate(update) {
await __classPrivateFieldGet(this, _BusinessConnectionManager_c, "f").messageStorage.setBusinessConnection(update.connection.connection_id, update.connection);
}
}
_BusinessConnectionManager_c = new WeakMap();
3 changes: 3 additions & 0 deletions esm/client/4_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -2241,6 +2241,9 @@ _Client_handleCtxUpdate = async function _Client_handleCtxUpdate(update) {
promises.push(__classPrivateFieldGet(this, _Client_instances, "m", _Client_handleCtxUpdate).call(this, upd));
}
}
if (BusinessConnectionManager.canHandleUpdate(update)) {
await __classPrivateFieldGet(this, _Client_businessConnectionManager, "f").handleUpdate(update);
}
return () => Promise.all(promises);
}, _Client_getMe = async function _Client_getMe() {
if (__classPrivateFieldGet(this, _Client_lastGetMe, "f") != null) {
Expand Down
4 changes: 4 additions & 0 deletions script/client/1_business_connection_manager.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { enums, types } from "../2_tl.js";
import { C } from "./0_types.js";
export type BusinessConnectionManagerUpdate = types.UpdateBotBusinessConnect;
export declare class BusinessConnectionManager {
#private;
constructor(c: C);
getBusinessConnection(id: string): Promise<import("../3_types.js").BusinessConnection>;
static canHandleUpdate(update: enums.Update): update is BusinessConnectionManagerUpdate;
handleUpdate(update: BusinessConnectionManagerUpdate): Promise<void>;
}
6 changes: 6 additions & 0 deletions script/client/1_business_connection_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ class BusinessConnectionManager {
return await (0, _3_types_js_1.constructBusinessConnection)(connection_, __classPrivateFieldGet(this, _BusinessConnectionManager_c, "f").getEntity);
}
}
static canHandleUpdate(update) {
return update instanceof _2_tl_js_1.types.UpdateBotBusinessConnect;
}
async handleUpdate(update) {
await __classPrivateFieldGet(this, _BusinessConnectionManager_c, "f").messageStorage.setBusinessConnection(update.connection.connection_id, update.connection);
}
}
exports.BusinessConnectionManager = BusinessConnectionManager;
_BusinessConnectionManager_c = new WeakMap();
3 changes: 3 additions & 0 deletions script/client/4_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -2246,6 +2246,9 @@ _Client_handleCtxUpdate = async function _Client_handleCtxUpdate(update) {
promises.push(__classPrivateFieldGet(this, _Client_instances, "m", _Client_handleCtxUpdate).call(this, upd));
}
}
if (_1_business_connection_manager_js_1.BusinessConnectionManager.canHandleUpdate(update)) {
await __classPrivateFieldGet(this, _Client_businessConnectionManager, "f").handleUpdate(update);
}
return () => Promise.all(promises);
}, _Client_getMe = async function _Client_getMe() {
if (__classPrivateFieldGet(this, _Client_lastGetMe, "f") != null) {
Expand Down

0 comments on commit 2b2112f

Please sign in to comment.