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