@mtkruto/node 0.0.992 → 0.0.993
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/4_constants.d.ts +1 -1
- package/esm/4_constants.js +1 -1
- package/esm/client/3_client.d.ts +62 -0
- package/esm/client/3_client.js +77 -0
- package/esm/mod.d.ts +2 -1
- package/esm/mod.js +2 -1
- package/package.json +1 -1
- package/script/4_constants.d.ts +1 -1
- package/script/4_constants.js +1 -1
- package/script/client/3_client.d.ts +62 -0
- package/script/client/3_client.js +77 -0
- package/script/mod.d.ts +2 -1
- package/script/mod.js +15 -2
package/esm/4_constants.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export declare const PUBLIC_KEYS: PublicKeys;
|
|
|
5
5
|
export declare const VECTOR_CONSTRUCTOR = 481674261;
|
|
6
6
|
export declare const INITIAL_DC: DC;
|
|
7
7
|
export declare const LAYER = 161;
|
|
8
|
-
export declare const APP_VERSION = "MTKruto 0.0.
|
|
8
|
+
export declare const APP_VERSION = "MTKruto 0.0.993";
|
|
9
9
|
export declare const DEVICE_MODEL: string;
|
|
10
10
|
export declare const LANG_CODE: string;
|
|
11
11
|
export declare const LANG_PACK = "";
|
package/esm/4_constants.js
CHANGED
|
@@ -54,7 +54,7 @@ export const PUBLIC_KEYS = Object.freeze([
|
|
|
54
54
|
export const VECTOR_CONSTRUCTOR = 0x1CB5C415;
|
|
55
55
|
export const INITIAL_DC = "2-test";
|
|
56
56
|
export const LAYER = 161;
|
|
57
|
-
export const APP_VERSION = "MTKruto 0.0.
|
|
57
|
+
export const APP_VERSION = "MTKruto 0.0.993";
|
|
58
58
|
// @ts-ignore: lib
|
|
59
59
|
export const DEVICE_MODEL = typeof dntShim.Deno === "undefined" ? typeof navigator === "undefined" ? typeof process === "undefined" ? "Unknown" : process.platform + "-" + process.arch : navigator.userAgent.split(" ")[0] : dntShim.Deno.build.os + "-" + dntShim.Deno.build.arch;
|
|
60
60
|
export const LANG_CODE = typeof navigator === "undefined" ? "en" : navigator.language.split("-")[0];
|
package/esm/client/3_client.d.ts
CHANGED
|
@@ -330,6 +330,68 @@ export declare class Client extends ClientAbstract {
|
|
|
330
330
|
* @param id ID of the callback query to answer.
|
|
331
331
|
*/
|
|
332
332
|
answerCallbackQuery(id: string, params?: AnswerCallbackQueryParams): Promise<void>;
|
|
333
|
+
sendPoll(chatId: ChatID, question: string, options: [string, string, ...string[]], params?: SendPollParams): Promise<void>;
|
|
334
|
+
}
|
|
335
|
+
export interface SendPollParams {
|
|
336
|
+
/**
|
|
337
|
+
* True, if the poll needs to be anonymous, defaults to True */
|
|
338
|
+
isAnonymous?: boolean;
|
|
339
|
+
/**
|
|
340
|
+
* The type of the poll. Defaults to regular. */
|
|
341
|
+
type?: "quiz" | "regular";
|
|
342
|
+
/**
|
|
343
|
+
* True, if the poll allows multiple answers, ignored for polls in quiz mode, defaults to False */
|
|
344
|
+
allowMultipleAnswers?: boolean;
|
|
345
|
+
/**
|
|
346
|
+
* Index of the correct option. Required for quizzes. */
|
|
347
|
+
correctOptionIndex?: number;
|
|
348
|
+
/**
|
|
349
|
+
* Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters with at most 2 line feeds after entities parsing */
|
|
350
|
+
explanation?: string;
|
|
351
|
+
/**
|
|
352
|
+
* The parse mode to use for the explanation. If not provided, the default parse mode will be used.
|
|
353
|
+
*/
|
|
354
|
+
explanationParseMode?: ParseMode;
|
|
355
|
+
/**
|
|
356
|
+
* The explanation's entities.
|
|
357
|
+
*/
|
|
358
|
+
explanationEntities?: MessageEntity[];
|
|
359
|
+
/**
|
|
360
|
+
* Amount of time in seconds the poll will be active after creation, 5-600. Can't be used together with close_date.
|
|
361
|
+
*/
|
|
362
|
+
openPeriod?: number;
|
|
363
|
+
/**
|
|
364
|
+
* Point in time when the poll will be automatically closed. Must be at least 5 and no more than 600 seconds in the future. Can't be used together with open_period.
|
|
365
|
+
*/
|
|
366
|
+
closeDate?: Date;
|
|
367
|
+
/**
|
|
368
|
+
* Pass True if the poll needs to be immediately closed. This can be useful for poll preview.
|
|
369
|
+
*/
|
|
370
|
+
isClosed?: boolean;
|
|
371
|
+
/**
|
|
372
|
+
* Whether to send the message in a silent way without making a sound on the recipients' clients.
|
|
373
|
+
*/
|
|
374
|
+
disableNotification?: boolean;
|
|
375
|
+
/**
|
|
376
|
+
* The identifier of a message to reply to.
|
|
377
|
+
*/
|
|
378
|
+
replyToMessageId?: number;
|
|
379
|
+
/**
|
|
380
|
+
* The identifier of a thread to send the message to.
|
|
381
|
+
*/
|
|
382
|
+
messageThreadId?: number;
|
|
383
|
+
/**
|
|
384
|
+
* The identifier of the chat to send the message on behalf of. User-only.
|
|
385
|
+
*/
|
|
386
|
+
sendAs?: ChatID;
|
|
387
|
+
/**
|
|
388
|
+
* The reply markup of the message. Bot-only.
|
|
389
|
+
*/
|
|
390
|
+
replyMarkup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
|
|
391
|
+
/**
|
|
392
|
+
* Whether to protect the contents of the message from copying and forwarding.
|
|
393
|
+
*/
|
|
394
|
+
protectContent?: boolean;
|
|
333
395
|
}
|
|
334
396
|
type With<T, K extends keyof T> = T & Required<Pick<T, K>>;
|
|
335
397
|
export type ConnectionState = "not-connected" | "updating" | "ready";
|
package/esm/client/3_client.js
CHANGED
|
@@ -1572,5 +1572,82 @@ export class Client extends ClientAbstract {
|
|
|
1572
1572
|
alert: params?.alert ? true : undefined,
|
|
1573
1573
|
}));
|
|
1574
1574
|
}
|
|
1575
|
+
async sendPoll(chatId, question, options, params) {
|
|
1576
|
+
const peer = await this.getInputPeer(chatId);
|
|
1577
|
+
const randomId = getRandomId();
|
|
1578
|
+
const silent = params?.disableNotification ? true : undefined;
|
|
1579
|
+
const noforwards = params?.protectContent ? true : undefined;
|
|
1580
|
+
const replyToMsgId = params?.replyToMessageId;
|
|
1581
|
+
const topMsgId = params?.messageThreadId;
|
|
1582
|
+
const sendAs = params?.sendAs ? await this.getInputPeer(params.sendAs) : undefined;
|
|
1583
|
+
let replyMarkup = undefined;
|
|
1584
|
+
if (params?.replyMarkup) {
|
|
1585
|
+
if ("inlineKeyboard" in params.replyMarkup) {
|
|
1586
|
+
replyMarkup = await inlineKeyboardMarkupToTlObject(params.replyMarkup, async (v) => {
|
|
1587
|
+
const inputPeer = await this.getInputPeer(v).then((v) => v[as](types.InputPeerUser));
|
|
1588
|
+
return new types.InputUser({ userId: inputPeer.userId, accessHash: inputPeer.accessHash });
|
|
1589
|
+
});
|
|
1590
|
+
}
|
|
1591
|
+
else if ("keyboard" in params.replyMarkup) {
|
|
1592
|
+
replyMarkup = replyKeyboardMarkupToTlObject(params.replyMarkup);
|
|
1593
|
+
}
|
|
1594
|
+
else if ("removeKeyboard" in params.replyMarkup) {
|
|
1595
|
+
replyMarkup = replyKeyboardRemoveToTlObject(params.replyMarkup);
|
|
1596
|
+
}
|
|
1597
|
+
else if ("forceReply" in params.replyMarkup) {
|
|
1598
|
+
replyMarkup = forceReplyToTlObject(params.replyMarkup);
|
|
1599
|
+
}
|
|
1600
|
+
else {
|
|
1601
|
+
throw new Error("The replyMarkup parameter has an unexpected type");
|
|
1602
|
+
}
|
|
1603
|
+
}
|
|
1604
|
+
let explanation = params?.explanation;
|
|
1605
|
+
const explanationEntities_ = params?.explanationEntities ?? [];
|
|
1606
|
+
if (explanation !== undefined) {
|
|
1607
|
+
const parseMode = params?.explanationParseMode ?? this.parseMode;
|
|
1608
|
+
switch (parseMode) {
|
|
1609
|
+
case ParseMode.None:
|
|
1610
|
+
break;
|
|
1611
|
+
case ParseMode.HTML: {
|
|
1612
|
+
const [newText, entitiesToPush] = parseHtml(explanation);
|
|
1613
|
+
explanation = newText;
|
|
1614
|
+
for (const entity of entitiesToPush) {
|
|
1615
|
+
explanationEntities_.push(entity);
|
|
1616
|
+
}
|
|
1617
|
+
}
|
|
1618
|
+
}
|
|
1619
|
+
}
|
|
1620
|
+
const solution = explanation === undefined ? undefined : explanation;
|
|
1621
|
+
const solutionEntities = explanationEntities_?.length > 0 ? explanationEntities_.map((v) => messageEntityToTlObject(v)) : undefined;
|
|
1622
|
+
const answers = options.map((v, i) => new types.PollAnswer({ option: new Uint8Array([i]), text: v }));
|
|
1623
|
+
const poll = new types.Poll({
|
|
1624
|
+
id: getRandomId(),
|
|
1625
|
+
answers,
|
|
1626
|
+
question,
|
|
1627
|
+
closed: params?.isClosed ? true : undefined,
|
|
1628
|
+
closeDate: params?.closeDate ? Math.floor(params.closeDate.getTime() / 1000) : undefined,
|
|
1629
|
+
closePeriod: params?.openPeriod ? params.openPeriod : undefined,
|
|
1630
|
+
multipleChoice: params?.allowMultipleAnswers ? true : undefined,
|
|
1631
|
+
publicVoters: params?.isAnonymous === false ? true : undefined,
|
|
1632
|
+
quiz: params?.type == "quiz" ? true : undefined,
|
|
1633
|
+
});
|
|
1634
|
+
const media = new types.InputMediaPoll({
|
|
1635
|
+
poll,
|
|
1636
|
+
correctAnswers: params?.correctOptionIndex ? [new Uint8Array([params.correctOptionIndex])] : undefined,
|
|
1637
|
+
solution,
|
|
1638
|
+
solutionEntities,
|
|
1639
|
+
});
|
|
1640
|
+
await this.invoke(new functions.MessagesSendMedia({
|
|
1641
|
+
peer,
|
|
1642
|
+
randomId,
|
|
1643
|
+
silent,
|
|
1644
|
+
noforwards,
|
|
1645
|
+
replyMarkup,
|
|
1646
|
+
replyTo: replyToMsgId !== undefined ? new types.InputReplyToMessage({ replyToMsgId, topMsgId }) : undefined,
|
|
1647
|
+
sendAs,
|
|
1648
|
+
media,
|
|
1649
|
+
message: "",
|
|
1650
|
+
}));
|
|
1651
|
+
}
|
|
1575
1652
|
}
|
|
1576
1653
|
const resolve = () => Promise.resolve();
|
package/esm/mod.d.ts
CHANGED
|
@@ -4,9 +4,10 @@ export declare const utils: {
|
|
|
4
4
|
checkPassword: typeof checkPassword;
|
|
5
5
|
getRandomId: typeof getRandomId;
|
|
6
6
|
};
|
|
7
|
-
export * from "./2_tl.js";
|
|
7
|
+
export * as tl from "./2_tl.js";
|
|
8
8
|
export * from "./2_connection.js";
|
|
9
9
|
export * from "./3_storage.js";
|
|
10
10
|
export * from "./3_transport.js";
|
|
11
11
|
export { APP_VERSION, DEVICE_MODEL, INITIAL_DC, LANG_CODE, LANG_PACK, LAYER, SYSTEM_LANG_CODE, SYSTEM_VERSION } from "./4_constants.js";
|
|
12
12
|
export * from "./5_client.js";
|
|
13
|
+
export * from "./3_types.js";
|
package/esm/mod.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { getRandomId } from "./1_utilities.js";
|
|
2
2
|
import { checkPassword } from "./client/0_password.js";
|
|
3
3
|
export const utils = { checkPassword, getRandomId };
|
|
4
|
-
export * from "./2_tl.js";
|
|
4
|
+
export * as tl from "./2_tl.js";
|
|
5
5
|
export * from "./2_connection.js";
|
|
6
6
|
export * from "./3_storage.js";
|
|
7
7
|
export * from "./3_transport.js";
|
|
8
8
|
export { APP_VERSION, DEVICE_MODEL, INITIAL_DC, LANG_CODE, LANG_PACK, LAYER, SYSTEM_LANG_CODE, SYSTEM_VERSION } from "./4_constants.js";
|
|
9
9
|
export * from "./5_client.js";
|
|
10
|
+
export * from "./3_types.js";
|
package/package.json
CHANGED
package/script/4_constants.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export declare const PUBLIC_KEYS: PublicKeys;
|
|
|
5
5
|
export declare const VECTOR_CONSTRUCTOR = 481674261;
|
|
6
6
|
export declare const INITIAL_DC: DC;
|
|
7
7
|
export declare const LAYER = 161;
|
|
8
|
-
export declare const APP_VERSION = "MTKruto 0.0.
|
|
8
|
+
export declare const APP_VERSION = "MTKruto 0.0.993";
|
|
9
9
|
export declare const DEVICE_MODEL: string;
|
|
10
10
|
export declare const LANG_CODE: string;
|
|
11
11
|
export declare const LANG_PACK = "";
|
package/script/4_constants.js
CHANGED
|
@@ -80,7 +80,7 @@ exports.PUBLIC_KEYS = Object.freeze([
|
|
|
80
80
|
exports.VECTOR_CONSTRUCTOR = 0x1CB5C415;
|
|
81
81
|
exports.INITIAL_DC = "2-test";
|
|
82
82
|
exports.LAYER = 161;
|
|
83
|
-
exports.APP_VERSION = "MTKruto 0.0.
|
|
83
|
+
exports.APP_VERSION = "MTKruto 0.0.993";
|
|
84
84
|
// @ts-ignore: lib
|
|
85
85
|
exports.DEVICE_MODEL = typeof dntShim.Deno === "undefined" ? typeof navigator === "undefined" ? typeof process === "undefined" ? "Unknown" : process.platform + "-" + process.arch : navigator.userAgent.split(" ")[0] : dntShim.Deno.build.os + "-" + dntShim.Deno.build.arch;
|
|
86
86
|
exports.LANG_CODE = typeof navigator === "undefined" ? "en" : navigator.language.split("-")[0];
|
|
@@ -330,6 +330,68 @@ export declare class Client extends ClientAbstract {
|
|
|
330
330
|
* @param id ID of the callback query to answer.
|
|
331
331
|
*/
|
|
332
332
|
answerCallbackQuery(id: string, params?: AnswerCallbackQueryParams): Promise<void>;
|
|
333
|
+
sendPoll(chatId: ChatID, question: string, options: [string, string, ...string[]], params?: SendPollParams): Promise<void>;
|
|
334
|
+
}
|
|
335
|
+
export interface SendPollParams {
|
|
336
|
+
/**
|
|
337
|
+
* True, if the poll needs to be anonymous, defaults to True */
|
|
338
|
+
isAnonymous?: boolean;
|
|
339
|
+
/**
|
|
340
|
+
* The type of the poll. Defaults to regular. */
|
|
341
|
+
type?: "quiz" | "regular";
|
|
342
|
+
/**
|
|
343
|
+
* True, if the poll allows multiple answers, ignored for polls in quiz mode, defaults to False */
|
|
344
|
+
allowMultipleAnswers?: boolean;
|
|
345
|
+
/**
|
|
346
|
+
* Index of the correct option. Required for quizzes. */
|
|
347
|
+
correctOptionIndex?: number;
|
|
348
|
+
/**
|
|
349
|
+
* Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters with at most 2 line feeds after entities parsing */
|
|
350
|
+
explanation?: string;
|
|
351
|
+
/**
|
|
352
|
+
* The parse mode to use for the explanation. If not provided, the default parse mode will be used.
|
|
353
|
+
*/
|
|
354
|
+
explanationParseMode?: ParseMode;
|
|
355
|
+
/**
|
|
356
|
+
* The explanation's entities.
|
|
357
|
+
*/
|
|
358
|
+
explanationEntities?: MessageEntity[];
|
|
359
|
+
/**
|
|
360
|
+
* Amount of time in seconds the poll will be active after creation, 5-600. Can't be used together with close_date.
|
|
361
|
+
*/
|
|
362
|
+
openPeriod?: number;
|
|
363
|
+
/**
|
|
364
|
+
* Point in time when the poll will be automatically closed. Must be at least 5 and no more than 600 seconds in the future. Can't be used together with open_period.
|
|
365
|
+
*/
|
|
366
|
+
closeDate?: Date;
|
|
367
|
+
/**
|
|
368
|
+
* Pass True if the poll needs to be immediately closed. This can be useful for poll preview.
|
|
369
|
+
*/
|
|
370
|
+
isClosed?: boolean;
|
|
371
|
+
/**
|
|
372
|
+
* Whether to send the message in a silent way without making a sound on the recipients' clients.
|
|
373
|
+
*/
|
|
374
|
+
disableNotification?: boolean;
|
|
375
|
+
/**
|
|
376
|
+
* The identifier of a message to reply to.
|
|
377
|
+
*/
|
|
378
|
+
replyToMessageId?: number;
|
|
379
|
+
/**
|
|
380
|
+
* The identifier of a thread to send the message to.
|
|
381
|
+
*/
|
|
382
|
+
messageThreadId?: number;
|
|
383
|
+
/**
|
|
384
|
+
* The identifier of the chat to send the message on behalf of. User-only.
|
|
385
|
+
*/
|
|
386
|
+
sendAs?: ChatID;
|
|
387
|
+
/**
|
|
388
|
+
* The reply markup of the message. Bot-only.
|
|
389
|
+
*/
|
|
390
|
+
replyMarkup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
|
|
391
|
+
/**
|
|
392
|
+
* Whether to protect the contents of the message from copying and forwarding.
|
|
393
|
+
*/
|
|
394
|
+
protectContent?: boolean;
|
|
333
395
|
}
|
|
334
396
|
type With<T, K extends keyof T> = T & Required<Pick<T, K>>;
|
|
335
397
|
export type ConnectionState = "not-connected" | "updating" | "ready";
|
|
@@ -1574,6 +1574,83 @@ class Client extends _1_client_abstract_js_1.ClientAbstract {
|
|
|
1574
1574
|
alert: params?.alert ? true : undefined,
|
|
1575
1575
|
}));
|
|
1576
1576
|
}
|
|
1577
|
+
async sendPoll(chatId, question, options, params) {
|
|
1578
|
+
const peer = await this.getInputPeer(chatId);
|
|
1579
|
+
const randomId = (0, _1_utilities_js_1.getRandomId)();
|
|
1580
|
+
const silent = params?.disableNotification ? true : undefined;
|
|
1581
|
+
const noforwards = params?.protectContent ? true : undefined;
|
|
1582
|
+
const replyToMsgId = params?.replyToMessageId;
|
|
1583
|
+
const topMsgId = params?.messageThreadId;
|
|
1584
|
+
const sendAs = params?.sendAs ? await this.getInputPeer(params.sendAs) : undefined;
|
|
1585
|
+
let replyMarkup = undefined;
|
|
1586
|
+
if (params?.replyMarkup) {
|
|
1587
|
+
if ("inlineKeyboard" in params.replyMarkup) {
|
|
1588
|
+
replyMarkup = await (0, _3_types_js_1.inlineKeyboardMarkupToTlObject)(params.replyMarkup, async (v) => {
|
|
1589
|
+
const inputPeer = await this.getInputPeer(v).then((v) => v[_2_tl_js_1.as](_2_tl_js_1.types.InputPeerUser));
|
|
1590
|
+
return new _2_tl_js_1.types.InputUser({ userId: inputPeer.userId, accessHash: inputPeer.accessHash });
|
|
1591
|
+
});
|
|
1592
|
+
}
|
|
1593
|
+
else if ("keyboard" in params.replyMarkup) {
|
|
1594
|
+
replyMarkup = (0, _3_types_js_1.replyKeyboardMarkupToTlObject)(params.replyMarkup);
|
|
1595
|
+
}
|
|
1596
|
+
else if ("removeKeyboard" in params.replyMarkup) {
|
|
1597
|
+
replyMarkup = (0, _3_types_js_1.replyKeyboardRemoveToTlObject)(params.replyMarkup);
|
|
1598
|
+
}
|
|
1599
|
+
else if ("forceReply" in params.replyMarkup) {
|
|
1600
|
+
replyMarkup = (0, _3_types_js_1.forceReplyToTlObject)(params.replyMarkup);
|
|
1601
|
+
}
|
|
1602
|
+
else {
|
|
1603
|
+
throw new Error("The replyMarkup parameter has an unexpected type");
|
|
1604
|
+
}
|
|
1605
|
+
}
|
|
1606
|
+
let explanation = params?.explanation;
|
|
1607
|
+
const explanationEntities_ = params?.explanationEntities ?? [];
|
|
1608
|
+
if (explanation !== undefined) {
|
|
1609
|
+
const parseMode = params?.explanationParseMode ?? this.parseMode;
|
|
1610
|
+
switch (parseMode) {
|
|
1611
|
+
case ParseMode.None:
|
|
1612
|
+
break;
|
|
1613
|
+
case ParseMode.HTML: {
|
|
1614
|
+
const [newText, entitiesToPush] = (0, _0_html_js_1.parseHtml)(explanation);
|
|
1615
|
+
explanation = newText;
|
|
1616
|
+
for (const entity of entitiesToPush) {
|
|
1617
|
+
explanationEntities_.push(entity);
|
|
1618
|
+
}
|
|
1619
|
+
}
|
|
1620
|
+
}
|
|
1621
|
+
}
|
|
1622
|
+
const solution = explanation === undefined ? undefined : explanation;
|
|
1623
|
+
const solutionEntities = explanationEntities_?.length > 0 ? explanationEntities_.map((v) => (0, _3_types_js_1.messageEntityToTlObject)(v)) : undefined;
|
|
1624
|
+
const answers = options.map((v, i) => new _2_tl_js_1.types.PollAnswer({ option: new Uint8Array([i]), text: v }));
|
|
1625
|
+
const poll = new _2_tl_js_1.types.Poll({
|
|
1626
|
+
id: (0, _1_utilities_js_1.getRandomId)(),
|
|
1627
|
+
answers,
|
|
1628
|
+
question,
|
|
1629
|
+
closed: params?.isClosed ? true : undefined,
|
|
1630
|
+
closeDate: params?.closeDate ? Math.floor(params.closeDate.getTime() / 1000) : undefined,
|
|
1631
|
+
closePeriod: params?.openPeriod ? params.openPeriod : undefined,
|
|
1632
|
+
multipleChoice: params?.allowMultipleAnswers ? true : undefined,
|
|
1633
|
+
publicVoters: params?.isAnonymous === false ? true : undefined,
|
|
1634
|
+
quiz: params?.type == "quiz" ? true : undefined,
|
|
1635
|
+
});
|
|
1636
|
+
const media = new _2_tl_js_1.types.InputMediaPoll({
|
|
1637
|
+
poll,
|
|
1638
|
+
correctAnswers: params?.correctOptionIndex ? [new Uint8Array([params.correctOptionIndex])] : undefined,
|
|
1639
|
+
solution,
|
|
1640
|
+
solutionEntities,
|
|
1641
|
+
});
|
|
1642
|
+
await this.invoke(new _2_tl_js_1.functions.MessagesSendMedia({
|
|
1643
|
+
peer,
|
|
1644
|
+
randomId,
|
|
1645
|
+
silent,
|
|
1646
|
+
noforwards,
|
|
1647
|
+
replyMarkup,
|
|
1648
|
+
replyTo: replyToMsgId !== undefined ? new _2_tl_js_1.types.InputReplyToMessage({ replyToMsgId, topMsgId }) : undefined,
|
|
1649
|
+
sendAs,
|
|
1650
|
+
media,
|
|
1651
|
+
message: "",
|
|
1652
|
+
}));
|
|
1653
|
+
}
|
|
1577
1654
|
}
|
|
1578
1655
|
exports.Client = Client;
|
|
1579
1656
|
const resolve = () => Promise.resolve();
|
package/script/mod.d.ts
CHANGED
|
@@ -4,9 +4,10 @@ export declare const utils: {
|
|
|
4
4
|
checkPassword: typeof checkPassword;
|
|
5
5
|
getRandomId: typeof getRandomId;
|
|
6
6
|
};
|
|
7
|
-
export * from "./2_tl.js";
|
|
7
|
+
export * as tl from "./2_tl.js";
|
|
8
8
|
export * from "./2_connection.js";
|
|
9
9
|
export * from "./3_storage.js";
|
|
10
10
|
export * from "./3_transport.js";
|
|
11
11
|
export { APP_VERSION, DEVICE_MODEL, INITIAL_DC, LANG_CODE, LANG_PACK, LAYER, SYSTEM_LANG_CODE, SYSTEM_VERSION } from "./4_constants.js";
|
|
12
12
|
export * from "./5_client.js";
|
|
13
|
+
export * from "./3_types.js";
|
package/script/mod.js
CHANGED
|
@@ -10,15 +10,27 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
11
11
|
o[k2] = m[k];
|
|
12
12
|
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
13
25
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
26
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
27
|
};
|
|
16
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.SYSTEM_VERSION = exports.SYSTEM_LANG_CODE = exports.LAYER = exports.LANG_PACK = exports.LANG_CODE = exports.INITIAL_DC = exports.DEVICE_MODEL = exports.APP_VERSION = exports.utils = void 0;
|
|
29
|
+
exports.SYSTEM_VERSION = exports.SYSTEM_LANG_CODE = exports.LAYER = exports.LANG_PACK = exports.LANG_CODE = exports.INITIAL_DC = exports.DEVICE_MODEL = exports.APP_VERSION = exports.tl = exports.utils = void 0;
|
|
18
30
|
const _1_utilities_js_1 = require("./1_utilities.js");
|
|
19
31
|
const _0_password_js_1 = require("./client/0_password.js");
|
|
20
32
|
exports.utils = { checkPassword: _0_password_js_1.checkPassword, getRandomId: _1_utilities_js_1.getRandomId };
|
|
21
|
-
|
|
33
|
+
exports.tl = __importStar(require("./2_tl.js"));
|
|
22
34
|
__exportStar(require("./2_connection.js"), exports);
|
|
23
35
|
__exportStar(require("./3_storage.js"), exports);
|
|
24
36
|
__exportStar(require("./3_transport.js"), exports);
|
|
@@ -32,3 +44,4 @@ Object.defineProperty(exports, "LAYER", { enumerable: true, get: function () { r
|
|
|
32
44
|
Object.defineProperty(exports, "SYSTEM_LANG_CODE", { enumerable: true, get: function () { return _4_constants_js_1.SYSTEM_LANG_CODE; } });
|
|
33
45
|
Object.defineProperty(exports, "SYSTEM_VERSION", { enumerable: true, get: function () { return _4_constants_js_1.SYSTEM_VERSION; } });
|
|
34
46
|
__exportStar(require("./5_client.js"), exports);
|
|
47
|
+
__exportStar(require("./3_types.js"), exports);
|