@mtkruto/browser 0.119.0 → 0.119.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/0_errors.d.ts.map +1 -1
- package/esm/0_errors.js +9 -31
- package/esm/3_errors.js +2 -12
- package/esm/4_errors.js +2 -12
- package/esm/_dnt.polyfills.d.ts +0 -99
- package/esm/_dnt.polyfills.d.ts.map +1 -1
- package/esm/_dnt.polyfills.js +1 -127
- package/esm/client/0_abortable_loop.js +26 -39
- package/esm/client/0_storage_operations.js +179 -218
- package/esm/client/1_client_plain.js +4 -22
- package/esm/client/2_account_manager.js +140 -149
- package/esm/client/2_bot_info_manager.js +26 -38
- package/esm/client/2_business_connection_manager.js +10 -23
- package/esm/client/2_client_encrypted.js +198 -215
- package/esm/client/2_file_manager.js +255 -262
- package/esm/client/2_network_statistics_manager.js +31 -44
- package/esm/client/2_payment_manager.js +7 -20
- package/esm/client/2_reaction_manager.js +7 -20
- package/esm/client/2_translations_manager.js +101 -111
- package/esm/client/2_update_manager.js +750 -745
- package/esm/client/3_client_encrypted_pool.js +10 -26
- package/esm/client/3_message_manager.js +503 -508
- package/esm/client/3_video_chat_manager.js +57 -68
- package/esm/client/4_callback_query_manager.js +18 -30
- package/esm/client/4_chat_list_manager.js +140 -146
- package/esm/client/4_chat_manager.js +161 -169
- package/esm/client/4_checklist_manager.js +26 -39
- package/esm/client/4_context.js +244 -259
- package/esm/client/4_forum_manager.js +67 -73
- package/esm/client/4_gift_manager.js +22 -35
- package/esm/client/4_inline_query_manager.js +16 -28
- package/esm/client/4_link_preview_manager.js +6 -19
- package/esm/client/4_poll_manager.js +44 -57
- package/esm/client/4_story_manager.js +41 -53
- package/esm/client/5_composer.js +13 -26
- package/esm/client/6_client.js +866 -896
- package/esm/client/6_client_dispatcher.js +308 -325
- package/esm/client/7_client_worker.js +16 -29
- package/esm/connection/1_connection_tcp.js +55 -82
- package/esm/connection/1_connection_web_socket.js +75 -91
- package/esm/deps/jsr.io/@roj/tgcrypto/1.0.1/dist/tgcrypto.js +3 -11
- package/esm/deps/jsr.io/@std/async/1.2.0/mux_async_iterator.js +31 -47
- package/esm/deps/jsr.io/@std/async/1.2.0/tee.js +11 -34
- package/esm/deps/jsr.io/@std/cache/0.2.2/lru_cache.js +30 -47
- package/esm/deps/jsr.io/@std/datetime/0.225.7/_date_time_formatter.js +4 -17
- package/esm/session/0_session_state.js +12 -38
- package/esm/session/1_session.js +49 -72
- package/esm/session/2_session_encrypted.js +422 -420
- package/esm/storage/2_storage_indexed_db.js +26 -44
- package/esm/storage/2_storage_local_storage.js +3 -16
- package/esm/storage/2_storage_memory.js +24 -41
- package/esm/storage/2_storage_session_storage.js +3 -16
- package/esm/tl/1_tl_reader.d.ts +1 -1
- package/esm/tl/1_tl_reader.d.ts.map +1 -1
- package/esm/tl/1_tl_reader.js +95 -103
- package/esm/tl/1_tl_writer.js +169 -178
- package/esm/transport/0_transport.js +1 -8
- package/esm/transport/1_transport_abridged.js +11 -24
- package/esm/transport/1_transport_intermediate.js +10 -23
- package/esm/utilities/0_mutex.js +4 -19
- package/esm/utilities/0_part_stream.js +11 -25
- package/esm/utilities/1_crypto.js +42 -53
- package/esm/utilities/2_queue.js +29 -47
- package/package.json +1 -1
- package/script/0_errors.d.ts.map +1 -1
- package/script/0_errors.js +9 -31
- package/script/3_errors.js +2 -12
- package/script/4_errors.js +2 -12
- package/script/_dnt.polyfills.d.ts +0 -99
- package/script/_dnt.polyfills.d.ts.map +1 -1
- package/script/_dnt.polyfills.js +0 -128
- package/script/client/0_abortable_loop.js +27 -40
- package/script/client/0_storage_operations.js +179 -218
- package/script/client/1_client_plain.js +4 -22
- package/script/client/2_account_manager.js +140 -149
- package/script/client/2_bot_info_manager.js +26 -38
- package/script/client/2_business_connection_manager.js +10 -23
- package/script/client/2_client_encrypted.js +199 -216
- package/script/client/2_file_manager.js +255 -262
- package/script/client/2_network_statistics_manager.js +32 -45
- package/script/client/2_payment_manager.js +7 -20
- package/script/client/2_reaction_manager.js +7 -20
- package/script/client/2_translations_manager.js +102 -112
- package/script/client/2_update_manager.js +750 -745
- package/script/client/3_client_encrypted_pool.js +10 -26
- package/script/client/3_message_manager.js +503 -508
- package/script/client/3_video_chat_manager.js +57 -68
- package/script/client/4_callback_query_manager.js +18 -30
- package/script/client/4_chat_list_manager.js +140 -146
- package/script/client/4_chat_manager.js +161 -169
- package/script/client/4_checklist_manager.js +26 -39
- package/script/client/4_context.js +244 -259
- package/script/client/4_forum_manager.js +67 -73
- package/script/client/4_gift_manager.js +22 -35
- package/script/client/4_inline_query_manager.js +16 -28
- package/script/client/4_link_preview_manager.js +6 -19
- package/script/client/4_poll_manager.js +44 -57
- package/script/client/4_story_manager.js +41 -53
- package/script/client/5_composer.js +13 -26
- package/script/client/6_client.js +866 -896
- package/script/client/6_client_dispatcher.js +308 -325
- package/script/client/7_client_worker.js +16 -29
- package/script/connection/1_connection_tcp.js +55 -82
- package/script/connection/1_connection_web_socket.js +75 -91
- package/script/deps/jsr.io/@roj/tgcrypto/1.0.1/dist/tgcrypto.js +3 -11
- package/script/deps/jsr.io/@std/async/1.2.0/mux_async_iterator.js +31 -47
- package/script/deps/jsr.io/@std/async/1.2.0/tee.js +11 -34
- package/script/deps/jsr.io/@std/cache/0.2.2/lru_cache.js +30 -47
- package/script/deps/jsr.io/@std/datetime/0.225.7/_date_time_formatter.js +4 -17
- package/script/session/0_session_state.js +12 -38
- package/script/session/1_session.js +49 -72
- package/script/session/2_session_encrypted.js +423 -421
- package/script/storage/2_storage_indexed_db.js +26 -44
- package/script/storage/2_storage_local_storage.js +3 -16
- package/script/storage/2_storage_memory.js +24 -41
- package/script/storage/2_storage_session_storage.js +3 -16
- package/script/tl/1_tl_reader.d.ts +1 -1
- package/script/tl/1_tl_reader.d.ts.map +1 -1
- package/script/tl/1_tl_reader.js +96 -104
- package/script/tl/1_tl_writer.js +170 -179
- package/script/transport/0_transport.js +1 -8
- package/script/transport/1_transport_abridged.js +11 -24
- package/script/transport/1_transport_intermediate.js +10 -23
- package/script/utilities/0_mutex.js +4 -19
- package/script/utilities/0_part_stream.js +11 -25
- package/script/utilities/1_crypto.js +43 -54
- package/script/utilities/2_queue.js +30 -48
|
@@ -18,18 +18,6 @@
|
|
|
18
18
|
* You should have received a copy of the GNU Lesser General Public License
|
|
19
19
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
20
20
|
*/
|
|
21
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
22
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
23
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
24
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
25
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
26
|
-
};
|
|
27
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
28
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
29
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
30
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
31
|
-
};
|
|
32
|
-
var _ClientDispatcher_instances, _ClientDispatcher_worker, _ClientDispatcher_id, _ClientDispatcher_L, _ClientDispatcher_LsignIn, _ClientDispatcher_pendingRequests, _ClientDispatcher_dispatch, _ClientDispatcher_isInited, _ClientDispatcher_invoke, _ClientDispatcher_handleInvokeError;
|
|
33
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
34
22
|
exports.ClientDispatcher = void 0;
|
|
35
23
|
const _1_utilities_js_1 = require("../1_utilities.js");
|
|
@@ -39,56 +27,28 @@ const _1_invoke_middleware_js_1 = require("./1_invoke_middleware.js");
|
|
|
39
27
|
const _2_sign_in_js_1 = require("./2_sign_in.js");
|
|
40
28
|
const _5_composer_js_1 = require("./5_composer.js");
|
|
41
29
|
class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
30
|
+
#worker;
|
|
31
|
+
#id;
|
|
32
|
+
#L;
|
|
33
|
+
#LsignIn;
|
|
34
|
+
// deno-lint-ignore no-explicit-any
|
|
35
|
+
#pendingRequests = new Map();
|
|
42
36
|
constructor(worker, id) {
|
|
43
37
|
super();
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
_ClientDispatcher_LsignIn.set(this, void 0);
|
|
49
|
-
// deno-lint-ignore no-explicit-any
|
|
50
|
-
_ClientDispatcher_pendingRequests.set(this, new Map());
|
|
51
|
-
_ClientDispatcher_isInited.set(this, false);
|
|
52
|
-
_ClientDispatcher_handleInvokeError.set(this, (0, _1_invoke_middleware_js_1.skipInvoke)());
|
|
53
|
-
/**
|
|
54
|
-
* Invokes a function waiting and returning its reply.
|
|
55
|
-
* Requires the client to be connected.
|
|
56
|
-
*
|
|
57
|
-
* @param function_ The function to invoke.
|
|
58
|
-
*/
|
|
59
|
-
Object.defineProperty(this, "invoke", {
|
|
60
|
-
enumerable: true,
|
|
61
|
-
configurable: true,
|
|
62
|
-
writable: true,
|
|
63
|
-
value: Object.assign(__classPrivateFieldGet(this, _ClientDispatcher_instances, "m", _ClientDispatcher_invoke), {
|
|
64
|
-
use: (handler) => {
|
|
65
|
-
const handle = __classPrivateFieldGet(this, _ClientDispatcher_handleInvokeError, "f");
|
|
66
|
-
__classPrivateFieldSet(this, _ClientDispatcher_handleInvokeError, async (ctx, next) => {
|
|
67
|
-
let result = null;
|
|
68
|
-
return await handle(ctx, async () => {
|
|
69
|
-
if (result !== null)
|
|
70
|
-
return result;
|
|
71
|
-
result = await handler(ctx, next);
|
|
72
|
-
return result;
|
|
73
|
-
});
|
|
74
|
-
}, "f");
|
|
75
|
-
},
|
|
76
|
-
})
|
|
77
|
-
});
|
|
78
|
-
__classPrivateFieldSet(this, _ClientDispatcher_worker, worker, "f");
|
|
79
|
-
__classPrivateFieldSet(this, _ClientDispatcher_id, id, "f");
|
|
80
|
-
__classPrivateFieldSet(this, _ClientDispatcher_L, (0, _1_utilities_js_1.getLogger)("ClientDispatcher").branch(__classPrivateFieldGet(this, _ClientDispatcher_id, "f")), "f");
|
|
81
|
-
__classPrivateFieldSet(this, _ClientDispatcher_LsignIn, __classPrivateFieldGet(this, _ClientDispatcher_L, "f").branch("signIn"), "f");
|
|
38
|
+
this.#worker = worker;
|
|
39
|
+
this.#id = id;
|
|
40
|
+
this.#L = (0, _1_utilities_js_1.getLogger)("ClientDispatcher").branch(this.#id);
|
|
41
|
+
this.#LsignIn = this.#L.branch("signIn");
|
|
82
42
|
}
|
|
83
43
|
/** @internal */
|
|
84
44
|
async handleResponse(response) {
|
|
85
|
-
if (response.clientId !==
|
|
45
|
+
if (response.clientId !== this.#id) {
|
|
86
46
|
return;
|
|
87
47
|
}
|
|
88
|
-
|
|
48
|
+
this.#L.debug("handling response message", response);
|
|
89
49
|
if (response.isError) {
|
|
90
|
-
|
|
91
|
-
|
|
50
|
+
this.#pendingRequests.get(response.id)?.reject((0, _0_worker_error_js_1.deserializeWorkerError)(response.data));
|
|
51
|
+
this.#pendingRequests.delete(response.id);
|
|
92
52
|
}
|
|
93
53
|
else {
|
|
94
54
|
if (response.id === "") {
|
|
@@ -96,45 +56,99 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
96
56
|
await this.handleUpdate(this, response.data);
|
|
97
57
|
}
|
|
98
58
|
catch (err) {
|
|
99
|
-
|
|
59
|
+
this.#L.error("Error handling update:", err);
|
|
100
60
|
}
|
|
101
61
|
}
|
|
102
62
|
else {
|
|
103
|
-
|
|
104
|
-
|
|
63
|
+
this.#pendingRequests.get(response.id)?.resolve(response.data);
|
|
64
|
+
this.#pendingRequests.delete(response.id);
|
|
105
65
|
}
|
|
106
66
|
}
|
|
107
67
|
}
|
|
108
68
|
get id() {
|
|
109
|
-
return
|
|
69
|
+
return this.#id;
|
|
110
70
|
}
|
|
71
|
+
async #dispatch(method, ...args) {
|
|
72
|
+
// deno-lint-ignore no-explicit-any
|
|
73
|
+
const promiseWithResolvers = Promise.withResolvers();
|
|
74
|
+
const id = crypto.randomUUID();
|
|
75
|
+
this.#pendingRequests.set(id, promiseWithResolvers);
|
|
76
|
+
const request = {
|
|
77
|
+
type: "request",
|
|
78
|
+
clientId: this.#id,
|
|
79
|
+
id,
|
|
80
|
+
method,
|
|
81
|
+
args,
|
|
82
|
+
};
|
|
83
|
+
this.#L.debug("posted message to worker", request);
|
|
84
|
+
this.#worker.postMessage(request);
|
|
85
|
+
return await promiseWithResolvers.promise;
|
|
86
|
+
}
|
|
87
|
+
#isInited = false;
|
|
111
88
|
async init(params) {
|
|
112
|
-
if (
|
|
89
|
+
if (this.#isInited) {
|
|
113
90
|
return;
|
|
114
91
|
}
|
|
115
|
-
|
|
116
|
-
return await
|
|
92
|
+
this.#isInited = true;
|
|
93
|
+
return await this.#dispatch("initClient", params);
|
|
117
94
|
}
|
|
118
95
|
async connect() {
|
|
119
|
-
return await
|
|
96
|
+
return await this.#dispatch("connect");
|
|
120
97
|
}
|
|
121
98
|
async disconnect() {
|
|
122
|
-
return await
|
|
99
|
+
return await this.#dispatch("disconnect");
|
|
123
100
|
}
|
|
124
101
|
async start(params) {
|
|
125
102
|
await this.connect();
|
|
126
103
|
await this.signIn(params);
|
|
127
104
|
}
|
|
105
|
+
async #invoke(function_, params) {
|
|
106
|
+
let n = 1;
|
|
107
|
+
while (true) {
|
|
108
|
+
try {
|
|
109
|
+
return await this.#dispatch("invoke", function_, params);
|
|
110
|
+
}
|
|
111
|
+
catch (err) {
|
|
112
|
+
if (await this.#handleInvokeError(Object.freeze({ client: this, error: err, function: function_, n: n++ }), () => Promise.resolve(false))) {
|
|
113
|
+
continue;
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
throw err;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
#handleInvokeError = (0, _1_invoke_middleware_js_1.skipInvoke)();
|
|
128
122
|
/** @internal */
|
|
129
123
|
async handleInvokeError(request) {
|
|
130
124
|
const args = request.args[0];
|
|
131
|
-
return await
|
|
125
|
+
return await this.#handleInvokeError({
|
|
132
126
|
client: this,
|
|
133
127
|
error: (0, _0_worker_error_js_1.deserializeWorkerError)(args.error),
|
|
134
128
|
function: args.function,
|
|
135
129
|
n: args.n,
|
|
136
130
|
}, () => Promise.resolve(false));
|
|
137
131
|
}
|
|
132
|
+
/**
|
|
133
|
+
* Invokes a function waiting and returning its reply.
|
|
134
|
+
* Requires the client to be connected.
|
|
135
|
+
*
|
|
136
|
+
* @param function_ The function to invoke.
|
|
137
|
+
*/
|
|
138
|
+
invoke = Object.assign(this.#invoke, {
|
|
139
|
+
use: (handler) => {
|
|
140
|
+
const handle = this.#handleInvokeError;
|
|
141
|
+
this.#handleInvokeError = async (ctx, next) => {
|
|
142
|
+
let result = null;
|
|
143
|
+
return await handle(ctx, async () => {
|
|
144
|
+
if (result !== null)
|
|
145
|
+
return result;
|
|
146
|
+
result = await handler(ctx, next);
|
|
147
|
+
return result;
|
|
148
|
+
});
|
|
149
|
+
};
|
|
150
|
+
},
|
|
151
|
+
});
|
|
138
152
|
/**
|
|
139
153
|
* Send a user verification code.
|
|
140
154
|
*
|
|
@@ -142,7 +156,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
142
156
|
* @method ac
|
|
143
157
|
*/
|
|
144
158
|
async sendCode(phoneNumber) {
|
|
145
|
-
return await
|
|
159
|
+
return await this.#dispatch("sendCode", phoneNumber);
|
|
146
160
|
}
|
|
147
161
|
/**
|
|
148
162
|
* Check if a code entered by the user was the same as the verification code.
|
|
@@ -151,7 +165,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
151
165
|
* @method ac
|
|
152
166
|
*/
|
|
153
167
|
async checkCode(code) {
|
|
154
|
-
return await
|
|
168
|
+
return await this.#dispatch("checkCode", code);
|
|
155
169
|
}
|
|
156
170
|
/**
|
|
157
171
|
* Get the user account password's hint.
|
|
@@ -159,7 +173,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
159
173
|
* @method ac
|
|
160
174
|
*/
|
|
161
175
|
async getPasswordHint() {
|
|
162
|
-
return await
|
|
176
|
+
return await this.#dispatch("getPasswordHint");
|
|
163
177
|
}
|
|
164
178
|
/**
|
|
165
179
|
* Check whether a password entered by the user is the same as the account's one.
|
|
@@ -169,7 +183,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
169
183
|
* @method ac
|
|
170
184
|
*/
|
|
171
185
|
async checkPassword(password) {
|
|
172
|
-
return await
|
|
186
|
+
return await this.#dispatch("checkPassword", password);
|
|
173
187
|
}
|
|
174
188
|
/**
|
|
175
189
|
* Check whether a bot token is valid.
|
|
@@ -179,7 +193,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
179
193
|
* @method ac
|
|
180
194
|
*/
|
|
181
195
|
async checkBotToken(botToken) {
|
|
182
|
-
return await
|
|
196
|
+
return await this.#dispatch("checkBotToken", botToken);
|
|
183
197
|
}
|
|
184
198
|
/**
|
|
185
199
|
* Signs in using the provided parameters if not already signed in.
|
|
@@ -190,16 +204,16 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
190
204
|
* 3. Reconnects the client to the appropriate DC in case of MIGRATE_X errors.
|
|
191
205
|
*/
|
|
192
206
|
async signIn(params) {
|
|
193
|
-
await (0, _2_sign_in_js_1.signIn)(this,
|
|
207
|
+
await (0, _2_sign_in_js_1.signIn)(this, this.#LsignIn, params);
|
|
194
208
|
}
|
|
195
209
|
async signOut() {
|
|
196
|
-
return await
|
|
210
|
+
return await this.#dispatch("signOut");
|
|
197
211
|
}
|
|
198
212
|
async exportAuthString() {
|
|
199
|
-
return await
|
|
213
|
+
return await this.#dispatch("exportAuthString");
|
|
200
214
|
}
|
|
201
215
|
async importAuthString(authString) {
|
|
202
|
-
return await
|
|
216
|
+
return await this.#dispatch("importAuthString", authString);
|
|
203
217
|
}
|
|
204
218
|
/**
|
|
205
219
|
* Get a chat's inputPeer. Useful when calling API functions directly.
|
|
@@ -207,7 +221,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
207
221
|
* @param id The identifier of a chat.
|
|
208
222
|
*/
|
|
209
223
|
async getInputPeer(id) {
|
|
210
|
-
return await
|
|
224
|
+
return await this.#dispatch("getInputPeer", id);
|
|
211
225
|
}
|
|
212
226
|
/**
|
|
213
227
|
* Get a channel or a supergroup's inputChannel. Useful when calling API functions directly.
|
|
@@ -215,7 +229,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
215
229
|
* @param id The identifier of the channel or the supergroup.
|
|
216
230
|
*/
|
|
217
231
|
async getInputChannel(id) {
|
|
218
|
-
return await
|
|
232
|
+
return await this.#dispatch("getInputChannel", id);
|
|
219
233
|
}
|
|
220
234
|
/**
|
|
221
235
|
* Get a user's inputUser. Useful when calling API functions directly.
|
|
@@ -223,7 +237,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
223
237
|
* @param id The identifier of the user.
|
|
224
238
|
*/
|
|
225
239
|
async getInputUser(id) {
|
|
226
|
-
return await
|
|
240
|
+
return await this.#dispatch("getInputUser", id);
|
|
227
241
|
}
|
|
228
242
|
//
|
|
229
243
|
// ========================= ACCOUNT ========================= //
|
|
@@ -235,7 +249,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
235
249
|
* @returns Information on the currently authorized user.
|
|
236
250
|
*/
|
|
237
251
|
async getMe() {
|
|
238
|
-
return await
|
|
252
|
+
return await this.#dispatch("getMe");
|
|
239
253
|
}
|
|
240
254
|
/**
|
|
241
255
|
* Show a username in the current account, a bot account, a supergroup, or a channel's profile. User-only.
|
|
@@ -245,7 +259,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
245
259
|
* @param username The username to show.
|
|
246
260
|
*/
|
|
247
261
|
async showUsername(id, username) {
|
|
248
|
-
return await
|
|
262
|
+
return await this.#dispatch("showUsername", id, username);
|
|
249
263
|
}
|
|
250
264
|
/**
|
|
251
265
|
* Hide a username from the current account, a bot account, a supergroup, or a channel's profile. User-only.
|
|
@@ -255,7 +269,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
255
269
|
* @param username The username to hide.
|
|
256
270
|
*/
|
|
257
271
|
async hideUsername(id, username) {
|
|
258
|
-
return await
|
|
272
|
+
return await this.#dispatch("hideUsername", id, username);
|
|
259
273
|
}
|
|
260
274
|
/**
|
|
261
275
|
* Check the availability of a username. User-only.
|
|
@@ -265,7 +279,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
265
279
|
* @returns Whether the username is available.
|
|
266
280
|
*/
|
|
267
281
|
async checkUsername(username, params) {
|
|
268
|
-
return await
|
|
282
|
+
return await this.#dispatch("checkUsername", username, params);
|
|
269
283
|
}
|
|
270
284
|
/**
|
|
271
285
|
* Set the username of the current account. User-only.
|
|
@@ -274,7 +288,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
274
288
|
* @param username The username to set.
|
|
275
289
|
*/
|
|
276
290
|
async setUsername(username) {
|
|
277
|
-
return await
|
|
291
|
+
return await this.#dispatch("setUsername", username);
|
|
278
292
|
}
|
|
279
293
|
/**
|
|
280
294
|
* Remove the current account's username. User-only.
|
|
@@ -282,7 +296,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
282
296
|
* @method ac
|
|
283
297
|
*/
|
|
284
298
|
async removeUsername() {
|
|
285
|
-
return await
|
|
299
|
+
return await this.#dispatch("removeUsername");
|
|
286
300
|
}
|
|
287
301
|
/**
|
|
288
302
|
* Reorder the usernames of the current account, a bot account, a supergroup, or a channel's profile. User-only.
|
|
@@ -293,7 +307,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
293
307
|
* @returns Whether the order was changed.
|
|
294
308
|
*/
|
|
295
309
|
async reorderUsernames(id, order) {
|
|
296
|
-
return await
|
|
310
|
+
return await this.#dispatch("reorderUsernames", id, order);
|
|
297
311
|
}
|
|
298
312
|
/**
|
|
299
313
|
* Hide all usernames from a supergroup or a channel's profile. User-only.
|
|
@@ -303,7 +317,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
303
317
|
* @returns Whether any username was hidden.
|
|
304
318
|
*/
|
|
305
319
|
async hideUsernames(id) {
|
|
306
|
-
return await
|
|
320
|
+
return await this.#dispatch("hideUsernames", id);
|
|
307
321
|
}
|
|
308
322
|
/**
|
|
309
323
|
* Get a business connection. Bot-only.
|
|
@@ -313,7 +327,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
313
327
|
* @cache
|
|
314
328
|
*/
|
|
315
329
|
async getBusinessConnection(id) {
|
|
316
|
-
return await
|
|
330
|
+
return await this.#dispatch("getBusinessConnection", id);
|
|
317
331
|
}
|
|
318
332
|
/**
|
|
319
333
|
* Set the current account's online status. User-only.
|
|
@@ -322,7 +336,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
322
336
|
* @param isOnline The new online status.
|
|
323
337
|
*/
|
|
324
338
|
async setIsOnline(isOnline) {
|
|
325
|
-
return await
|
|
339
|
+
return await this.#dispatch("setOnline", isOnline);
|
|
326
340
|
}
|
|
327
341
|
/**
|
|
328
342
|
* Set the current account's emoji status. User-only.
|
|
@@ -331,7 +345,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
331
345
|
* @param emojiStatus The emoji or gift to set as the new emoji status.
|
|
332
346
|
*/
|
|
333
347
|
async setEmojiStatus(emojiStatus, params) {
|
|
334
|
-
return await
|
|
348
|
+
return await this.#dispatch("setEmojiStatus", emojiStatus, params);
|
|
335
349
|
}
|
|
336
350
|
/**
|
|
337
351
|
* Remove the current account's emoji status. User-only.
|
|
@@ -339,7 +353,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
339
353
|
* @method ac
|
|
340
354
|
*/
|
|
341
355
|
async removeEmojiStatus() {
|
|
342
|
-
return await
|
|
356
|
+
return await this.#dispatch("removeEmojiStatus");
|
|
343
357
|
}
|
|
344
358
|
/**
|
|
345
359
|
* Set the emoji status of a channel. User-only.
|
|
@@ -349,7 +363,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
349
363
|
* @param emojiStatus The emoji or gift to set as the new emoji status.
|
|
350
364
|
*/
|
|
351
365
|
async setChannelEmojiStatus(chatId, emojiStatus, params) {
|
|
352
|
-
return await
|
|
366
|
+
return await this.#dispatch("setChannelEmojiStatus", chatId, emojiStatus, params);
|
|
353
367
|
}
|
|
354
368
|
/**
|
|
355
369
|
* Remove the emoji status of a channel. User-only.
|
|
@@ -358,7 +372,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
358
372
|
* @param chatId The identifier of a channel.
|
|
359
373
|
*/
|
|
360
374
|
async removeChannelEmojiStatus(chatId) {
|
|
361
|
-
return await
|
|
375
|
+
return await this.#dispatch("removeChannelEmojiStatus", chatId);
|
|
362
376
|
}
|
|
363
377
|
/**
|
|
364
378
|
* Set the emoji status of a bot's user. Bot-only.
|
|
@@ -368,7 +382,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
368
382
|
* @param emojiStatus The emoji or gift to set as the new emoji status.
|
|
369
383
|
*/
|
|
370
384
|
async setUserEmojiStatus(userId, emojiStatus, params) {
|
|
371
|
-
return await
|
|
385
|
+
return await this.#dispatch("setUserEmojiStatus", userId, emojiStatus, params);
|
|
372
386
|
}
|
|
373
387
|
/**
|
|
374
388
|
* Remove the emoji status of a bot's user. Bot-only.
|
|
@@ -377,7 +391,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
377
391
|
* @param userId The identifier of a user of the bot.
|
|
378
392
|
*/
|
|
379
393
|
async removeUserEmojiStatus(userId) {
|
|
380
|
-
return await
|
|
394
|
+
return await this.#dispatch("removeUserEmojiStatus", userId);
|
|
381
395
|
}
|
|
382
396
|
/**
|
|
383
397
|
* Update the profile of the current user. At least one parameter must be specified. User-only.
|
|
@@ -385,7 +399,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
385
399
|
* @method ac
|
|
386
400
|
*/
|
|
387
401
|
async updateProfile(params) {
|
|
388
|
-
return await
|
|
402
|
+
return await this.#dispatch("updateProfile", params);
|
|
389
403
|
}
|
|
390
404
|
/**
|
|
391
405
|
* Set the birthday of the current user. User-only.
|
|
@@ -393,7 +407,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
393
407
|
* @method ac
|
|
394
408
|
*/
|
|
395
409
|
async setBirthday(params) {
|
|
396
|
-
return await
|
|
410
|
+
return await this.#dispatch("setBirthday", params);
|
|
397
411
|
}
|
|
398
412
|
/**
|
|
399
413
|
* Set the personal channel of the current user. User-only.
|
|
@@ -401,7 +415,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
401
415
|
* @method ac
|
|
402
416
|
*/
|
|
403
417
|
async setPersonalChannel(params) {
|
|
404
|
-
return await
|
|
418
|
+
return await this.#dispatch("setPersonalChannel", params);
|
|
405
419
|
}
|
|
406
420
|
/**
|
|
407
421
|
* Set the name color of the current user. User-only.
|
|
@@ -410,7 +424,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
410
424
|
* @param color The identifier of the color to set.
|
|
411
425
|
*/
|
|
412
426
|
async setNameColor(color, params) {
|
|
413
|
-
return await
|
|
427
|
+
return await this.#dispatch("setNameColor", color, params);
|
|
414
428
|
}
|
|
415
429
|
/**
|
|
416
430
|
* Set the profile color of the current user. User-only.
|
|
@@ -419,7 +433,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
419
433
|
* @param color The identifier of the color to set.
|
|
420
434
|
*/
|
|
421
435
|
async setProfileColor(color, params) {
|
|
422
|
-
return await
|
|
436
|
+
return await this.#dispatch("setProfileColor", color, params);
|
|
423
437
|
}
|
|
424
438
|
/**
|
|
425
439
|
* Set the location of the current user. User-only.
|
|
@@ -427,7 +441,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
427
441
|
* @method ac
|
|
428
442
|
*/
|
|
429
443
|
async setLocation(params) {
|
|
430
|
-
return await
|
|
444
|
+
return await this.#dispatch("setLocation", params);
|
|
431
445
|
}
|
|
432
446
|
/**
|
|
433
447
|
* Set the working hours of the current user. User-only.
|
|
@@ -435,7 +449,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
435
449
|
* @method ac
|
|
436
450
|
*/
|
|
437
451
|
async setWorkingHours(params) {
|
|
438
|
-
return await
|
|
452
|
+
return await this.#dispatch("setWorkingHours", params);
|
|
439
453
|
}
|
|
440
454
|
/**
|
|
441
455
|
* Enable sponsored messages on the current user. User-only.
|
|
@@ -443,7 +457,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
443
457
|
* @method ac
|
|
444
458
|
*/
|
|
445
459
|
async enableSponsoredMessages() {
|
|
446
|
-
return await
|
|
460
|
+
return await this.#dispatch("enableSponsoredMessages");
|
|
447
461
|
}
|
|
448
462
|
/**
|
|
449
463
|
* Disable sponsored messages on the current user. User-only.
|
|
@@ -451,7 +465,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
451
465
|
* @method ac
|
|
452
466
|
*/
|
|
453
467
|
async disableSponsoredMessages() {
|
|
454
|
-
return await
|
|
468
|
+
return await this.#dispatch("disableSponsoredMessages");
|
|
455
469
|
}
|
|
456
470
|
/**
|
|
457
471
|
* Pause the business bot in a chat. User-only.
|
|
@@ -459,7 +473,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
459
473
|
* @method ac
|
|
460
474
|
*/
|
|
461
475
|
async pauseBusinessBotConnection(chatId) {
|
|
462
|
-
return await
|
|
476
|
+
return await this.#dispatch("pauseBusinessBotConnection", chatId);
|
|
463
477
|
}
|
|
464
478
|
/**
|
|
465
479
|
* Resume the business bot in a chat. User-only.
|
|
@@ -467,7 +481,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
467
481
|
* @method ac
|
|
468
482
|
*/
|
|
469
483
|
async resumeBusinessBotConnection(chatId) {
|
|
470
|
-
return await
|
|
484
|
+
return await this.#dispatch("resumeBusinessBotConnection", chatId);
|
|
471
485
|
}
|
|
472
486
|
//
|
|
473
487
|
// ========================= MESSAGES ========================= //
|
|
@@ -481,7 +495,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
481
495
|
* @returns The sent text message.
|
|
482
496
|
*/
|
|
483
497
|
async sendMessage(chatId, text, params) {
|
|
484
|
-
return await
|
|
498
|
+
return await this.#dispatch("sendMessage", chatId, text, params);
|
|
485
499
|
}
|
|
486
500
|
/**
|
|
487
501
|
* Stream a drafted text message. Bot-only.
|
|
@@ -492,7 +506,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
492
506
|
* @param text The message's text.
|
|
493
507
|
*/
|
|
494
508
|
async sendMessageDraft(chatId, draftId, text, params) {
|
|
495
|
-
return await
|
|
509
|
+
return await this.#dispatch("sendMessageDraft", chatId, draftId, text, params);
|
|
496
510
|
}
|
|
497
511
|
/**
|
|
498
512
|
* Send a photo.
|
|
@@ -503,7 +517,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
503
517
|
* @returns The sent photo.
|
|
504
518
|
*/
|
|
505
519
|
async sendPhoto(chatId, photo, params) {
|
|
506
|
-
return await
|
|
520
|
+
return await this.#dispatch("sendPhoto", chatId, photo, params);
|
|
507
521
|
}
|
|
508
522
|
/**
|
|
509
523
|
* Send a document.
|
|
@@ -514,7 +528,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
514
528
|
* @returns The sent document.
|
|
515
529
|
*/
|
|
516
530
|
async sendDocument(chatId, document, params) {
|
|
517
|
-
return await
|
|
531
|
+
return await this.#dispatch("sendDocument", chatId, document, params);
|
|
518
532
|
}
|
|
519
533
|
/**
|
|
520
534
|
* Send a sticker.
|
|
@@ -525,7 +539,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
525
539
|
* @returns The sent sticker.
|
|
526
540
|
*/
|
|
527
541
|
async sendSticker(chatId, sticker, params) {
|
|
528
|
-
return await
|
|
542
|
+
return await this.#dispatch("sendSticker", chatId, sticker, params);
|
|
529
543
|
}
|
|
530
544
|
/**
|
|
531
545
|
* Send a video.
|
|
@@ -536,7 +550,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
536
550
|
* @returns The sent video.
|
|
537
551
|
*/
|
|
538
552
|
async sendVideo(chatId, video, params) {
|
|
539
|
-
return await
|
|
553
|
+
return await this.#dispatch("sendVideo", chatId, video, params);
|
|
540
554
|
}
|
|
541
555
|
/**
|
|
542
556
|
* Send an animation.
|
|
@@ -547,7 +561,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
547
561
|
* @returns The sent animation.
|
|
548
562
|
*/
|
|
549
563
|
async sendAnimation(chatId, animation, params) {
|
|
550
|
-
return await
|
|
564
|
+
return await this.#dispatch("sendAnimation", chatId, animation, params);
|
|
551
565
|
}
|
|
552
566
|
/**
|
|
553
567
|
* Send a voice message.
|
|
@@ -558,7 +572,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
558
572
|
* @returns The sent voice message.
|
|
559
573
|
*/
|
|
560
574
|
async sendVoice(chatId, voice, params) {
|
|
561
|
-
return await
|
|
575
|
+
return await this.#dispatch("sendVoice", chatId, voice, params);
|
|
562
576
|
}
|
|
563
577
|
/**
|
|
564
578
|
* Send an audio file.
|
|
@@ -569,7 +583,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
569
583
|
* @returns The sent audio file.
|
|
570
584
|
*/
|
|
571
585
|
async sendAudio(chatId, audio, params) {
|
|
572
|
-
return await
|
|
586
|
+
return await this.#dispatch("sendAudio", chatId, audio, params);
|
|
573
587
|
}
|
|
574
588
|
/**
|
|
575
589
|
* Send a media group.
|
|
@@ -580,7 +594,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
580
594
|
* @returns The sent messages.
|
|
581
595
|
*/
|
|
582
596
|
async sendMediaGroup(chatId, media, params) {
|
|
583
|
-
return await
|
|
597
|
+
return await this.#dispatch("sendMediaGroup", chatId, media, params);
|
|
584
598
|
}
|
|
585
599
|
/**
|
|
586
600
|
* Send a video note.
|
|
@@ -591,7 +605,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
591
605
|
* @returns The sent video note.
|
|
592
606
|
*/
|
|
593
607
|
async sendVideoNote(chatId, videoNote, params) {
|
|
594
|
-
return await
|
|
608
|
+
return await this.#dispatch("sendVideoNote", chatId, videoNote, params);
|
|
595
609
|
}
|
|
596
610
|
/**
|
|
597
611
|
* Send a location.
|
|
@@ -603,7 +617,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
603
617
|
* @returns The sent location.
|
|
604
618
|
*/
|
|
605
619
|
async sendLocation(chatId, latitude, longitude, params) {
|
|
606
|
-
return await
|
|
620
|
+
return await this.#dispatch("sendLocation", chatId, latitude, longitude, params);
|
|
607
621
|
}
|
|
608
622
|
/**
|
|
609
623
|
* Send a contact.
|
|
@@ -615,7 +629,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
615
629
|
* @returns The sent contact.
|
|
616
630
|
*/
|
|
617
631
|
async sendContact(chatId, firstName, number, params) {
|
|
618
|
-
return await
|
|
632
|
+
return await this.#dispatch("sendContact", chatId, firstName, number, params);
|
|
619
633
|
}
|
|
620
634
|
/**
|
|
621
635
|
* Send a dice.
|
|
@@ -625,7 +639,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
625
639
|
* @returns The sent dice.
|
|
626
640
|
*/
|
|
627
641
|
async sendDice(chatId, params) {
|
|
628
|
-
return await
|
|
642
|
+
return await this.#dispatch("sendDice", chatId, params);
|
|
629
643
|
}
|
|
630
644
|
/**
|
|
631
645
|
* Send a venue.
|
|
@@ -639,7 +653,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
639
653
|
* @returns The sent venue.
|
|
640
654
|
*/
|
|
641
655
|
async sendVenue(chatId, latitude, longitude, title, address, params) {
|
|
642
|
-
return await
|
|
656
|
+
return await this.#dispatch("sendVenue", chatId, latitude, longitude, title, address, params);
|
|
643
657
|
}
|
|
644
658
|
/**
|
|
645
659
|
* Send a poll.
|
|
@@ -651,7 +665,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
651
665
|
* @returns The sent poll.
|
|
652
666
|
*/
|
|
653
667
|
async sendPoll(chatId, question, options, params) {
|
|
654
|
-
return await
|
|
668
|
+
return await this.#dispatch("sendPoll", chatId, question, options, params);
|
|
655
669
|
}
|
|
656
670
|
/**
|
|
657
671
|
* Send a checklist. User-only.
|
|
@@ -663,7 +677,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
663
677
|
* @returns The sent checklist.
|
|
664
678
|
*/
|
|
665
679
|
async sendChecklist(chatId, title, items, params) {
|
|
666
|
-
return await
|
|
680
|
+
return await this.#dispatch("sendChecklist", chatId, title, items, params);
|
|
667
681
|
}
|
|
668
682
|
/**
|
|
669
683
|
* Send an invoice. Bot-only.
|
|
@@ -678,7 +692,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
678
692
|
* @returns The sent invoice.
|
|
679
693
|
*/
|
|
680
694
|
async sendInvoice(chatId, title, description, payload, currency, prices, params) {
|
|
681
|
-
return await
|
|
695
|
+
return await this.#dispatch("sendInvoice", chatId, title, description, payload, currency, prices, params);
|
|
682
696
|
}
|
|
683
697
|
/**
|
|
684
698
|
* Edit a message's text.
|
|
@@ -690,7 +704,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
690
704
|
* @returns The edited text message.
|
|
691
705
|
*/
|
|
692
706
|
async editMessageText(chatId, messageId, text, params) {
|
|
693
|
-
return await
|
|
707
|
+
return await this.#dispatch("editMessageText", chatId, messageId, text, params);
|
|
694
708
|
}
|
|
695
709
|
/**
|
|
696
710
|
* Edit a message's caption.
|
|
@@ -702,7 +716,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
702
716
|
* @returns The edited message.
|
|
703
717
|
*/
|
|
704
718
|
async editMessageCaption(chatId, messageId, params) {
|
|
705
|
-
return await
|
|
719
|
+
return await this.#dispatch("editMessageCaption", chatId, messageId, params);
|
|
706
720
|
}
|
|
707
721
|
/**
|
|
708
722
|
* Edit a message's media.
|
|
@@ -714,7 +728,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
714
728
|
* @returns The edited message.
|
|
715
729
|
*/
|
|
716
730
|
async editMessageMedia(chatId, messageId, media, params) {
|
|
717
|
-
return await
|
|
731
|
+
return await this.#dispatch("editMessageMedia", chatId, messageId, media, params);
|
|
718
732
|
}
|
|
719
733
|
/**
|
|
720
734
|
* Edit an inline message's media.
|
|
@@ -724,7 +738,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
724
738
|
* @param media The new media of the message.
|
|
725
739
|
*/
|
|
726
740
|
async editInlineMessageMedia(inlineMessageId, media, params) {
|
|
727
|
-
return await
|
|
741
|
+
return await this.#dispatch("editInlineMessageMedia", inlineMessageId, media, params);
|
|
728
742
|
}
|
|
729
743
|
/**
|
|
730
744
|
* Edit an inline message's text. Bot-only.
|
|
@@ -734,7 +748,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
734
748
|
* @param text The new text of the message.
|
|
735
749
|
*/
|
|
736
750
|
async editInlineMessageText(inlineMessageId, text, params) {
|
|
737
|
-
return await
|
|
751
|
+
return await this.#dispatch("editInlineMessageText", inlineMessageId, text, params);
|
|
738
752
|
}
|
|
739
753
|
/**
|
|
740
754
|
* Edit an inline message's caption. Bot-only.
|
|
@@ -743,7 +757,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
743
757
|
* @param inlineMessageId The identifier of the inline message.
|
|
744
758
|
*/
|
|
745
759
|
async editInlineMessageCaption(inlineMessageId, params) {
|
|
746
|
-
return await
|
|
760
|
+
return await this.#dispatch("editInlineMessageCaption", inlineMessageId, params);
|
|
747
761
|
}
|
|
748
762
|
/**
|
|
749
763
|
* Edit a message's reply markup.
|
|
@@ -754,7 +768,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
754
768
|
* @returns The edited message.
|
|
755
769
|
*/
|
|
756
770
|
async editMessageReplyMarkup(chatId, messageId, params) {
|
|
757
|
-
return await
|
|
771
|
+
return await this.#dispatch("editMessageReplyMarkup", chatId, messageId, params);
|
|
758
772
|
}
|
|
759
773
|
/**
|
|
760
774
|
* Edit an inline message's reply markup. Bot-only.
|
|
@@ -763,7 +777,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
763
777
|
* @param inlineMessageId The identifier of the inline message.
|
|
764
778
|
*/
|
|
765
779
|
async editInlineMessageReplyMarkup(inlineMessageId, params) {
|
|
766
|
-
return await
|
|
780
|
+
return await this.#dispatch("editInlineMessageReplyMarkup", inlineMessageId, params);
|
|
767
781
|
}
|
|
768
782
|
/**
|
|
769
783
|
* Edit a message's live location.
|
|
@@ -776,7 +790,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
776
790
|
* @returns The edited location message.
|
|
777
791
|
*/
|
|
778
792
|
async editMessageLiveLocation(chatId, messageId, latitude, longitude, params) {
|
|
779
|
-
return await
|
|
793
|
+
return await this.#dispatch("editMessageLiveLocation", chatId, messageId, latitude, longitude, params);
|
|
780
794
|
}
|
|
781
795
|
/**
|
|
782
796
|
* Edit an inline message's live location. Bot-only.
|
|
@@ -788,7 +802,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
788
802
|
* @returns The edited location message.
|
|
789
803
|
*/
|
|
790
804
|
async editInlineMessageLiveLocation(inlineMessageId, latitude, longitude, params) {
|
|
791
|
-
return await
|
|
805
|
+
return await this.#dispatch("editInlineMessageLiveLocation", inlineMessageId, latitude, longitude, params);
|
|
792
806
|
}
|
|
793
807
|
/**
|
|
794
808
|
* Retrieve multiple messages.
|
|
@@ -803,7 +817,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
803
817
|
* @cache
|
|
804
818
|
*/
|
|
805
819
|
async getMessages(chatId, messageIds) {
|
|
806
|
-
return await
|
|
820
|
+
return await this.#dispatch("getMessages", chatId, messageIds);
|
|
807
821
|
}
|
|
808
822
|
/**
|
|
809
823
|
* Retrieve a single message.
|
|
@@ -818,7 +832,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
818
832
|
* @cache
|
|
819
833
|
*/
|
|
820
834
|
async getMessage(chatId, messageId) {
|
|
821
|
-
return await
|
|
835
|
+
return await this.#dispatch("getMessage", chatId, messageId);
|
|
822
836
|
}
|
|
823
837
|
/**
|
|
824
838
|
* Retrieve a message using its link.
|
|
@@ -831,7 +845,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
831
845
|
* @returns The message that was linked to.
|
|
832
846
|
*/
|
|
833
847
|
async resolveMessageLink(link) {
|
|
834
|
-
return await
|
|
848
|
+
return await this.#dispatch("resolveMessageLink", link);
|
|
835
849
|
}
|
|
836
850
|
/**
|
|
837
851
|
* Delete multiple messages.
|
|
@@ -841,7 +855,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
841
855
|
* @param messageIds The identifiers of the messages to delete.
|
|
842
856
|
*/
|
|
843
857
|
async deleteMessages(chatId, messageIds, params) {
|
|
844
|
-
return await
|
|
858
|
+
return await this.#dispatch("deleteMessages", chatId, messageIds, params);
|
|
845
859
|
}
|
|
846
860
|
/**
|
|
847
861
|
* Delete a single message.
|
|
@@ -851,7 +865,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
851
865
|
* @param messageId The identifier of the message to delete.
|
|
852
866
|
*/
|
|
853
867
|
async deleteMessage(chatId, messageId, params) {
|
|
854
|
-
return await
|
|
868
|
+
return await this.#dispatch("deleteMessage", chatId, messageId, params);
|
|
855
869
|
}
|
|
856
870
|
/**
|
|
857
871
|
* Delete all messages sent by a specific member of a chat. User-only.
|
|
@@ -861,7 +875,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
861
875
|
* @param memberId The identifier of the member.
|
|
862
876
|
*/
|
|
863
877
|
async deleteChatMemberMessages(chatId, memberId) {
|
|
864
|
-
return await
|
|
878
|
+
return await this.#dispatch("deleteChatMemberMessages", chatId, memberId);
|
|
865
879
|
}
|
|
866
880
|
/**
|
|
867
881
|
* Delete multiple scheduled messages.
|
|
@@ -871,7 +885,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
871
885
|
* @param messageIds The identifiers of the scheduled messages to delete.
|
|
872
886
|
*/
|
|
873
887
|
async deleteScheduledMessages(chatId, messageIds) {
|
|
874
|
-
return await
|
|
888
|
+
return await this.#dispatch("deleteScheduledMessages", chatId, messageIds);
|
|
875
889
|
}
|
|
876
890
|
/**
|
|
877
891
|
* Delete a scheduled message.
|
|
@@ -881,7 +895,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
881
895
|
* @param messageId The identifier of the scheduled message to delete.
|
|
882
896
|
*/
|
|
883
897
|
async deleteScheduledMessage(chatId, messageId) {
|
|
884
|
-
return await
|
|
898
|
+
return await this.#dispatch("deleteScheduledMessage", chatId, messageId);
|
|
885
899
|
}
|
|
886
900
|
/**
|
|
887
901
|
* Send multiple scheduled messages before their schedule.
|
|
@@ -891,7 +905,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
891
905
|
* @param messageIds The identifiers of the scheduled messages to send.
|
|
892
906
|
*/
|
|
893
907
|
async sendScheduledMessages(chatId, messageIds) {
|
|
894
|
-
return await
|
|
908
|
+
return await this.#dispatch("sendScheduledMessages", chatId, messageIds);
|
|
895
909
|
}
|
|
896
910
|
/**
|
|
897
911
|
* Send a scheduled message before its schedule.
|
|
@@ -901,7 +915,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
901
915
|
* @param messageId The identifier of the scheduled message to send.
|
|
902
916
|
*/
|
|
903
917
|
async sendScheduledMessage(chatId, messageId) {
|
|
904
|
-
return await
|
|
918
|
+
return await this.#dispatch("sendScheduledMessage", chatId, messageId);
|
|
905
919
|
}
|
|
906
920
|
/**
|
|
907
921
|
* Pin a message in a chat.
|
|
@@ -911,7 +925,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
911
925
|
* @param messageId The identifier of the message.
|
|
912
926
|
*/
|
|
913
927
|
async pinMessage(chatId, messageId, params) {
|
|
914
|
-
return await
|
|
928
|
+
return await this.#dispatch("pinMessage", chatId, messageId, params);
|
|
915
929
|
}
|
|
916
930
|
/**
|
|
917
931
|
* Unpin a pinned message.
|
|
@@ -921,7 +935,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
921
935
|
* @param messageId The identifier of the message.
|
|
922
936
|
*/
|
|
923
937
|
async unpinMessage(chatId, messageId, params) {
|
|
924
|
-
return await
|
|
938
|
+
return await this.#dispatch("unpinMessage", chatId, messageId, params);
|
|
925
939
|
}
|
|
926
940
|
/**
|
|
927
941
|
* Unpin all pinned messages.
|
|
@@ -930,7 +944,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
930
944
|
* @param chatId The identifier of a chat.
|
|
931
945
|
*/
|
|
932
946
|
async unpinMessages(chatId, params) {
|
|
933
|
-
return await
|
|
947
|
+
return await this.#dispatch("unpinMessages", chatId, params);
|
|
934
948
|
}
|
|
935
949
|
/**
|
|
936
950
|
* Forward multiple messages.
|
|
@@ -942,7 +956,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
942
956
|
* @returns The forwarded messages.
|
|
943
957
|
*/
|
|
944
958
|
async forwardMessages(from, to, messageIds, params) {
|
|
945
|
-
return await
|
|
959
|
+
return await this.#dispatch("forwardMessages", from, to, messageIds, params);
|
|
946
960
|
}
|
|
947
961
|
/**
|
|
948
962
|
* Forward a single message.
|
|
@@ -954,7 +968,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
954
968
|
* @returns The forwarded message.
|
|
955
969
|
*/
|
|
956
970
|
async forwardMessage(from, to, messageId, params) {
|
|
957
|
-
return await
|
|
971
|
+
return await this.#dispatch("forwardMessage", from, to, messageId, params);
|
|
958
972
|
}
|
|
959
973
|
/**
|
|
960
974
|
* Stop a poll.
|
|
@@ -965,7 +979,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
965
979
|
* @returns The new state of the poll.
|
|
966
980
|
*/
|
|
967
981
|
async stopPoll(chatId, messageId, params) {
|
|
968
|
-
return await
|
|
982
|
+
return await this.#dispatch("stopPoll", chatId, messageId, params);
|
|
969
983
|
}
|
|
970
984
|
/**
|
|
971
985
|
* Send a chat action.
|
|
@@ -976,7 +990,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
976
990
|
* @param messageThreadId The thread to send the chat action to.
|
|
977
991
|
*/
|
|
978
992
|
async sendChatAction(chatId, action, params) {
|
|
979
|
-
return await
|
|
993
|
+
return await this.#dispatch("sendChatAction", chatId, action, params);
|
|
980
994
|
}
|
|
981
995
|
/**
|
|
982
996
|
* Search for messages. User-only.
|
|
@@ -984,7 +998,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
984
998
|
* @method ms
|
|
985
999
|
*/
|
|
986
1000
|
async searchMessages(params) {
|
|
987
|
-
return await
|
|
1001
|
+
return await this.#dispatch("searchMessages", params);
|
|
988
1002
|
}
|
|
989
1003
|
/**
|
|
990
1004
|
* Mark messages as read. User-only.
|
|
@@ -994,7 +1008,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
994
1008
|
* @param untilMessageId The identifier of the message that will be marked as read, along with any other unread messages before it.
|
|
995
1009
|
*/
|
|
996
1010
|
async readMessages(chatId, untilMessageId) {
|
|
997
|
-
return await
|
|
1011
|
+
return await this.#dispatch("readMessages", chatId, untilMessageId);
|
|
998
1012
|
}
|
|
999
1013
|
/**
|
|
1000
1014
|
* Start a bot. User-only.
|
|
@@ -1004,7 +1018,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1004
1018
|
* @returns The start message.
|
|
1005
1019
|
*/
|
|
1006
1020
|
async startBot(botId, params) {
|
|
1007
|
-
return await
|
|
1021
|
+
return await this.#dispatch("startBot", botId, params);
|
|
1008
1022
|
}
|
|
1009
1023
|
/**
|
|
1010
1024
|
* Transcribe a voice message. User-only.
|
|
@@ -1015,7 +1029,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1015
1029
|
* @cache
|
|
1016
1030
|
*/
|
|
1017
1031
|
async transcribeVoice(chatId, messageId) {
|
|
1018
|
-
return await
|
|
1032
|
+
return await this.#dispatch("transcribeVoice", chatId, messageId);
|
|
1019
1033
|
}
|
|
1020
1034
|
/**
|
|
1021
1035
|
* Get a sticker set.
|
|
@@ -1024,7 +1038,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1024
1038
|
* @param name The name of the sticker set or its link.
|
|
1025
1039
|
*/
|
|
1026
1040
|
async getStickerSet(name) {
|
|
1027
|
-
return await
|
|
1041
|
+
return await this.#dispatch("getStickerSet", name);
|
|
1028
1042
|
}
|
|
1029
1043
|
/*
|
|
1030
1044
|
* Get the link preview for a message that is about to be sent. User-only.
|
|
@@ -1033,7 +1047,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1033
1047
|
* @param text The message's text.
|
|
1034
1048
|
*/
|
|
1035
1049
|
async getLinkPreview(text, params) {
|
|
1036
|
-
return await
|
|
1050
|
+
return await this.#dispatch("getLinkPreview", text, params);
|
|
1037
1051
|
}
|
|
1038
1052
|
/**
|
|
1039
1053
|
* Open a mini app. User-only.
|
|
@@ -1044,7 +1058,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1044
1058
|
* @cache
|
|
1045
1059
|
*/
|
|
1046
1060
|
async openMiniApp(botId, chatId, params) {
|
|
1047
|
-
return await
|
|
1061
|
+
return await this.#dispatch("openMiniApp", botId, chatId, params);
|
|
1048
1062
|
}
|
|
1049
1063
|
/**
|
|
1050
1064
|
* Get a progress ID that can be passed to relevant send* methods to receive upload progress updates for them.
|
|
@@ -1053,7 +1067,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1053
1067
|
* @cache
|
|
1054
1068
|
*/
|
|
1055
1069
|
async getProgressId() {
|
|
1056
|
-
return await
|
|
1070
|
+
return await this.#dispatch("getProgressId");
|
|
1057
1071
|
}
|
|
1058
1072
|
/**
|
|
1059
1073
|
* Get messages saved from a specific chat.
|
|
@@ -1062,7 +1076,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1062
1076
|
* @param chatId The identifier of a chat.
|
|
1063
1077
|
*/
|
|
1064
1078
|
async getSavedMessages(chatId, params) {
|
|
1065
|
-
return await
|
|
1079
|
+
return await this.#dispatch("getSavedMessages", chatId, params);
|
|
1066
1080
|
}
|
|
1067
1081
|
/**
|
|
1068
1082
|
* Get a list of saved chats.
|
|
@@ -1070,7 +1084,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1070
1084
|
* @method ms
|
|
1071
1085
|
*/
|
|
1072
1086
|
async getSavedChats(params) {
|
|
1073
|
-
return await
|
|
1087
|
+
return await this.#dispatch("getSavedChats", params);
|
|
1074
1088
|
}
|
|
1075
1089
|
/**
|
|
1076
1090
|
* Get a list of reactions made to a message. User-only.
|
|
@@ -1080,7 +1094,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1080
1094
|
* @method ms
|
|
1081
1095
|
*/
|
|
1082
1096
|
async getMessageReactions(chatId, messageId, params) {
|
|
1083
|
-
return await
|
|
1097
|
+
return await this.#dispatch("getMessageReactions", chatId, messageId, params);
|
|
1084
1098
|
}
|
|
1085
1099
|
//
|
|
1086
1100
|
// ========================= POLLS ========================= //
|
|
@@ -1094,7 +1108,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1094
1108
|
* @param optionIndexes The indexes of the options to cast for.
|
|
1095
1109
|
*/
|
|
1096
1110
|
async vote(chatId, messageId, optionIndexes) {
|
|
1097
|
-
return await
|
|
1111
|
+
return await this.#dispatch("vote", chatId, messageId, optionIndexes);
|
|
1098
1112
|
}
|
|
1099
1113
|
/**
|
|
1100
1114
|
* Retract a vote. User-only.
|
|
@@ -1104,7 +1118,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1104
1118
|
* @param messageId The identifier of the message that includes the poll.
|
|
1105
1119
|
*/
|
|
1106
1120
|
async retractVote(chatId, messageId) {
|
|
1107
|
-
return await
|
|
1121
|
+
return await this.#dispatch("retractVote", chatId, messageId);
|
|
1108
1122
|
}
|
|
1109
1123
|
//
|
|
1110
1124
|
// ========================= CHECKLISTS ========================= //
|
|
@@ -1118,7 +1132,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1118
1132
|
* @method cl
|
|
1119
1133
|
*/
|
|
1120
1134
|
async addToChecklist(chatId, messageId, items) {
|
|
1121
|
-
return await
|
|
1135
|
+
return await this.#dispatch("addToChecklist", chatId, messageId, items);
|
|
1122
1136
|
}
|
|
1123
1137
|
/**
|
|
1124
1138
|
* Update a checklist. User-only.
|
|
@@ -1128,7 +1142,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1128
1142
|
* @method cl
|
|
1129
1143
|
*/
|
|
1130
1144
|
async updateChecklist(chatId, messageId, params) {
|
|
1131
|
-
return await
|
|
1145
|
+
return await this.#dispatch("updateChecklist", chatId, messageId, params);
|
|
1132
1146
|
}
|
|
1133
1147
|
/**
|
|
1134
1148
|
* Check multiple items of a checklist. User-only.
|
|
@@ -1139,7 +1153,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1139
1153
|
* @method cl
|
|
1140
1154
|
*/
|
|
1141
1155
|
async checkChecklistItems(chatId, messageId, items) {
|
|
1142
|
-
return await
|
|
1156
|
+
return await this.#dispatch("checkChecklistItems", chatId, messageId, items);
|
|
1143
1157
|
}
|
|
1144
1158
|
/**
|
|
1145
1159
|
* Uncheck multiple items of a checklist. User-only.
|
|
@@ -1150,7 +1164,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1150
1164
|
* @method cl
|
|
1151
1165
|
*/
|
|
1152
1166
|
async uncheckChecklistItems(chatId, messageId, items) {
|
|
1153
|
-
return await
|
|
1167
|
+
return await this.#dispatch("uncheckChecklistItems", chatId, messageId, items);
|
|
1154
1168
|
}
|
|
1155
1169
|
/**
|
|
1156
1170
|
* Check a single item of a checklist. User-only.
|
|
@@ -1161,7 +1175,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1161
1175
|
* @method cl
|
|
1162
1176
|
*/
|
|
1163
1177
|
async checkChecklistItem(chatId, messageId, item) {
|
|
1164
|
-
return await
|
|
1178
|
+
return await this.#dispatch("checkChecklistItem", chatId, messageId, item);
|
|
1165
1179
|
}
|
|
1166
1180
|
/**
|
|
1167
1181
|
* Uncheck a single item of a checklist. User-only.
|
|
@@ -1172,7 +1186,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1172
1186
|
* @method cl
|
|
1173
1187
|
*/
|
|
1174
1188
|
async uncheckChecklistItem(chatId, messageId, item) {
|
|
1175
|
-
return await
|
|
1189
|
+
return await this.#dispatch("uncheckChecklistItem", chatId, messageId, item);
|
|
1176
1190
|
}
|
|
1177
1191
|
//
|
|
1178
1192
|
// ========================= FILES ========================= //
|
|
@@ -1189,7 +1203,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1189
1203
|
* @cache file
|
|
1190
1204
|
*/
|
|
1191
1205
|
async downloadChunk(fileId, params) {
|
|
1192
|
-
return await
|
|
1206
|
+
return await this.#dispatch("downloadChunk", fileId, params);
|
|
1193
1207
|
}
|
|
1194
1208
|
/**
|
|
1195
1209
|
* Download a file.
|
|
@@ -1227,7 +1241,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1227
1241
|
* @cache
|
|
1228
1242
|
*/
|
|
1229
1243
|
async getCustomEmojiStickers(id) {
|
|
1230
|
-
return await
|
|
1244
|
+
return await this.#dispatch("getCustomEmojiStickers", id);
|
|
1231
1245
|
}
|
|
1232
1246
|
//
|
|
1233
1247
|
// ========================= CHATS ========================= //
|
|
@@ -1238,7 +1252,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1238
1252
|
* @method ch
|
|
1239
1253
|
*/
|
|
1240
1254
|
async getChats(params) {
|
|
1241
|
-
return await
|
|
1255
|
+
return await this.#dispatch("getChats", params);
|
|
1242
1256
|
}
|
|
1243
1257
|
/**
|
|
1244
1258
|
* Get pinned chats from a chat list. User-only.
|
|
@@ -1247,7 +1261,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1247
1261
|
* @param from The chat list to get the pinned chats from. Defaults to main.
|
|
1248
1262
|
*/
|
|
1249
1263
|
async getPinnedChats(from) {
|
|
1250
|
-
return await
|
|
1264
|
+
return await this.#dispatch("getPinnedChats", from);
|
|
1251
1265
|
}
|
|
1252
1266
|
/**
|
|
1253
1267
|
* Get a chat.
|
|
@@ -1256,7 +1270,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1256
1270
|
* @cache
|
|
1257
1271
|
*/
|
|
1258
1272
|
async getChat(chatId) {
|
|
1259
|
-
return await
|
|
1273
|
+
return await this.#dispatch("getChat", chatId);
|
|
1260
1274
|
}
|
|
1261
1275
|
/**
|
|
1262
1276
|
* Get chat history. User-only.
|
|
@@ -1265,7 +1279,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1265
1279
|
* @param chatId The identifier of a chat.
|
|
1266
1280
|
*/
|
|
1267
1281
|
async getHistory(chatId, params) {
|
|
1268
|
-
return await
|
|
1282
|
+
return await this.#dispatch("getHistory", chatId, params);
|
|
1269
1283
|
}
|
|
1270
1284
|
/**
|
|
1271
1285
|
* Set a chat's available reactions. User-only.
|
|
@@ -1275,7 +1289,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1275
1289
|
* @param availableReactions The new available reactions.
|
|
1276
1290
|
*/
|
|
1277
1291
|
async setAvailableReactions(chatId, availableReactions) {
|
|
1278
|
-
return await
|
|
1292
|
+
return await this.#dispatch("setAvailableReactions", chatId, availableReactions);
|
|
1279
1293
|
}
|
|
1280
1294
|
/**
|
|
1281
1295
|
* Set a chat's photo.
|
|
@@ -1285,7 +1299,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1285
1299
|
* @param photo A photo to set as the chat's photo.
|
|
1286
1300
|
*/
|
|
1287
1301
|
async setChatPhoto(chatId, photo, params) {
|
|
1288
|
-
return await
|
|
1302
|
+
return await this.#dispatch("setChatPhoto", chatId, photo, params);
|
|
1289
1303
|
}
|
|
1290
1304
|
/**
|
|
1291
1305
|
* Delete a chat's photo.
|
|
@@ -1294,7 +1308,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1294
1308
|
* @param chatId The identifier of a chat.
|
|
1295
1309
|
*/
|
|
1296
1310
|
async deleteChatPhoto(chatId) {
|
|
1297
|
-
return await
|
|
1311
|
+
return await this.#dispatch("deleteChatPhoto", chatId);
|
|
1298
1312
|
}
|
|
1299
1313
|
/**
|
|
1300
1314
|
* Ban a member from a chat.
|
|
@@ -1304,7 +1318,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1304
1318
|
* @param memberId The identifier of the member.
|
|
1305
1319
|
*/
|
|
1306
1320
|
async banChatMember(chatId, memberId, params) {
|
|
1307
|
-
return await
|
|
1321
|
+
return await this.#dispatch("banChatMember", chatId, memberId, params);
|
|
1308
1322
|
}
|
|
1309
1323
|
/**
|
|
1310
1324
|
* Unban a member from a chat.
|
|
@@ -1314,7 +1328,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1314
1328
|
* @param memberId The identifier of the member.
|
|
1315
1329
|
*/
|
|
1316
1330
|
async unbanChatMember(chatId, memberId) {
|
|
1317
|
-
return await
|
|
1331
|
+
return await this.#dispatch("unbanChatMember", chatId, memberId);
|
|
1318
1332
|
}
|
|
1319
1333
|
/**
|
|
1320
1334
|
* Kick a member from a chat. Same as a banChatMember call followed by unbanChatMember.
|
|
@@ -1324,7 +1338,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1324
1338
|
* @param memberId The identifier of the member.
|
|
1325
1339
|
*/
|
|
1326
1340
|
async kickChatMember(chatId, memberId) {
|
|
1327
|
-
return await
|
|
1341
|
+
return await this.#dispatch("kickChatMember", chatId, memberId);
|
|
1328
1342
|
}
|
|
1329
1343
|
/**
|
|
1330
1344
|
* Set the rights of a chat member.
|
|
@@ -1334,7 +1348,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1334
1348
|
* @param memberId The identifier of the member.
|
|
1335
1349
|
*/
|
|
1336
1350
|
async setChatMemberRights(chatId, memberId, params) {
|
|
1337
|
-
return await
|
|
1351
|
+
return await this.#dispatch("setChatMemberRights", chatId, memberId, params);
|
|
1338
1352
|
}
|
|
1339
1353
|
/**
|
|
1340
1354
|
* Get the administrators of a chat.
|
|
@@ -1344,7 +1358,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1344
1358
|
* @returns The chat's administrators.
|
|
1345
1359
|
*/
|
|
1346
1360
|
async getChatAdministrators(chatId) {
|
|
1347
|
-
return await
|
|
1361
|
+
return await this.#dispatch("getChatAdministrators", chatId);
|
|
1348
1362
|
}
|
|
1349
1363
|
/**
|
|
1350
1364
|
* Enable join requests in a chat. User-only.
|
|
@@ -1353,7 +1367,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1353
1367
|
* @param chatId The identifier of a chat. Must be a channel or a supergroup.
|
|
1354
1368
|
*/
|
|
1355
1369
|
async enableJoinRequests(chatId) {
|
|
1356
|
-
return await
|
|
1370
|
+
return await this.#dispatch("enableJoinRequests", chatId);
|
|
1357
1371
|
}
|
|
1358
1372
|
/**
|
|
1359
1373
|
* Disable join requests in a chat. User-only.
|
|
@@ -1362,7 +1376,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1362
1376
|
* @param chatId The identifier of a chat. Must be a channel or a supergroup.
|
|
1363
1377
|
*/
|
|
1364
1378
|
async disableJoinRequests(chatId) {
|
|
1365
|
-
return await
|
|
1379
|
+
return await this.#dispatch("disableJoinRequests", chatId);
|
|
1366
1380
|
}
|
|
1367
1381
|
/**
|
|
1368
1382
|
* Get inactive chats. User-only.
|
|
@@ -1371,7 +1385,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1371
1385
|
* @retuns A list of inactive chats the current user is member of.
|
|
1372
1386
|
*/
|
|
1373
1387
|
async getInactiveChats() {
|
|
1374
|
-
return await
|
|
1388
|
+
return await this.#dispatch("getInactiveChats");
|
|
1375
1389
|
}
|
|
1376
1390
|
/**
|
|
1377
1391
|
* Get the invite links created for a chat. User-only.
|
|
@@ -1381,7 +1395,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1381
1395
|
* @returns The invite links created for the chat. This might be a subset of the results if they were less than `limit`. The parameters `afterDate` and `afterInviteLink` can be used for pagination.
|
|
1382
1396
|
*/
|
|
1383
1397
|
async getCreatedInviteLinks(chatId, params) {
|
|
1384
|
-
return await
|
|
1398
|
+
return await this.#dispatch("getCreatedInviteLinks", chatId, params);
|
|
1385
1399
|
}
|
|
1386
1400
|
/**
|
|
1387
1401
|
* Join a chat. User-only.
|
|
@@ -1390,7 +1404,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1390
1404
|
* @param chatId The identifier of a chat.
|
|
1391
1405
|
*/
|
|
1392
1406
|
async joinChat(chatId) {
|
|
1393
|
-
return await
|
|
1407
|
+
return await this.#dispatch("joinChat", chatId);
|
|
1394
1408
|
}
|
|
1395
1409
|
/**
|
|
1396
1410
|
* Leave a chat.
|
|
@@ -1399,7 +1413,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1399
1413
|
* @param chatId The identifier of a chat.
|
|
1400
1414
|
*/
|
|
1401
1415
|
async leaveChat(chatId) {
|
|
1402
|
-
return await
|
|
1416
|
+
return await this.#dispatch("leaveChat", chatId);
|
|
1403
1417
|
}
|
|
1404
1418
|
/**
|
|
1405
1419
|
* Get information on a user's chat membership.
|
|
@@ -1409,7 +1423,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1409
1423
|
* @param userId The identifier of the user.
|
|
1410
1424
|
*/
|
|
1411
1425
|
async getChatMember(chatId, userId) {
|
|
1412
|
-
return await
|
|
1426
|
+
return await this.#dispatch("getChatMember", chatId, userId);
|
|
1413
1427
|
}
|
|
1414
1428
|
/**
|
|
1415
1429
|
* Get the members of a chat.
|
|
@@ -1418,7 +1432,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1418
1432
|
* @param chatId The identifier of a chat.
|
|
1419
1433
|
*/
|
|
1420
1434
|
async getChatMembers(chatId, params) {
|
|
1421
|
-
return await
|
|
1435
|
+
return await this.#dispatch("getChatMembers", chatId, params);
|
|
1422
1436
|
}
|
|
1423
1437
|
/**
|
|
1424
1438
|
* Set a chat's sticker set.
|
|
@@ -1428,7 +1442,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1428
1442
|
* @param setName The name of the set.
|
|
1429
1443
|
*/
|
|
1430
1444
|
async setChatStickerSet(chatId, setName) {
|
|
1431
|
-
return await
|
|
1445
|
+
return await this.#dispatch("setChatStickerSet", chatId, setName);
|
|
1432
1446
|
}
|
|
1433
1447
|
/**
|
|
1434
1448
|
* Delete a chat's sticker set.
|
|
@@ -1437,7 +1451,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1437
1451
|
* @param chatId The identifier of a chat. Must be a supergroup.
|
|
1438
1452
|
*/
|
|
1439
1453
|
async deleteChatStickerSet(chatId) {
|
|
1440
|
-
return await
|
|
1454
|
+
return await this.#dispatch("deleteChatStickerSet", chatId);
|
|
1441
1455
|
}
|
|
1442
1456
|
/**
|
|
1443
1457
|
* Set the number of boosts required to circument a chat's default restrictions. User-only.
|
|
@@ -1447,7 +1461,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1447
1461
|
* @param boosts The number of boosts required to circumvent its restrictions.
|
|
1448
1462
|
*/
|
|
1449
1463
|
async setBoostsRequiredToCircumventRestrictions(chatId, boosts) {
|
|
1450
|
-
return await
|
|
1464
|
+
return await this.#dispatch("setBoostsRequiredToCircumventRestrictions", chatId, boosts);
|
|
1451
1465
|
}
|
|
1452
1466
|
/**
|
|
1453
1467
|
* Create an invite link.
|
|
@@ -1457,7 +1471,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1457
1471
|
* @returns The newly created invite link.
|
|
1458
1472
|
*/
|
|
1459
1473
|
async createInviteLink(chatId, params) {
|
|
1460
|
-
return await
|
|
1474
|
+
return await this.#dispatch("createInviteLink", chatId, params);
|
|
1461
1475
|
}
|
|
1462
1476
|
/**
|
|
1463
1477
|
* Approve a join request.
|
|
@@ -1467,7 +1481,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1467
1481
|
* @param userId The user who made the join request.
|
|
1468
1482
|
*/
|
|
1469
1483
|
async approveJoinRequest(chatId, userId) {
|
|
1470
|
-
return await
|
|
1484
|
+
return await this.#dispatch("approveJoinRequest", chatId, userId);
|
|
1471
1485
|
}
|
|
1472
1486
|
/**
|
|
1473
1487
|
* Decline a join request.
|
|
@@ -1477,7 +1491,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1477
1491
|
* @param userId The user who made the join request.
|
|
1478
1492
|
*/
|
|
1479
1493
|
async declineJoinRequest(chatId, userId) {
|
|
1480
|
-
return await
|
|
1494
|
+
return await this.#dispatch("declineJoinRequest", chatId, userId);
|
|
1481
1495
|
}
|
|
1482
1496
|
/**
|
|
1483
1497
|
* Approve all join requests. User-only.
|
|
@@ -1486,7 +1500,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1486
1500
|
* @param chatId The identifier of a chat with the join requests.
|
|
1487
1501
|
*/
|
|
1488
1502
|
async approveJoinRequests(chatId, params) {
|
|
1489
|
-
return await
|
|
1503
|
+
return await this.#dispatch("approveJoinRequests", chatId, params);
|
|
1490
1504
|
}
|
|
1491
1505
|
/**
|
|
1492
1506
|
* Decline all join requests. User-only.
|
|
@@ -1495,7 +1509,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1495
1509
|
* @param chatId The identifier of a chat with the join requests.
|
|
1496
1510
|
*/
|
|
1497
1511
|
async declineJoinRequests(chatId, params) {
|
|
1498
|
-
return await
|
|
1512
|
+
return await this.#dispatch("declineJoinRequests", chatId, params);
|
|
1499
1513
|
}
|
|
1500
1514
|
/**
|
|
1501
1515
|
* Get pending join requests in a chat. User-only.
|
|
@@ -1504,7 +1518,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1504
1518
|
* @param chatId The identifier of a chat with the join requests.
|
|
1505
1519
|
*/
|
|
1506
1520
|
async getJoinRequests(chatId, params) {
|
|
1507
|
-
return await
|
|
1521
|
+
return await this.#dispatch("getJoinRequests", chatId, params);
|
|
1508
1522
|
}
|
|
1509
1523
|
/**
|
|
1510
1524
|
* Add a single user to a chat.
|
|
@@ -1515,7 +1529,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1515
1529
|
* @returns An array of FailedInvitation that has at most a length of 1. If empty, it means that the user was added.
|
|
1516
1530
|
*/
|
|
1517
1531
|
async addChatMember(chatId, userId, params) {
|
|
1518
|
-
return await
|
|
1532
|
+
return await this.#dispatch("addChatMember", chatId, userId, params);
|
|
1519
1533
|
}
|
|
1520
1534
|
/**
|
|
1521
1535
|
* Add multiple users at once to a channel or a supergroup.
|
|
@@ -1526,7 +1540,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1526
1540
|
* @returns An array of FailedInvitation that has at most a length that is the same as that of the parameter userIds. If empty, it means that all the provided users were added.
|
|
1527
1541
|
*/
|
|
1528
1542
|
async addChatMembers(chatId, userIds) {
|
|
1529
|
-
return await
|
|
1543
|
+
return await this.#dispatch("addChatMembers", chatId, userIds);
|
|
1530
1544
|
}
|
|
1531
1545
|
/**
|
|
1532
1546
|
* Open a chat.
|
|
@@ -1535,7 +1549,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1535
1549
|
* @param chatId The identifier of a chat to open.
|
|
1536
1550
|
*/
|
|
1537
1551
|
async openChat(chatId, params) {
|
|
1538
|
-
return await
|
|
1552
|
+
return await this.#dispatch("openChat", chatId, params);
|
|
1539
1553
|
}
|
|
1540
1554
|
/**
|
|
1541
1555
|
* Close a chat previously opened by openChat.
|
|
@@ -1544,7 +1558,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1544
1558
|
* @param chatId The identifier of a chat to close.
|
|
1545
1559
|
*/
|
|
1546
1560
|
async closeChat(chatId) {
|
|
1547
|
-
return await
|
|
1561
|
+
return await this.#dispatch("closeChat", chatId);
|
|
1548
1562
|
}
|
|
1549
1563
|
/**
|
|
1550
1564
|
* Create a group. User-only.
|
|
@@ -1554,7 +1568,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1554
1568
|
* @returns The created group.
|
|
1555
1569
|
*/
|
|
1556
1570
|
async createGroup(title, params) {
|
|
1557
|
-
return await
|
|
1571
|
+
return await this.#dispatch("createGroup", title, params);
|
|
1558
1572
|
}
|
|
1559
1573
|
/**
|
|
1560
1574
|
* Create a supergroup. User-only.
|
|
@@ -1564,7 +1578,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1564
1578
|
* @returns The created supergroup.
|
|
1565
1579
|
*/
|
|
1566
1580
|
async createSupergroup(title, params) {
|
|
1567
|
-
return await
|
|
1581
|
+
return await this.#dispatch("createSupergroup", title, params);
|
|
1568
1582
|
}
|
|
1569
1583
|
/**
|
|
1570
1584
|
* Create a channel. User-only.
|
|
@@ -1574,7 +1588,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1574
1588
|
* @returns The created channel.
|
|
1575
1589
|
*/
|
|
1576
1590
|
async createChannel(title, params) {
|
|
1577
|
-
return await
|
|
1591
|
+
return await this.#dispatch("createChannel", title, params);
|
|
1578
1592
|
}
|
|
1579
1593
|
/**
|
|
1580
1594
|
* Set the time to live of the messages of a chat. User-only.
|
|
@@ -1584,7 +1598,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1584
1598
|
* @param messageTtl The time to live of the messages in seconds.
|
|
1585
1599
|
*/
|
|
1586
1600
|
async setMessageTtl(chatId, messageTtl) {
|
|
1587
|
-
return await
|
|
1601
|
+
return await this.#dispatch("setMessageTtl", chatId, messageTtl);
|
|
1588
1602
|
}
|
|
1589
1603
|
/**
|
|
1590
1604
|
* Archive multiple chats. User-only.
|
|
@@ -1593,7 +1607,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1593
1607
|
* @param chatIds The identifiers of the chats to archive.
|
|
1594
1608
|
*/
|
|
1595
1609
|
async archiveChats(chatIds) {
|
|
1596
|
-
return await
|
|
1610
|
+
return await this.#dispatch("archiveChats", chatIds);
|
|
1597
1611
|
}
|
|
1598
1612
|
/**
|
|
1599
1613
|
* Archive a single chat. User-only.
|
|
@@ -1602,7 +1616,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1602
1616
|
* @param chatId The identifier of a chat.
|
|
1603
1617
|
*/
|
|
1604
1618
|
async archiveChat(chatId) {
|
|
1605
|
-
return await
|
|
1619
|
+
return await this.#dispatch("archiveChat", chatId);
|
|
1606
1620
|
}
|
|
1607
1621
|
/**
|
|
1608
1622
|
* Unarchive multiple chats. User-only.
|
|
@@ -1611,7 +1625,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1611
1625
|
* @param chatIds The identifiers of the chats to unarchive.
|
|
1612
1626
|
*/
|
|
1613
1627
|
async unarchiveChats(chatIds) {
|
|
1614
|
-
return await
|
|
1628
|
+
return await this.#dispatch("unarchiveChats", chatIds);
|
|
1615
1629
|
}
|
|
1616
1630
|
/**
|
|
1617
1631
|
* Unarchive a single chat. User-only.
|
|
@@ -1620,7 +1634,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1620
1634
|
* @param chatId The identifier of a chat.
|
|
1621
1635
|
*/
|
|
1622
1636
|
async unarchiveChat(chatId) {
|
|
1623
|
-
return await
|
|
1637
|
+
return await this.#dispatch("unarchiveChat", chatId);
|
|
1624
1638
|
}
|
|
1625
1639
|
/**
|
|
1626
1640
|
* Get common chats between a user and the current one. User-only.
|
|
@@ -1629,7 +1643,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1629
1643
|
* @param userId The identifier of the user to get the common chats with them.
|
|
1630
1644
|
*/
|
|
1631
1645
|
async getCommonChats(userId, params) {
|
|
1632
|
-
return await
|
|
1646
|
+
return await this.#dispatch("getCommonChats", userId, params);
|
|
1633
1647
|
}
|
|
1634
1648
|
/**
|
|
1635
1649
|
* Get the settings of a chat. User-only.
|
|
@@ -1638,7 +1652,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1638
1652
|
* @param chatId The identifier of a chat.
|
|
1639
1653
|
*/
|
|
1640
1654
|
async getChatSettings(chatId) {
|
|
1641
|
-
return await
|
|
1655
|
+
return await this.#dispatch("getChatSettings", chatId);
|
|
1642
1656
|
}
|
|
1643
1657
|
/**
|
|
1644
1658
|
* Disable business bots in a private chat. User-only.
|
|
@@ -1647,7 +1661,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1647
1661
|
* @param chatId The identifier of the private chat to disable business bots in.
|
|
1648
1662
|
*/
|
|
1649
1663
|
async disableBusinessBots(chatId) {
|
|
1650
|
-
return await
|
|
1664
|
+
return await this.#dispatch("disableBusinessBots", chatId);
|
|
1651
1665
|
}
|
|
1652
1666
|
/**
|
|
1653
1667
|
* Enable business bots in a private chat. User-only.
|
|
@@ -1656,7 +1670,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1656
1670
|
* @param chatId The identifier of the private chat to enable business bots in.
|
|
1657
1671
|
*/
|
|
1658
1672
|
async enableBusinessBots(chatId) {
|
|
1659
|
-
return await
|
|
1673
|
+
return await this.#dispatch("enableBusinessBots", chatId);
|
|
1660
1674
|
}
|
|
1661
1675
|
/**
|
|
1662
1676
|
* Disable slow mode in a group. User-only.
|
|
@@ -1665,7 +1679,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1665
1679
|
* @param chatId The identifier of the group to disable slow mode in.
|
|
1666
1680
|
*/
|
|
1667
1681
|
async disableSlowMode(chatId) {
|
|
1668
|
-
return await
|
|
1682
|
+
return await this.#dispatch("disableSlowMode", chatId);
|
|
1669
1683
|
}
|
|
1670
1684
|
/**
|
|
1671
1685
|
* Change slow mode in a group. User-only.
|
|
@@ -1675,7 +1689,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1675
1689
|
* @param duration New slow mode duration.
|
|
1676
1690
|
*/
|
|
1677
1691
|
async setSlowMode(chatId, duration) {
|
|
1678
|
-
return await
|
|
1692
|
+
return await this.#dispatch("setSlowMode", chatId, duration);
|
|
1679
1693
|
}
|
|
1680
1694
|
/**
|
|
1681
1695
|
* Change the title of a chat.
|
|
@@ -1685,7 +1699,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1685
1699
|
* @param title The new title.
|
|
1686
1700
|
*/
|
|
1687
1701
|
async setChatTitle(chatId, title) {
|
|
1688
|
-
return await
|
|
1702
|
+
return await this.#dispatch("setChatTitle", chatId, title);
|
|
1689
1703
|
}
|
|
1690
1704
|
/**
|
|
1691
1705
|
* Change the description of a chat.
|
|
@@ -1695,7 +1709,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1695
1709
|
* @param description The new description.
|
|
1696
1710
|
*/
|
|
1697
1711
|
async setChatDescription(chatId, description) {
|
|
1698
|
-
return await
|
|
1712
|
+
return await this.#dispatch("setChatDescription", chatId, description);
|
|
1699
1713
|
}
|
|
1700
1714
|
/**
|
|
1701
1715
|
* Hide the member list of a group to non-admins. User-only.
|
|
@@ -1704,7 +1718,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1704
1718
|
* @param chatId The identifier of the group.
|
|
1705
1719
|
*/
|
|
1706
1720
|
async hideMemberList(chatId) {
|
|
1707
|
-
return await
|
|
1721
|
+
return await this.#dispatch("hideMemberList", chatId);
|
|
1708
1722
|
}
|
|
1709
1723
|
/**
|
|
1710
1724
|
* Show the member list of a group to non-admins. User-only.
|
|
@@ -1713,7 +1727,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1713
1727
|
* @param chatId The identifier of the group.
|
|
1714
1728
|
*/
|
|
1715
1729
|
async showMemberList(chatId) {
|
|
1716
|
-
return await
|
|
1730
|
+
return await this.#dispatch("showMemberList", chatId);
|
|
1717
1731
|
}
|
|
1718
1732
|
/**
|
|
1719
1733
|
* Enable topics in a group. User-only.
|
|
@@ -1723,7 +1737,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1723
1737
|
* @param isShownAsTabs Whether topics should be displayed as tabs.
|
|
1724
1738
|
*/
|
|
1725
1739
|
async enableTopics(chatId, isShownAsTabs) {
|
|
1726
|
-
return await
|
|
1740
|
+
return await this.#dispatch("enableTopics", chatId, isShownAsTabs);
|
|
1727
1741
|
}
|
|
1728
1742
|
/**
|
|
1729
1743
|
* Disable topics in a group. User-only.
|
|
@@ -1732,7 +1746,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1732
1746
|
* @param chatId The identifier of the group.
|
|
1733
1747
|
*/
|
|
1734
1748
|
async disableTopics(chatId) {
|
|
1735
|
-
return await
|
|
1749
|
+
return await this.#dispatch("disableTopics", chatId);
|
|
1736
1750
|
}
|
|
1737
1751
|
/**
|
|
1738
1752
|
* Enable automatic anti-spam in a group. User-only.
|
|
@@ -1741,7 +1755,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1741
1755
|
* @param chatId The identifier of the group.
|
|
1742
1756
|
*/
|
|
1743
1757
|
async enableAntispam(chatId) {
|
|
1744
|
-
return await
|
|
1758
|
+
return await this.#dispatch("enableAntispam", chatId);
|
|
1745
1759
|
}
|
|
1746
1760
|
/**
|
|
1747
1761
|
* Disable automatic anti-spam in a group. User-only.
|
|
@@ -1750,7 +1764,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1750
1764
|
* @param chatId The identifier of the group.
|
|
1751
1765
|
*/
|
|
1752
1766
|
async disableAntispam(chatId) {
|
|
1753
|
-
return await
|
|
1767
|
+
return await this.#dispatch("disableAntispam", chatId);
|
|
1754
1768
|
}
|
|
1755
1769
|
/**
|
|
1756
1770
|
* Enable post signatures in a channel. User-only.
|
|
@@ -1759,7 +1773,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1759
1773
|
* @param chatId The identifier of the channel.
|
|
1760
1774
|
*/
|
|
1761
1775
|
async enableSignatures(chatId, params) {
|
|
1762
|
-
return await
|
|
1776
|
+
return await this.#dispatch("enableSignatures", chatId, params);
|
|
1763
1777
|
}
|
|
1764
1778
|
/**
|
|
1765
1779
|
* Disable post signatures in a channel. User-only.
|
|
@@ -1768,7 +1782,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1768
1782
|
* @param chatId The identifier of the channel.
|
|
1769
1783
|
*/
|
|
1770
1784
|
async disableSignatures(chatId) {
|
|
1771
|
-
return await
|
|
1785
|
+
return await this.#dispatch("disableSignatures", chatId);
|
|
1772
1786
|
}
|
|
1773
1787
|
/**
|
|
1774
1788
|
* Delete a chat. User-only.
|
|
@@ -1777,7 +1791,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1777
1791
|
* @param chatId The identifier of a chat.
|
|
1778
1792
|
*/
|
|
1779
1793
|
async deleteChat(chatId) {
|
|
1780
|
-
return await
|
|
1794
|
+
return await this.#dispatch("deleteChat", chatId);
|
|
1781
1795
|
}
|
|
1782
1796
|
/**
|
|
1783
1797
|
* Get discussion chat suggestions. User-only.
|
|
@@ -1785,7 +1799,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1785
1799
|
* @method ch
|
|
1786
1800
|
*/
|
|
1787
1801
|
async getDiscussionChatSuggestions() {
|
|
1788
|
-
return await
|
|
1802
|
+
return await this.#dispatch("getDiscussionChatSuggestions");
|
|
1789
1803
|
}
|
|
1790
1804
|
/**
|
|
1791
1805
|
* Set a channel's discussion chat. User-only.
|
|
@@ -1795,7 +1809,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1795
1809
|
* @param discussionChatId The identifier of a chat to use as discussion for the channel.
|
|
1796
1810
|
*/
|
|
1797
1811
|
async setDiscussionChat(chatId, discussionChatId) {
|
|
1798
|
-
return await
|
|
1812
|
+
return await this.#dispatch("setDiscussionChat", chatId, discussionChatId);
|
|
1799
1813
|
}
|
|
1800
1814
|
/**
|
|
1801
1815
|
* Transfer the ownership of a chat. User-only.
|
|
@@ -1806,7 +1820,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1806
1820
|
* @param password The password of the current account.
|
|
1807
1821
|
*/
|
|
1808
1822
|
async transferChatOwnership(chatId, userId, password) {
|
|
1809
|
-
return await
|
|
1823
|
+
return await this.#dispatch("transferChatOwnership", chatId, userId, password);
|
|
1810
1824
|
}
|
|
1811
1825
|
/**
|
|
1812
1826
|
* Create a forum topic.
|
|
@@ -1817,7 +1831,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1817
1831
|
* @returns The created topic.
|
|
1818
1832
|
*/
|
|
1819
1833
|
async createTopic(chatId, title, params) {
|
|
1820
|
-
return await
|
|
1834
|
+
return await this.#dispatch("createTopic", chatId, title, params);
|
|
1821
1835
|
}
|
|
1822
1836
|
/**
|
|
1823
1837
|
* Edit a forum topic.
|
|
@@ -1829,7 +1843,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1829
1843
|
* @returns The new topic.
|
|
1830
1844
|
*/
|
|
1831
1845
|
async editTopic(chatId, topicId, title, params) {
|
|
1832
|
-
return await
|
|
1846
|
+
return await this.#dispatch("editTopic", chatId, topicId, title, params);
|
|
1833
1847
|
}
|
|
1834
1848
|
/**
|
|
1835
1849
|
* Hide the general forum topic.
|
|
@@ -1838,7 +1852,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1838
1852
|
* @param chatId The identifier of a chat.
|
|
1839
1853
|
*/
|
|
1840
1854
|
async hideGeneralTopic(chatId) {
|
|
1841
|
-
return await
|
|
1855
|
+
return await this.#dispatch("hideGeneralTopic", chatId);
|
|
1842
1856
|
}
|
|
1843
1857
|
/**
|
|
1844
1858
|
* Show the general forum topic.
|
|
@@ -1847,7 +1861,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1847
1861
|
* @param chatId The identifier of a chat.
|
|
1848
1862
|
*/
|
|
1849
1863
|
async showGeneralTopic(chatId) {
|
|
1850
|
-
return await
|
|
1864
|
+
return await this.#dispatch("showGeneralTopic", chatId);
|
|
1851
1865
|
}
|
|
1852
1866
|
/**
|
|
1853
1867
|
* Close a forum topic.
|
|
@@ -1857,7 +1871,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1857
1871
|
* @param topicId The identifier of the topic.
|
|
1858
1872
|
*/
|
|
1859
1873
|
async closeTopic(chatId, topicId) {
|
|
1860
|
-
return await
|
|
1874
|
+
return await this.#dispatch("closeTopic", chatId, topicId);
|
|
1861
1875
|
}
|
|
1862
1876
|
/**
|
|
1863
1877
|
* Reopen a forum topic.
|
|
@@ -1867,7 +1881,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1867
1881
|
* @param topicId The identifier of the topic.
|
|
1868
1882
|
*/
|
|
1869
1883
|
async reopenTopic(chatId, topicId) {
|
|
1870
|
-
return await
|
|
1884
|
+
return await this.#dispatch("reopenTopic", chatId, topicId);
|
|
1871
1885
|
}
|
|
1872
1886
|
/**
|
|
1873
1887
|
* Pin a forum topic.
|
|
@@ -1877,7 +1891,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1877
1891
|
* @param topicId The identifier of the topic.
|
|
1878
1892
|
*/
|
|
1879
1893
|
async pinTopic(chatId, topicId) {
|
|
1880
|
-
return await
|
|
1894
|
+
return await this.#dispatch("pinTopic", chatId, topicId);
|
|
1881
1895
|
}
|
|
1882
1896
|
/**
|
|
1883
1897
|
* Unpin a forum topic.
|
|
@@ -1887,7 +1901,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1887
1901
|
* @param topicId The identifier of the topic.
|
|
1888
1902
|
*/
|
|
1889
1903
|
async unpinTopic(chatId, topicId) {
|
|
1890
|
-
return await
|
|
1904
|
+
return await this.#dispatch("unpinTopic", chatId, topicId);
|
|
1891
1905
|
}
|
|
1892
1906
|
/**
|
|
1893
1907
|
* Promote a chat member.
|
|
@@ -1897,7 +1911,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1897
1911
|
* @param userId The identifier of the user to promote.
|
|
1898
1912
|
*/
|
|
1899
1913
|
async promoteChatMember(chatId, userId, params) {
|
|
1900
|
-
return await
|
|
1914
|
+
return await this.#dispatch("promoteChatMember", chatId, userId, params);
|
|
1901
1915
|
}
|
|
1902
1916
|
/**
|
|
1903
1917
|
* Change the tag of a chat member.
|
|
@@ -1907,7 +1921,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1907
1921
|
* @param userId The identifier of the user that is a member of the chat.
|
|
1908
1922
|
*/
|
|
1909
1923
|
async setChatMemberTag(chatId, userId, params) {
|
|
1910
|
-
return await
|
|
1924
|
+
return await this.#dispatch("setChatMemberTag", chatId, userId, params);
|
|
1911
1925
|
}
|
|
1912
1926
|
/**
|
|
1913
1927
|
* Enable sharing in a chat. User-only.
|
|
@@ -1916,7 +1930,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1916
1930
|
* @param chatId The identifier of a chat.
|
|
1917
1931
|
*/
|
|
1918
1932
|
async enableSharing(chatId) {
|
|
1919
|
-
return await
|
|
1933
|
+
return await this.#dispatch("enableSharing", chatId);
|
|
1920
1934
|
}
|
|
1921
1935
|
/**
|
|
1922
1936
|
* Disable sharing in a chat. User-only.
|
|
@@ -1925,7 +1939,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1925
1939
|
* @param chatId The identifier of a chat.
|
|
1926
1940
|
*/
|
|
1927
1941
|
async disableSharing(chatId) {
|
|
1928
|
-
return await
|
|
1942
|
+
return await this.#dispatch("disableSharing", chatId);
|
|
1929
1943
|
}
|
|
1930
1944
|
/**
|
|
1931
1945
|
* Get recommended channels. User-only.
|
|
@@ -1934,7 +1948,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1934
1948
|
* @returns A list of recommended channels.
|
|
1935
1949
|
*/
|
|
1936
1950
|
async getRecommendedChannels() {
|
|
1937
|
-
return await
|
|
1951
|
+
return await this.#dispatch("getRecommendedChannels");
|
|
1938
1952
|
}
|
|
1939
1953
|
/**
|
|
1940
1954
|
* Get similar channels. User-only.
|
|
@@ -1944,7 +1958,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1944
1958
|
* @returns A list of similar channels.
|
|
1945
1959
|
*/
|
|
1946
1960
|
async getSimilarChannels(chatId) {
|
|
1947
|
-
return await
|
|
1961
|
+
return await this.#dispatch("getSimilarChannels", chatId);
|
|
1948
1962
|
}
|
|
1949
1963
|
/**
|
|
1950
1964
|
* Get similar bots. User-only.
|
|
@@ -1954,7 +1968,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1954
1968
|
* @returns A list of similar bots.
|
|
1955
1969
|
*/
|
|
1956
1970
|
async getSimilarBots(chatId) {
|
|
1957
|
-
return await
|
|
1971
|
+
return await this.#dispatch("getSimilarBots", chatId);
|
|
1958
1972
|
}
|
|
1959
1973
|
//
|
|
1960
1974
|
// ========================= CALLBACK QUERIES ========================= //
|
|
@@ -1970,7 +1984,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1970
1984
|
* @cache
|
|
1971
1985
|
*/
|
|
1972
1986
|
async sendCallbackQuery(botId, messageId, question) {
|
|
1973
|
-
return await
|
|
1987
|
+
return await this.#dispatch("sendCallbackQuery", botId, messageId, question);
|
|
1974
1988
|
}
|
|
1975
1989
|
/**
|
|
1976
1990
|
* Answer a callback query. Bot-only.
|
|
@@ -1979,7 +1993,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1979
1993
|
* @param id ID of the callback query to answer.
|
|
1980
1994
|
*/
|
|
1981
1995
|
async answerCallbackQuery(id, params) {
|
|
1982
|
-
return await
|
|
1996
|
+
return await this.#dispatch("answerCallbackQuery", id, params);
|
|
1983
1997
|
}
|
|
1984
1998
|
//
|
|
1985
1999
|
// ========================= INLINE QUERIES ========================= //
|
|
@@ -1994,7 +2008,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
1994
2008
|
* @cache
|
|
1995
2009
|
*/
|
|
1996
2010
|
async sendInlineQuery(botId, chatId, params) {
|
|
1997
|
-
return await
|
|
2011
|
+
return await this.#dispatch("sendInlineQuery", botId, chatId, params);
|
|
1998
2012
|
}
|
|
1999
2013
|
/**
|
|
2000
2014
|
* Answer an inline query. Bot-only.
|
|
@@ -2004,7 +2018,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
2004
2018
|
* @param results The results to answer with.
|
|
2005
2019
|
*/
|
|
2006
2020
|
async answerInlineQuery(id, results, params) {
|
|
2007
|
-
return await
|
|
2021
|
+
return await this.#dispatch("answerInlineQuery", id, results, params);
|
|
2008
2022
|
}
|
|
2009
2023
|
//
|
|
2010
2024
|
// ========================= BOTS ========================= //
|
|
@@ -2015,7 +2029,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
2015
2029
|
* @method bs
|
|
2016
2030
|
*/
|
|
2017
2031
|
async setMyDescription(params) {
|
|
2018
|
-
return await
|
|
2032
|
+
return await this.#dispatch("setMyDescription", params);
|
|
2019
2033
|
}
|
|
2020
2034
|
/**
|
|
2021
2035
|
* Set the bot's name in the given language. Bot-only.
|
|
@@ -2023,7 +2037,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
2023
2037
|
* @method bs
|
|
2024
2038
|
*/
|
|
2025
2039
|
async setMyName(params) {
|
|
2026
|
-
return await
|
|
2040
|
+
return await this.#dispatch("setMyName", params);
|
|
2027
2041
|
}
|
|
2028
2042
|
/**
|
|
2029
2043
|
* Set the bot's short description in the given language. Bot-only.
|
|
@@ -2031,7 +2045,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
2031
2045
|
* @method bs
|
|
2032
2046
|
*/
|
|
2033
2047
|
async setMyShortDescription(params) {
|
|
2034
|
-
return await
|
|
2048
|
+
return await this.#dispatch("setMyShortDescription", params);
|
|
2035
2049
|
}
|
|
2036
2050
|
/**
|
|
2037
2051
|
* Get the bot's description in the given language. Bot-only.
|
|
@@ -2040,7 +2054,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
2040
2054
|
* @returns The current bot's description in the specified language.
|
|
2041
2055
|
*/
|
|
2042
2056
|
async getMyDescription(params) {
|
|
2043
|
-
return await
|
|
2057
|
+
return await this.#dispatch("getMyDescription", params);
|
|
2044
2058
|
}
|
|
2045
2059
|
/**
|
|
2046
2060
|
* Get the bot's name in the given language. Bot-only.
|
|
@@ -2049,7 +2063,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
2049
2063
|
* @returns The current bot's name in the specified language.
|
|
2050
2064
|
*/
|
|
2051
2065
|
async getMyName(params) {
|
|
2052
|
-
return await
|
|
2066
|
+
return await this.#dispatch("getMyName", params);
|
|
2053
2067
|
}
|
|
2054
2068
|
/**
|
|
2055
2069
|
* Get the bot's short description in the given language. Bot-only.
|
|
@@ -2058,7 +2072,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
2058
2072
|
* @returns The current bot's short description in the specified language.
|
|
2059
2073
|
*/
|
|
2060
2074
|
async getMyShortDescription(params) {
|
|
2061
|
-
return await
|
|
2075
|
+
return await this.#dispatch("getMyShortDescription", params);
|
|
2062
2076
|
}
|
|
2063
2077
|
/**
|
|
2064
2078
|
* Set the bot's commands in the given scope and/or language. Bot-only.
|
|
@@ -2067,7 +2081,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
2067
2081
|
* @param commands The commands to set.
|
|
2068
2082
|
*/
|
|
2069
2083
|
async setMyCommands(commands, params) {
|
|
2070
|
-
return await
|
|
2084
|
+
return await this.#dispatch("setMyCommands", commands, params);
|
|
2071
2085
|
}
|
|
2072
2086
|
/**
|
|
2073
2087
|
* Get the bot's commands in the given scope and/or language. Bot-only.
|
|
@@ -2076,7 +2090,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
2076
2090
|
* @returns The current bot's commands in the specified language.
|
|
2077
2091
|
*/
|
|
2078
2092
|
async getMyCommands(params) {
|
|
2079
|
-
return await
|
|
2093
|
+
return await this.#dispatch("getMyCommands", params);
|
|
2080
2094
|
}
|
|
2081
2095
|
//
|
|
2082
2096
|
// ========================= REACTIONS ========================= //
|
|
@@ -2090,7 +2104,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
2090
2104
|
* @param reactions The new reactions.
|
|
2091
2105
|
*/
|
|
2092
2106
|
async setReactions(chatId, messageId, reactions, params) {
|
|
2093
|
-
return await
|
|
2107
|
+
return await this.#dispatch("setReactions", chatId, messageId, reactions, params);
|
|
2094
2108
|
}
|
|
2095
2109
|
/**
|
|
2096
2110
|
* Make a reaction to a message.
|
|
@@ -2101,7 +2115,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
2101
2115
|
* @param reaction The reaction to add.
|
|
2102
2116
|
*/
|
|
2103
2117
|
async addReaction(chatId, messageId, reaction, params) {
|
|
2104
|
-
return await
|
|
2118
|
+
return await this.#dispatch("addReaction", chatId, messageId, reaction, params);
|
|
2105
2119
|
}
|
|
2106
2120
|
/**
|
|
2107
2121
|
* Undo a reaction made to a message.
|
|
@@ -2112,7 +2126,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
2112
2126
|
* @param reaction The reaction to remove.
|
|
2113
2127
|
*/
|
|
2114
2128
|
async removeReaction(chatId, messageId, reaction) {
|
|
2115
|
-
return await
|
|
2129
|
+
return await this.#dispatch("removeReaction", chatId, messageId, reaction);
|
|
2116
2130
|
}
|
|
2117
2131
|
//
|
|
2118
2132
|
// ========================= STORIES ========================= //
|
|
@@ -2125,7 +2139,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
2125
2139
|
* @returns The created story.
|
|
2126
2140
|
*/
|
|
2127
2141
|
async createStory(chatId, content, params) {
|
|
2128
|
-
return await
|
|
2142
|
+
return await this.#dispatch("createStory", chatId, content, params);
|
|
2129
2143
|
}
|
|
2130
2144
|
/**
|
|
2131
2145
|
* Retrieve multiple stories. User-only.
|
|
@@ -2136,7 +2150,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
2136
2150
|
* @returns The retrieved stories.
|
|
2137
2151
|
*/
|
|
2138
2152
|
async getStories(chatId, storyIds) {
|
|
2139
|
-
return await
|
|
2153
|
+
return await this.#dispatch("getStories", chatId, storyIds);
|
|
2140
2154
|
}
|
|
2141
2155
|
/**
|
|
2142
2156
|
* Retrieve a single story. User-only.
|
|
@@ -2147,7 +2161,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
2147
2161
|
* @returns The retrieved story.
|
|
2148
2162
|
*/
|
|
2149
2163
|
async getStory(chatId, storyId) {
|
|
2150
|
-
return await
|
|
2164
|
+
return await this.#dispatch("getStory", chatId, storyId);
|
|
2151
2165
|
}
|
|
2152
2166
|
/**
|
|
2153
2167
|
* Delete multiple stories. User-only.
|
|
@@ -2157,7 +2171,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
2157
2171
|
* @param storyIds The identifiers of the stories to delete.
|
|
2158
2172
|
*/
|
|
2159
2173
|
async deleteStories(chatId, storyIds) {
|
|
2160
|
-
return await
|
|
2174
|
+
return await this.#dispatch("deleteStories", chatId, storyIds);
|
|
2161
2175
|
}
|
|
2162
2176
|
/**
|
|
2163
2177
|
* Delete a single story. User-only.
|
|
@@ -2167,7 +2181,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
2167
2181
|
* @param storyId The identifier of the story to delete.
|
|
2168
2182
|
*/
|
|
2169
2183
|
async deleteStory(chatId, storyId) {
|
|
2170
|
-
return await
|
|
2184
|
+
return await this.#dispatch("deleteStory", chatId, storyId);
|
|
2171
2185
|
}
|
|
2172
2186
|
/**
|
|
2173
2187
|
* Add multiple stories to highlights. User-only.
|
|
@@ -2177,7 +2191,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
2177
2191
|
* @param storyIds The identifiers of the stories to add to highlights.
|
|
2178
2192
|
*/
|
|
2179
2193
|
async addStoriesToHighlights(chatId, storyIds) {
|
|
2180
|
-
return await
|
|
2194
|
+
return await this.#dispatch("addStoriesToHighlights", chatId, storyIds);
|
|
2181
2195
|
}
|
|
2182
2196
|
/**
|
|
2183
2197
|
* Add a single story to highlights. User-only.
|
|
@@ -2187,7 +2201,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
2187
2201
|
* @param storyId The identifier of the story to add to highlights.
|
|
2188
2202
|
*/
|
|
2189
2203
|
async addStoryToHighlights(chatId, storyId) {
|
|
2190
|
-
return await
|
|
2204
|
+
return await this.#dispatch("addStoryToHighlights", chatId, storyId);
|
|
2191
2205
|
}
|
|
2192
2206
|
/**
|
|
2193
2207
|
* Remove multiple stories from highlights. User-only.
|
|
@@ -2197,7 +2211,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
2197
2211
|
* @param storyIds The identifiers of the stories to remove from highlights.
|
|
2198
2212
|
*/
|
|
2199
2213
|
async removeStoriesFromHighlights(chatId, storyIds) {
|
|
2200
|
-
return await
|
|
2214
|
+
return await this.#dispatch("removeStoriesFromHighlights", chatId, storyIds);
|
|
2201
2215
|
}
|
|
2202
2216
|
/**
|
|
2203
2217
|
* Remove a single story from highlights. User-only.
|
|
@@ -2207,7 +2221,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
2207
2221
|
* @param storyId The identifier of the story to remove from highlights.
|
|
2208
2222
|
*/
|
|
2209
2223
|
async removeStoryFromHighlights(chatId, storyId) {
|
|
2210
|
-
return await
|
|
2224
|
+
return await this.#dispatch("removeStoryFromHighlights", chatId, storyId);
|
|
2211
2225
|
}
|
|
2212
2226
|
//
|
|
2213
2227
|
// ========================= MISC ========================= //
|
|
@@ -2218,7 +2232,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
2218
2232
|
* @method mc
|
|
2219
2233
|
*/
|
|
2220
2234
|
async getNetworkStatistics() {
|
|
2221
|
-
return await
|
|
2235
|
+
return await this.#dispatch("getNetworkStatistics");
|
|
2222
2236
|
}
|
|
2223
2237
|
/**
|
|
2224
2238
|
* Block a user. User-only.
|
|
@@ -2227,7 +2241,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
2227
2241
|
* @param userId The identifier of the user to block.
|
|
2228
2242
|
*/
|
|
2229
2243
|
async blockUser(userId) {
|
|
2230
|
-
return await
|
|
2244
|
+
return await this.#dispatch("blockUser", userId);
|
|
2231
2245
|
}
|
|
2232
2246
|
/**
|
|
2233
2247
|
* Unblock a user. User-only.
|
|
@@ -2236,7 +2250,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
2236
2250
|
* @param userId The identifier of the user to unblock.
|
|
2237
2251
|
*/
|
|
2238
2252
|
async unblockUser(userId) {
|
|
2239
|
-
return await
|
|
2253
|
+
return await this.#dispatch("unblockUser", userId);
|
|
2240
2254
|
}
|
|
2241
2255
|
//
|
|
2242
2256
|
// ========================= VIDEO CHATS ========================= //
|
|
@@ -2249,7 +2263,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
2249
2263
|
* @returns The started video chat.
|
|
2250
2264
|
*/
|
|
2251
2265
|
async startVideoChat(chatId, params) {
|
|
2252
|
-
return await
|
|
2266
|
+
return await this.#dispatch("startVideoChat", chatId, params);
|
|
2253
2267
|
}
|
|
2254
2268
|
/**
|
|
2255
2269
|
* Schedule a video chat. User-only.
|
|
@@ -2260,7 +2274,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
2260
2274
|
* @returns The scheduled video chat.
|
|
2261
2275
|
*/
|
|
2262
2276
|
async scheduleVideoChat(chatId, startAt, params) {
|
|
2263
|
-
return await
|
|
2277
|
+
return await this.#dispatch("scheduleVideoChat", chatId, startAt, params);
|
|
2264
2278
|
}
|
|
2265
2279
|
/**
|
|
2266
2280
|
* Join a video chat. User-only.
|
|
@@ -2271,7 +2285,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
2271
2285
|
* @returns Parameters to be passed to the used WebRTC library.
|
|
2272
2286
|
*/
|
|
2273
2287
|
async joinVideoChat(id, params_, params) {
|
|
2274
|
-
return await
|
|
2288
|
+
return await this.#dispatch("joinVideoChat", id, params_, params);
|
|
2275
2289
|
}
|
|
2276
2290
|
/**
|
|
2277
2291
|
* Leave a video chat. User-only.
|
|
@@ -2280,7 +2294,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
2280
2294
|
* @param id The identifier of a video chat retrieved from getChat, startVideoChat, or scheduleVideoChat.
|
|
2281
2295
|
*/
|
|
2282
2296
|
async leaveVideoChat(id) {
|
|
2283
|
-
return await
|
|
2297
|
+
return await this.#dispatch("leaveVideoChat", id);
|
|
2284
2298
|
}
|
|
2285
2299
|
/**
|
|
2286
2300
|
* Join a live stream. User-only.
|
|
@@ -2289,7 +2303,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
2289
2303
|
* @param id The identifier of a video chat retrieved from getChat, startVideoChat, or scheduleVideoChat.
|
|
2290
2304
|
*/
|
|
2291
2305
|
async joinLiveStream(id) {
|
|
2292
|
-
return await
|
|
2306
|
+
return await this.#dispatch("joinLiveStream", id);
|
|
2293
2307
|
}
|
|
2294
2308
|
/**
|
|
2295
2309
|
* Get a video chat. User-only.
|
|
@@ -2299,7 +2313,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
2299
2313
|
* @cache
|
|
2300
2314
|
*/
|
|
2301
2315
|
async getVideoChat(id) {
|
|
2302
|
-
return await
|
|
2316
|
+
return await this.#dispatch("getVideoChat", id);
|
|
2303
2317
|
}
|
|
2304
2318
|
/**
|
|
2305
2319
|
* Get live stream channels. User-only.
|
|
@@ -2308,7 +2322,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
2308
2322
|
* @param id The identifier of a video chat retrieved from getChat, startVideoChat, or scheduleVideoChat.
|
|
2309
2323
|
*/
|
|
2310
2324
|
async getLiveStreamChannels(id) {
|
|
2311
|
-
return await
|
|
2325
|
+
return await this.#dispatch("getLiveStreamChannels", id);
|
|
2312
2326
|
}
|
|
2313
2327
|
/**
|
|
2314
2328
|
* Download a live stream segment. User-only.
|
|
@@ -2320,7 +2334,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
2320
2334
|
* @param timestamp Millisecond timestamp of the chunk to download.
|
|
2321
2335
|
*/
|
|
2322
2336
|
async downloadLiveStreamSegment(id, channelId, scale, timestamp, params) {
|
|
2323
|
-
return await
|
|
2337
|
+
return await this.#dispatch("downloadLiveStreamSegment", id, channelId, scale, timestamp, params);
|
|
2324
2338
|
}
|
|
2325
2339
|
//
|
|
2326
2340
|
// ========================= PAYMENTS ========================= //
|
|
@@ -2333,7 +2347,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
2333
2347
|
* @param ok Whether the checkout is going to be processed.
|
|
2334
2348
|
*/
|
|
2335
2349
|
async answerPreCheckoutQuery(preCheckoutQueryId, ok, params) {
|
|
2336
|
-
return await
|
|
2350
|
+
return await this.#dispatch("answerPreCheckoutQuery", preCheckoutQueryId, ok, params);
|
|
2337
2351
|
}
|
|
2338
2352
|
/**
|
|
2339
2353
|
* Refund a star payment. Bot-only.
|
|
@@ -2343,7 +2357,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
2343
2357
|
* @param telegramPaymentChargeId The identifier of the charge.
|
|
2344
2358
|
*/
|
|
2345
2359
|
async refundStarPayment(userId, telegramPaymentChargeId) {
|
|
2346
|
-
return await
|
|
2360
|
+
return await this.#dispatch("refundStarPayment", userId, telegramPaymentChargeId);
|
|
2347
2361
|
}
|
|
2348
2362
|
//
|
|
2349
2363
|
// ========================= CONTACTS ========================= //
|
|
@@ -2354,7 +2368,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
2354
2368
|
* @method co
|
|
2355
2369
|
*/
|
|
2356
2370
|
async getContacts() {
|
|
2357
|
-
return await
|
|
2371
|
+
return await this.#dispatch("getContacts");
|
|
2358
2372
|
}
|
|
2359
2373
|
/**
|
|
2360
2374
|
* Delete multiple contacts. User-only.
|
|
@@ -2363,7 +2377,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
2363
2377
|
* @param userIds The identifiers of contacts to delete.
|
|
2364
2378
|
*/
|
|
2365
2379
|
async deleteContacts(userIds) {
|
|
2366
|
-
return await
|
|
2380
|
+
return await this.#dispatch("deleteContacts", userIds);
|
|
2367
2381
|
}
|
|
2368
2382
|
/**
|
|
2369
2383
|
* Delete a single contact. User-only.
|
|
@@ -2372,7 +2386,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
2372
2386
|
* @param userId The identifier of the contact to delete.
|
|
2373
2387
|
*/
|
|
2374
2388
|
async deleteContact(userId) {
|
|
2375
|
-
return await
|
|
2389
|
+
return await this.#dispatch("deleteContact", userId);
|
|
2376
2390
|
}
|
|
2377
2391
|
/**
|
|
2378
2392
|
* Add a contact. User-only.
|
|
@@ -2381,7 +2395,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
2381
2395
|
* @param userId The identifier of the user to add as contact.
|
|
2382
2396
|
*/
|
|
2383
2397
|
async addContact(userId, params) {
|
|
2384
|
-
return await
|
|
2398
|
+
return await this.#dispatch("addContact", userId, params);
|
|
2385
2399
|
}
|
|
2386
2400
|
//
|
|
2387
2401
|
// ========================= TRANSLATIONS ========================= //
|
|
@@ -2393,7 +2407,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
2393
2407
|
* @cache
|
|
2394
2408
|
*/
|
|
2395
2409
|
async getTranslations(params) {
|
|
2396
|
-
return await
|
|
2410
|
+
return await this.#dispatch("getTranslations", params);
|
|
2397
2411
|
}
|
|
2398
2412
|
//
|
|
2399
2413
|
// ========================= GIFTS ========================= //
|
|
@@ -2404,7 +2418,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
2404
2418
|
* @method gf
|
|
2405
2419
|
*/
|
|
2406
2420
|
async getGifts() {
|
|
2407
|
-
return await
|
|
2421
|
+
return await this.#dispatch("getGifts");
|
|
2408
2422
|
}
|
|
2409
2423
|
/**
|
|
2410
2424
|
* Get gifts claimed by a user or a channel. User-only.
|
|
@@ -2413,7 +2427,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
2413
2427
|
* @param chatId The identifier of a user or a channel to get gifts for.
|
|
2414
2428
|
*/
|
|
2415
2429
|
async getClaimedGifts(chatId, params) {
|
|
2416
|
-
return await
|
|
2430
|
+
return await this.#dispatch("getClaimedGifts", chatId, params);
|
|
2417
2431
|
}
|
|
2418
2432
|
/**
|
|
2419
2433
|
* Send a gift.
|
|
@@ -2423,7 +2437,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
2423
2437
|
* @param giftId The identifier of the gift to send.
|
|
2424
2438
|
*/
|
|
2425
2439
|
async sendGift(chatId, giftId, params) {
|
|
2426
|
-
return await
|
|
2440
|
+
return await this.#dispatch("sendGift", chatId, giftId, params);
|
|
2427
2441
|
}
|
|
2428
2442
|
/**
|
|
2429
2443
|
* Sell a gift.
|
|
@@ -2432,7 +2446,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
2432
2446
|
* @param gift The gift to sell.
|
|
2433
2447
|
*/
|
|
2434
2448
|
async sellGift(gift) {
|
|
2435
|
-
return await
|
|
2449
|
+
return await this.#dispatch("sellGift", gift);
|
|
2436
2450
|
}
|
|
2437
2451
|
/**
|
|
2438
2452
|
* Craft gifts.
|
|
@@ -2441,7 +2455,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
2441
2455
|
* @param gifts The gifts to craft.
|
|
2442
2456
|
*/
|
|
2443
2457
|
async craftGifts(gifts) {
|
|
2444
|
-
return await
|
|
2458
|
+
return await this.#dispatch("craftGifts", gifts);
|
|
2445
2459
|
}
|
|
2446
2460
|
/**
|
|
2447
2461
|
* Get a gift using its slug.
|
|
@@ -2450,7 +2464,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
2450
2464
|
* @param slug The slug of a gift.
|
|
2451
2465
|
*/
|
|
2452
2466
|
async getGift(slug) {
|
|
2453
|
-
return await
|
|
2467
|
+
return await this.#dispatch("getGift", slug);
|
|
2454
2468
|
}
|
|
2455
2469
|
/**
|
|
2456
2470
|
* Transfer a gift. User-only.
|
|
@@ -2460,38 +2474,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
|
|
|
2460
2474
|
* @param gift The gift to transfer.
|
|
2461
2475
|
*/
|
|
2462
2476
|
async transferGift(chatId, gift) {
|
|
2463
|
-
return await
|
|
2477
|
+
return await this.#dispatch("transferGift", chatId, gift);
|
|
2464
2478
|
}
|
|
2465
2479
|
}
|
|
2466
2480
|
exports.ClientDispatcher = ClientDispatcher;
|
|
2467
|
-
_ClientDispatcher_worker = new WeakMap(), _ClientDispatcher_id = new WeakMap(), _ClientDispatcher_L = new WeakMap(), _ClientDispatcher_LsignIn = new WeakMap(), _ClientDispatcher_pendingRequests = new WeakMap(), _ClientDispatcher_isInited = new WeakMap(), _ClientDispatcher_handleInvokeError = new WeakMap(), _ClientDispatcher_instances = new WeakSet(), _ClientDispatcher_dispatch = async function _ClientDispatcher_dispatch(method, ...args) {
|
|
2468
|
-
// deno-lint-ignore no-explicit-any
|
|
2469
|
-
const promiseWithResolvers = Promise.withResolvers();
|
|
2470
|
-
const id = crypto.randomUUID();
|
|
2471
|
-
__classPrivateFieldGet(this, _ClientDispatcher_pendingRequests, "f").set(id, promiseWithResolvers);
|
|
2472
|
-
const request = {
|
|
2473
|
-
type: "request",
|
|
2474
|
-
clientId: __classPrivateFieldGet(this, _ClientDispatcher_id, "f"),
|
|
2475
|
-
id,
|
|
2476
|
-
method,
|
|
2477
|
-
args,
|
|
2478
|
-
};
|
|
2479
|
-
__classPrivateFieldGet(this, _ClientDispatcher_L, "f").debug("posted message to worker", request);
|
|
2480
|
-
__classPrivateFieldGet(this, _ClientDispatcher_worker, "f").postMessage(request);
|
|
2481
|
-
return await promiseWithResolvers.promise;
|
|
2482
|
-
}, _ClientDispatcher_invoke = async function _ClientDispatcher_invoke(function_, params) {
|
|
2483
|
-
let n = 1;
|
|
2484
|
-
while (true) {
|
|
2485
|
-
try {
|
|
2486
|
-
return await __classPrivateFieldGet(this, _ClientDispatcher_instances, "m", _ClientDispatcher_dispatch).call(this, "invoke", function_, params);
|
|
2487
|
-
}
|
|
2488
|
-
catch (err) {
|
|
2489
|
-
if (await __classPrivateFieldGet(this, _ClientDispatcher_handleInvokeError, "f").call(this, Object.freeze({ client: this, error: err, function: function_, n: n++ }), () => Promise.resolve(false))) {
|
|
2490
|
-
continue;
|
|
2491
|
-
}
|
|
2492
|
-
else {
|
|
2493
|
-
throw err;
|
|
2494
|
-
}
|
|
2495
|
-
}
|
|
2496
|
-
}
|
|
2497
|
-
};
|