@mtkruto/node 0.14.0 → 0.15.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/3_types.d.ts +4 -0
- package/esm/3_types.d.ts.map +1 -1
- package/esm/3_types.js +4 -0
- package/esm/client/0_params.d.ts +16 -2
- package/esm/client/0_params.d.ts.map +1 -1
- package/esm/client/0_update_processor.d.ts +7 -0
- package/esm/client/0_update_processor.d.ts.map +1 -0
- package/esm/client/0_update_processor.js +1 -0
- package/esm/client/2_business_connection_manager.d.ts +3 -2
- package/esm/client/2_business_connection_manager.d.ts.map +1 -1
- package/esm/client/2_business_connection_manager.js +1 -1
- package/esm/client/2_gift_manager.d.ts +29 -0
- package/esm/client/2_gift_manager.d.ts.map +1 -0
- package/esm/client/2_gift_manager.js +62 -0
- package/esm/client/2_payment_manager.d.ts +3 -2
- package/esm/client/2_payment_manager.d.ts.map +1 -1
- package/esm/client/2_payment_manager.js +1 -1
- package/esm/client/2_reaction_manager.d.ts +3 -2
- package/esm/client/2_reaction_manager.d.ts.map +1 -1
- package/esm/client/2_reaction_manager.js +1 -1
- package/esm/client/2_translations_manager.d.ts +3 -2
- package/esm/client/2_translations_manager.d.ts.map +1 -1
- package/esm/client/2_translations_manager.js +1 -1
- package/esm/client/3_message_manager.d.ts +8 -25
- package/esm/client/3_message_manager.d.ts.map +1 -1
- package/esm/client/3_message_manager.js +26 -238
- package/esm/client/3_video_chat_manager.d.ts +3 -2
- package/esm/client/3_video_chat_manager.d.ts.map +1 -1
- package/esm/client/3_video_chat_manager.js +1 -1
- package/esm/client/4_callback_query_manager.d.ts +3 -2
- package/esm/client/4_callback_query_manager.d.ts.map +1 -1
- package/esm/client/4_callback_query_manager.js +1 -1
- package/esm/client/4_chat_list_manager.d.ts +4 -3
- package/esm/client/4_chat_list_manager.d.ts.map +1 -1
- package/esm/client/4_chat_list_manager.js +2 -1
- package/esm/client/4_chat_manager.d.ts +61 -0
- package/esm/client/4_chat_manager.d.ts.map +1 -0
- package/esm/client/4_chat_manager.js +293 -0
- package/esm/client/4_inline_query_manager.d.ts +3 -2
- package/esm/client/4_inline_query_manager.d.ts.map +1 -1
- package/esm/client/4_inline_query_manager.js +1 -1
- package/esm/client/4_poll_manager.d.ts +3 -2
- package/esm/client/4_poll_manager.d.ts.map +1 -1
- package/esm/client/4_poll_manager.js +1 -1
- package/esm/client/4_story_manager.d.ts +3 -2
- package/esm/client/4_story_manager.d.ts.map +1 -1
- package/esm/client/4_story_manager.js +1 -1
- package/esm/client/5_client.d.ts +33 -6
- package/esm/client/5_client.d.ts.map +1 -1
- package/esm/client/5_client.js +163 -71
- package/esm/types/1_sticker.d.ts +1 -0
- package/esm/types/1_sticker.d.ts.map +1 -1
- package/esm/types/1_sticker.js +6 -2
- package/esm/types/2_gift_upgraded_component.d.ts +95 -0
- package/esm/types/2_gift_upgraded_component.d.ts.map +1 -0
- package/esm/types/2_gift_upgraded_component.js +88 -0
- package/esm/types/3_gift.d.ts +84 -0
- package/esm/types/3_gift.d.ts.map +1 -0
- package/esm/types/3_gift.js +90 -0
- package/esm/types/4_user_gift.d.ts +44 -0
- package/esm/types/4_user_gift.d.ts.map +1 -0
- package/esm/types/4_user_gift.js +43 -0
- package/esm/types/5_user_gifts.d.ts +32 -0
- package/esm/types/5_user_gifts.d.ts.map +1 -0
- package/esm/types/5_user_gifts.js +29 -0
- package/package.json +1 -1
- package/script/3_types.d.ts +4 -0
- package/script/3_types.d.ts.map +1 -1
- package/script/3_types.js +4 -0
- package/script/client/0_params.d.ts +16 -2
- package/script/client/0_params.d.ts.map +1 -1
- package/script/client/0_update_processor.d.ts +7 -0
- package/script/client/0_update_processor.d.ts.map +1 -0
- package/script/client/0_update_processor.js +2 -0
- package/script/client/2_business_connection_manager.d.ts +3 -2
- package/script/client/2_business_connection_manager.d.ts.map +1 -1
- package/script/client/2_business_connection_manager.js +1 -1
- package/script/client/2_gift_manager.d.ts +29 -0
- package/script/client/2_gift_manager.d.ts.map +1 -0
- package/script/client/2_gift_manager.js +66 -0
- package/script/client/2_payment_manager.d.ts +3 -2
- package/script/client/2_payment_manager.d.ts.map +1 -1
- package/script/client/2_payment_manager.js +1 -1
- package/script/client/2_reaction_manager.d.ts +3 -2
- package/script/client/2_reaction_manager.d.ts.map +1 -1
- package/script/client/2_reaction_manager.js +1 -1
- package/script/client/2_translations_manager.d.ts +3 -2
- package/script/client/2_translations_manager.d.ts.map +1 -1
- package/script/client/2_translations_manager.js +1 -1
- package/script/client/3_message_manager.d.ts +8 -25
- package/script/client/3_message_manager.d.ts.map +1 -1
- package/script/client/3_message_manager.js +23 -235
- package/script/client/3_video_chat_manager.d.ts +3 -2
- package/script/client/3_video_chat_manager.d.ts.map +1 -1
- package/script/client/3_video_chat_manager.js +1 -1
- package/script/client/4_callback_query_manager.d.ts +3 -2
- package/script/client/4_callback_query_manager.d.ts.map +1 -1
- package/script/client/4_callback_query_manager.js +1 -1
- package/script/client/4_chat_list_manager.d.ts +4 -3
- package/script/client/4_chat_list_manager.d.ts.map +1 -1
- package/script/client/4_chat_list_manager.js +2 -1
- package/script/client/4_chat_manager.d.ts +61 -0
- package/script/client/4_chat_manager.d.ts.map +1 -0
- package/script/client/4_chat_manager.js +297 -0
- package/script/client/4_inline_query_manager.d.ts +3 -2
- package/script/client/4_inline_query_manager.d.ts.map +1 -1
- package/script/client/4_inline_query_manager.js +1 -1
- package/script/client/4_poll_manager.d.ts +3 -2
- package/script/client/4_poll_manager.d.ts.map +1 -1
- package/script/client/4_poll_manager.js +1 -1
- package/script/client/4_story_manager.d.ts +3 -2
- package/script/client/4_story_manager.d.ts.map +1 -1
- package/script/client/4_story_manager.js +1 -1
- package/script/client/5_client.d.ts +33 -6
- package/script/client/5_client.d.ts.map +1 -1
- package/script/client/5_client.js +163 -71
- package/script/types/1_sticker.d.ts +1 -0
- package/script/types/1_sticker.d.ts.map +1 -1
- package/script/types/1_sticker.js +7 -2
- package/script/types/2_gift_upgraded_component.d.ts +95 -0
- package/script/types/2_gift_upgraded_component.d.ts.map +1 -0
- package/script/types/2_gift_upgraded_component.js +91 -0
- package/script/types/3_gift.d.ts +84 -0
- package/script/types/3_gift.d.ts.map +1 -0
- package/script/types/3_gift.js +95 -0
- package/script/types/4_user_gift.d.ts +44 -0
- package/script/types/4_user_gift.d.ts.map +1 -0
- package/script/types/4_user_gift.js +46 -0
- package/script/types/5_user_gifts.d.ts +32 -0
- package/script/types/5_user_gifts.d.ts.map +1 -0
- package/script/types/5_user_gifts.js +32 -0
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
3
|
+
* Copyright (C) 2023-2025 Roj <https://roj.im/>
|
|
4
|
+
*
|
|
5
|
+
* This file is part of MTKruto.
|
|
6
|
+
*
|
|
7
|
+
* This program is free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
9
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
* (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* This program is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
* GNU Lesser General Public License for more details.
|
|
16
|
+
*
|
|
17
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
18
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
|
+
*/
|
|
20
|
+
import { Api } from "../2_tl.js";
|
|
21
|
+
import { MessageEntity } from "./0_message_entity.js";
|
|
22
|
+
import { Sticker } from "./1_sticker.js";
|
|
23
|
+
/**
|
|
24
|
+
* The model of an upgraded gift.
|
|
25
|
+
*
|
|
26
|
+
* @unlisted
|
|
27
|
+
*/
|
|
28
|
+
export interface GiftUpgradedComponentModel {
|
|
29
|
+
/** @discriminator */
|
|
30
|
+
type: "model";
|
|
31
|
+
/** The name of the model. */
|
|
32
|
+
name: string;
|
|
33
|
+
/** The sticker belonging to the model. */
|
|
34
|
+
sticker: Sticker;
|
|
35
|
+
/** A number determining how rare this type of model is out of a thousand of others. */
|
|
36
|
+
rarityLevel: number;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The pattern of an upgraded gift.
|
|
40
|
+
*
|
|
41
|
+
* @unlisted
|
|
42
|
+
*/
|
|
43
|
+
export interface GiftUpgradedComponentPattern {
|
|
44
|
+
/** @discriminator */
|
|
45
|
+
type: "pattern";
|
|
46
|
+
/** The name of the pattern. */
|
|
47
|
+
name: string;
|
|
48
|
+
/** The sticker belonging to the pattern. */
|
|
49
|
+
sticker: Sticker;
|
|
50
|
+
/** A number determining how rare this type of pattern is out of a thousand of others. */
|
|
51
|
+
rarityLevel: number;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* The backdrop of an upgraded gift.
|
|
55
|
+
*
|
|
56
|
+
* @unlisted
|
|
57
|
+
*/
|
|
58
|
+
export interface GiftUpgradedComponentBackdrop {
|
|
59
|
+
/** @discriminator */
|
|
60
|
+
type: "backdrop";
|
|
61
|
+
/** The name of the backdrop. */
|
|
62
|
+
name: string;
|
|
63
|
+
/** The center color of the backdrop. */
|
|
64
|
+
centerColor: number;
|
|
65
|
+
/** The edge color of the backdrop. */
|
|
66
|
+
edgeColor: number;
|
|
67
|
+
/** The pattern color of the backdrop. */
|
|
68
|
+
patternColor: number;
|
|
69
|
+
/** The text color of the backdrop. */
|
|
70
|
+
textColor: number;
|
|
71
|
+
/** A number determining how rare this type of backdrop is out of a thousand of others. */
|
|
72
|
+
rarityLevel: number;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* The original details of an upgraded gift.
|
|
76
|
+
*
|
|
77
|
+
* @unlisted
|
|
78
|
+
*/
|
|
79
|
+
export interface GiftUpgradedComponentOriginalDetails {
|
|
80
|
+
/** @discriminator */
|
|
81
|
+
type: "originalDetails";
|
|
82
|
+
senderId?: number;
|
|
83
|
+
recipientId: number;
|
|
84
|
+
date: Date;
|
|
85
|
+
message?: string;
|
|
86
|
+
entities?: MessageEntity[];
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* A component of an upgraded gift.
|
|
90
|
+
*
|
|
91
|
+
* @unlisted
|
|
92
|
+
*/
|
|
93
|
+
export type GiftUpgradedComponent = GiftUpgradedComponentModel | GiftUpgradedComponentPattern | GiftUpgradedComponentBackdrop | GiftUpgradedComponentOriginalDetails;
|
|
94
|
+
export declare function constructGiftUpgradedComponent(attribute: Api.StarGiftAttribute): GiftUpgradedComponent;
|
|
95
|
+
//# sourceMappingURL=2_gift_upgraded_component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"2_gift_upgraded_component.d.ts","sourceRoot":"","sources":["../../src/types/2_gift_upgraded_component.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAAE,GAAG,EAAM,MAAM,YAAY,CAAC;AAErC,OAAO,EAA0B,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EAAqB,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAE5D;;;;GAIG;AACH,MAAM,WAAW,0BAA0B;IACzC,qBAAqB;IACrB,IAAI,EAAE,OAAO,CAAC;IACd,6BAA6B;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,0CAA0C;IAC1C,OAAO,EAAE,OAAO,CAAC;IACjB,uFAAuF;IACvF,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,MAAM,WAAW,4BAA4B;IAC3C,qBAAqB;IACrB,IAAI,EAAE,SAAS,CAAC;IAChB,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,4CAA4C;IAC5C,OAAO,EAAE,OAAO,CAAC;IACjB,yFAAyF;IACzF,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,MAAM,WAAW,6BAA6B;IAC5C,qBAAqB;IACrB,IAAI,EAAE,UAAU,CAAC;IACjB,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,wCAAwC;IACxC,WAAW,EAAE,MAAM,CAAC;IACpB,sCAAsC;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,yCAAyC;IACzC,YAAY,EAAE,MAAM,CAAC;IACrB,sCAAsC;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,0FAA0F;IAC1F,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,MAAM,WAAW,oCAAoC;IACnD,qBAAqB;IACrB,IAAI,EAAE,iBAAiB,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,IAAI,CAAC;IACX,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,aAAa,EAAE,CAAC;CAC5B;AAED;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAAG,0BAA0B,GAAG,4BAA4B,GAAG,6BAA6B,GAAG,oCAAoC,CAAC;AAErK,wBAAgB,8BAA8B,CAAC,SAAS,EAAE,GAAG,CAAC,iBAAiB,GAAG,qBAAqB,CA+DtG"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
3
|
+
* Copyright (C) 2023-2025 Roj <https://roj.im/>
|
|
4
|
+
*
|
|
5
|
+
* This file is part of MTKruto.
|
|
6
|
+
*
|
|
7
|
+
* This program is free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
9
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
* (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* This program is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
* GNU Lesser General Public License for more details.
|
|
16
|
+
*
|
|
17
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
18
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
|
+
*/
|
|
20
|
+
import { unreachable } from "../0_deps.js";
|
|
21
|
+
import { cleanObject, fromUnixTimestamp } from "../1_utilities.js";
|
|
22
|
+
import { is } from "../2_tl.js";
|
|
23
|
+
import { FileType, serializeFileId, toUniqueFileId } from "./_file_id.js";
|
|
24
|
+
import { constructMessageEntity } from "./0_message_entity.js";
|
|
25
|
+
import { constructSticker2 } from "./1_sticker.js";
|
|
26
|
+
export function constructGiftUpgradedComponent(attribute) {
|
|
27
|
+
const name = "name" in attribute ? attribute.name : "";
|
|
28
|
+
const rarityLevel = "rarity_permille" in attribute ? attribute.rarity_permille : 0;
|
|
29
|
+
switch (attribute._) {
|
|
30
|
+
case "starGiftAttributeModel": {
|
|
31
|
+
if (!is("document", attribute.document)) {
|
|
32
|
+
unreachable();
|
|
33
|
+
}
|
|
34
|
+
const fileId = {
|
|
35
|
+
type: FileType.Sticker,
|
|
36
|
+
dcId: attribute.document.dc_id,
|
|
37
|
+
fileReference: attribute.document.file_reference,
|
|
38
|
+
location: { type: "common", id: attribute.document.id, accessHash: attribute.document.access_hash },
|
|
39
|
+
};
|
|
40
|
+
const sticker = constructSticker2(attribute.document, serializeFileId(fileId), toUniqueFileId(fileId), undefined, "");
|
|
41
|
+
return {
|
|
42
|
+
type: "model",
|
|
43
|
+
name,
|
|
44
|
+
sticker,
|
|
45
|
+
rarityLevel,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
case "starGiftAttributePattern": {
|
|
49
|
+
if (!is("document", attribute.document)) {
|
|
50
|
+
unreachable();
|
|
51
|
+
}
|
|
52
|
+
const fileId = {
|
|
53
|
+
type: FileType.Sticker,
|
|
54
|
+
dcId: attribute.document.dc_id,
|
|
55
|
+
fileReference: attribute.document.file_reference,
|
|
56
|
+
location: { type: "common", id: attribute.document.id, accessHash: attribute.document.access_hash },
|
|
57
|
+
};
|
|
58
|
+
const sticker = constructSticker2(attribute.document, serializeFileId(fileId), toUniqueFileId(fileId), undefined, "");
|
|
59
|
+
return {
|
|
60
|
+
type: "pattern",
|
|
61
|
+
name,
|
|
62
|
+
sticker,
|
|
63
|
+
rarityLevel,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
case "starGiftAttributeBackdrop":
|
|
67
|
+
return {
|
|
68
|
+
type: "backdrop",
|
|
69
|
+
name,
|
|
70
|
+
centerColor: attribute.center_color,
|
|
71
|
+
edgeColor: attribute.edge_color,
|
|
72
|
+
patternColor: attribute.pattern_color,
|
|
73
|
+
textColor: attribute.text_color,
|
|
74
|
+
rarityLevel,
|
|
75
|
+
};
|
|
76
|
+
case "starGiftAttributeOriginalDetails":
|
|
77
|
+
return cleanObject({
|
|
78
|
+
type: "originalDetails",
|
|
79
|
+
senderId: attribute.sender_id ? Number(attribute.sender_id) : undefined,
|
|
80
|
+
recipientId: Number(attribute.recipient_id),
|
|
81
|
+
date: fromUnixTimestamp(attribute.date),
|
|
82
|
+
message: attribute.message?.text,
|
|
83
|
+
entities: attribute.message ? attribute.message.entities.map(constructMessageEntity).filter((v) => !!v) : undefined,
|
|
84
|
+
});
|
|
85
|
+
default:
|
|
86
|
+
unreachable();
|
|
87
|
+
}
|
|
88
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
3
|
+
* Copyright (C) 2023-2025 Roj <https://roj.im/>
|
|
4
|
+
*
|
|
5
|
+
* This file is part of MTKruto.
|
|
6
|
+
*
|
|
7
|
+
* This program is free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
9
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
* (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* This program is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
* GNU Lesser General Public License for more details.
|
|
16
|
+
*
|
|
17
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
18
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
|
+
*/
|
|
20
|
+
import { Api } from "../2_tl.js";
|
|
21
|
+
import { Sticker } from "./1_sticker.js";
|
|
22
|
+
import { GiftUpgradedComponent } from "./2_gift_upgraded_component.js";
|
|
23
|
+
/**
|
|
24
|
+
* An non-upgraded gift.
|
|
25
|
+
*
|
|
26
|
+
* @unlisted
|
|
27
|
+
*/
|
|
28
|
+
export interface GiftNonUpgraded {
|
|
29
|
+
/** @discriminator */
|
|
30
|
+
type: "nonupgraded";
|
|
31
|
+
/** The identifier of the gift. */
|
|
32
|
+
id: string;
|
|
33
|
+
/** The sticker that represents the gift. */
|
|
34
|
+
sticker: Sticker;
|
|
35
|
+
/** The price of the sticker in Telegram Stars. */
|
|
36
|
+
price: number;
|
|
37
|
+
/** Whether the supply of this gift is limited. */
|
|
38
|
+
limited: boolean;
|
|
39
|
+
/** The remaining supply of the gift if limited. */
|
|
40
|
+
remaining?: number;
|
|
41
|
+
/** The total supply of the gift if limited. */
|
|
42
|
+
total?: number;
|
|
43
|
+
/** Whether the gift is sold out if limited. */
|
|
44
|
+
soldOut?: boolean;
|
|
45
|
+
/** Whether the gift is dedicated to birthdays. */
|
|
46
|
+
birthday: boolean;
|
|
47
|
+
/** The amount of Telegram Stars that the gift can be swapped with. */
|
|
48
|
+
conversionPrice: number;
|
|
49
|
+
/** The date of the first sale of the gift if sold out. */
|
|
50
|
+
firstSaleDate?: Date;
|
|
51
|
+
/** The date of the last sale of the gift if sold out. */
|
|
52
|
+
lastSaleDate?: Date;
|
|
53
|
+
/** The amount of stars required to upgrade the gift. */
|
|
54
|
+
upgradePrice?: number;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* An upgraded gift.
|
|
58
|
+
*
|
|
59
|
+
* @unlisted
|
|
60
|
+
*/
|
|
61
|
+
export interface GiftUpgraded {
|
|
62
|
+
/** @discriminator */
|
|
63
|
+
type: "upgraded";
|
|
64
|
+
/** The identifier of the gift. */
|
|
65
|
+
id: string;
|
|
66
|
+
/** The title of the gift. */
|
|
67
|
+
title: string;
|
|
68
|
+
/** The unique index of the gift among others of the same type. */
|
|
69
|
+
index: number;
|
|
70
|
+
/** The identifier of the user that owns the gift. */
|
|
71
|
+
ownerId: number;
|
|
72
|
+
/** The count of the amount of upgraded gifts of the same type. */
|
|
73
|
+
currentUpgrades: number;
|
|
74
|
+
/** The maximum count of gifts of the same type that can be upgraded. */
|
|
75
|
+
maxUpgrades: number;
|
|
76
|
+
/** The components of the gift. */
|
|
77
|
+
components: GiftUpgradedComponent[];
|
|
78
|
+
}
|
|
79
|
+
/** A gift. */
|
|
80
|
+
export type Gift = GiftNonUpgraded | GiftUpgraded;
|
|
81
|
+
export declare function constructGift(gift: Api.StarGift): Gift;
|
|
82
|
+
export declare function constructGiftUpgraded(gift: Api.starGiftUnique): GiftUpgraded;
|
|
83
|
+
export declare function constructGiftNonUpgraded(gift: Api.starGift): Gift;
|
|
84
|
+
//# sourceMappingURL=3_gift.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"3_gift.d.ts","sourceRoot":"","sources":["../../src/types/3_gift.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAAE,GAAG,EAAM,MAAM,YAAY,CAAC;AAErC,OAAO,EAAqB,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAkC,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAEvG;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,qBAA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kB5E;AACD,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,GAAG,CAAC,QAAQ,GAAG,IAAI,CAqCjE"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
3
|
+
* Copyright (C) 2023-2025 Roj <https://roj.im/>
|
|
4
|
+
*
|
|
5
|
+
* This file is part of MTKruto.
|
|
6
|
+
*
|
|
7
|
+
* This program is free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
9
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
* (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* This program is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
* GNU Lesser General Public License for more details.
|
|
16
|
+
*
|
|
17
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
18
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
|
+
*/
|
|
20
|
+
import { unreachable } from "../0_deps.js";
|
|
21
|
+
import { cleanObject, fromUnixTimestamp } from "../1_utilities.js";
|
|
22
|
+
import { is } from "../2_tl.js";
|
|
23
|
+
import { FileType, serializeFileId, toUniqueFileId } from "./_file_id.js";
|
|
24
|
+
import { constructSticker2 } from "./1_sticker.js";
|
|
25
|
+
import { constructGiftUpgradedComponent } from "./2_gift_upgraded_component.js";
|
|
26
|
+
export function constructGift(gift) {
|
|
27
|
+
if (is("starGiftUnique", gift)) {
|
|
28
|
+
return constructGiftUpgraded(gift);
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
return constructGiftNonUpgraded(gift);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
export function constructGiftUpgraded(gift) {
|
|
35
|
+
const id = String(gift.id);
|
|
36
|
+
const title = gift.title;
|
|
37
|
+
const index = gift.num;
|
|
38
|
+
const ownerId = Number(gift.owner_id);
|
|
39
|
+
const currentUpgrades = gift.availability_issued;
|
|
40
|
+
const maxUpgrades = gift.availability_total;
|
|
41
|
+
const components = gift.attributes.map(constructGiftUpgradedComponent);
|
|
42
|
+
return {
|
|
43
|
+
type: "upgraded",
|
|
44
|
+
id,
|
|
45
|
+
title,
|
|
46
|
+
index,
|
|
47
|
+
ownerId,
|
|
48
|
+
currentUpgrades,
|
|
49
|
+
maxUpgrades,
|
|
50
|
+
components,
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
export function constructGiftNonUpgraded(gift) {
|
|
54
|
+
if (!is("document", gift.sticker)) {
|
|
55
|
+
unreachable();
|
|
56
|
+
}
|
|
57
|
+
const id = String(gift.id);
|
|
58
|
+
const fileId = {
|
|
59
|
+
type: FileType.Sticker,
|
|
60
|
+
dcId: gift.sticker.dc_id,
|
|
61
|
+
fileReference: gift.sticker.file_reference,
|
|
62
|
+
location: { type: "common", id: gift.sticker.id, accessHash: gift.sticker.access_hash },
|
|
63
|
+
};
|
|
64
|
+
const sticker = constructSticker2(gift.sticker, serializeFileId(fileId), toUniqueFileId(fileId), undefined, "");
|
|
65
|
+
const price = Number(gift.stars);
|
|
66
|
+
const limited = !!gift.limited;
|
|
67
|
+
const remaining = limited ? gift.availability_remains ?? 0 : undefined;
|
|
68
|
+
const total = limited ? gift.availability_total ?? 0 : undefined;
|
|
69
|
+
const soldOut = limited ? !!gift.sold_out : undefined;
|
|
70
|
+
const birthday = !!gift.birthday;
|
|
71
|
+
const conversionPrice = Number(gift.convert_stars);
|
|
72
|
+
const firstSaleDate = limited ? gift.first_sale_date ? fromUnixTimestamp(gift.first_sale_date) : undefined : undefined;
|
|
73
|
+
const lastSaleDate = limited ? gift.last_sale_date ? fromUnixTimestamp(gift.last_sale_date) : undefined : undefined;
|
|
74
|
+
const upgradePrice = gift.upgrade_stars ? Number(gift.upgrade_stars) : undefined;
|
|
75
|
+
return cleanObject({
|
|
76
|
+
type: "nonupgraded",
|
|
77
|
+
id,
|
|
78
|
+
sticker,
|
|
79
|
+
price,
|
|
80
|
+
limited,
|
|
81
|
+
remaining,
|
|
82
|
+
total,
|
|
83
|
+
soldOut,
|
|
84
|
+
birthday,
|
|
85
|
+
conversionPrice,
|
|
86
|
+
firstSaleDate,
|
|
87
|
+
lastSaleDate,
|
|
88
|
+
upgradePrice,
|
|
89
|
+
});
|
|
90
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
3
|
+
* Copyright (C) 2023-2025 Roj <https://roj.im/>
|
|
4
|
+
*
|
|
5
|
+
* This file is part of MTKruto.
|
|
6
|
+
*
|
|
7
|
+
* This program is free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
9
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
* (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* This program is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
* GNU Lesser General Public License for more details.
|
|
16
|
+
*
|
|
17
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
18
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
|
+
*/
|
|
20
|
+
import { Api } from "../2_tl.js";
|
|
21
|
+
import { MessageEntity } from "./0_message_entity.js";
|
|
22
|
+
import { User } from "./1_user.js";
|
|
23
|
+
import { Gift } from "./3_gift.js";
|
|
24
|
+
/** A gift claimed by a user. */
|
|
25
|
+
export interface UserGift {
|
|
26
|
+
/** The time when the gift was claimed. */
|
|
27
|
+
date: Date;
|
|
28
|
+
/** The gift. */
|
|
29
|
+
gift: Gift;
|
|
30
|
+
/** Whether the gift is publicly visible. */
|
|
31
|
+
public: boolean;
|
|
32
|
+
/** The user who sent the gift. */
|
|
33
|
+
fromUser?: User;
|
|
34
|
+
/** A message shared when the gift was sent. */
|
|
35
|
+
message?: string;
|
|
36
|
+
/** The entities of the message. */
|
|
37
|
+
entities?: MessageEntity[];
|
|
38
|
+
/** The identifier of the service message announcing the receival of the gift. */
|
|
39
|
+
messageId?: number;
|
|
40
|
+
/** The amount of stars the gift would be worth. */
|
|
41
|
+
convertionStars?: number;
|
|
42
|
+
}
|
|
43
|
+
export declare function constructUserGift(userGift: Api.UserStarGift, user?: Api.user): UserGift;
|
|
44
|
+
//# sourceMappingURL=4_user_gift.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"4_user_gift.d.ts","sourceRoot":"","sources":["../../src/types/4_user_gift.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAA0B,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EAAiB,IAAI,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAiB,IAAI,EAAE,MAAM,aAAa,CAAC;AAElD,gCAAgC;AAChC,MAAM,WAAW,QAAQ;IACvB,0CAA0C;IAC1C,IAAI,EAAE,IAAI,CAAC;IACX,gBAAgB;IAChB,IAAI,EAAE,IAAI,CAAC;IACX,4CAA4C;IAC5C,MAAM,EAAE,OAAO,CAAC;IAChB,kCAAkC;IAClC,QAAQ,CAAC,EAAE,IAAI,CAAC;IAChB,+CAA+C;IAC/C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mCAAmC;IACnC,QAAQ,CAAC,EAAE,aAAa,EAAE,CAAC;IAC3B,iFAAiF;IACjF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mDAAmD;IACnD,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,GAAG,CAAC,YAAY,EAAE,IAAI,CAAC,EAAE,GAAG,CAAC,IAAI,GAAG,QAAQ,CAmBvF"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
3
|
+
* Copyright (C) 2023-2025 Roj <https://roj.im/>
|
|
4
|
+
*
|
|
5
|
+
* This file is part of MTKruto.
|
|
6
|
+
*
|
|
7
|
+
* This program is free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
9
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
* (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* This program is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
* GNU Lesser General Public License for more details.
|
|
16
|
+
*
|
|
17
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
18
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
|
+
*/
|
|
20
|
+
import { cleanObject, fromUnixTimestamp } from "../1_utilities.js";
|
|
21
|
+
import { constructMessageEntity } from "./0_message_entity.js";
|
|
22
|
+
import { constructUser } from "./1_user.js";
|
|
23
|
+
import { constructGift } from "./3_gift.js";
|
|
24
|
+
export function constructUserGift(userGift, user) {
|
|
25
|
+
const gift = constructGift(userGift.gift);
|
|
26
|
+
const date = fromUnixTimestamp(userGift.date);
|
|
27
|
+
const public_ = !!userGift.unsaved;
|
|
28
|
+
const fromUser = user ? constructUser(user) : undefined;
|
|
29
|
+
const message = userGift.message?.text;
|
|
30
|
+
const entities = userGift.message ? userGift.message.entities.map(constructMessageEntity).filter((v) => !!v) : undefined;
|
|
31
|
+
const messageId = userGift.msg_id;
|
|
32
|
+
const conversionStars = userGift.convert_stars;
|
|
33
|
+
return cleanObject({
|
|
34
|
+
date,
|
|
35
|
+
gift,
|
|
36
|
+
public: public_,
|
|
37
|
+
fromUser,
|
|
38
|
+
message,
|
|
39
|
+
entities,
|
|
40
|
+
messageId,
|
|
41
|
+
conversionStars,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
3
|
+
* Copyright (C) 2023-2025 Roj <https://roj.im/>
|
|
4
|
+
*
|
|
5
|
+
* This file is part of MTKruto.
|
|
6
|
+
*
|
|
7
|
+
* This program is free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
9
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
* (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* This program is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
* GNU Lesser General Public License for more details.
|
|
16
|
+
*
|
|
17
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
18
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
|
+
*/
|
|
20
|
+
import { Api } from "../2_tl.js";
|
|
21
|
+
import { UserGift } from "./4_user_gift.js";
|
|
22
|
+
/** Gifts claimed by a user. */
|
|
23
|
+
export interface UserGifts {
|
|
24
|
+
/** The number of all gifts claimed by the user. */
|
|
25
|
+
all: number;
|
|
26
|
+
/** Offset of the results. */
|
|
27
|
+
offset?: string;
|
|
28
|
+
/** Gifts claimed by the user. */
|
|
29
|
+
gifts: UserGift[];
|
|
30
|
+
}
|
|
31
|
+
export declare function constructUserGifts(userGifts: Api.payments_UserStarGifts): UserGifts;
|
|
32
|
+
//# sourceMappingURL=5_user_gifts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"5_user_gifts.d.ts","sourceRoot":"","sources":["../../src/types/5_user_gifts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,GAAG,EAAM,MAAM,YAAY,CAAC;AACrC,OAAO,EAAqB,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE/D,+BAA+B;AAC/B,MAAM,WAAW,SAAS;IACxB,mDAAmD;IACnD,GAAG,EAAE,MAAM,CAAC;IACZ,6BAA6B;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iCAAiC;IACjC,KAAK,EAAE,QAAQ,EAAE,CAAC;CACnB;AAED,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,GAAG,CAAC,sBAAsB,GAAG,SAAS,CAMnF"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
3
|
+
* Copyright (C) 2023-2025 Roj <https://roj.im/>
|
|
4
|
+
*
|
|
5
|
+
* This file is part of MTKruto.
|
|
6
|
+
*
|
|
7
|
+
* This program is free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
9
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
* (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* This program is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
* GNU Lesser General Public License for more details.
|
|
16
|
+
*
|
|
17
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
18
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
|
+
*/
|
|
20
|
+
import { cleanObject } from "../1_utilities.js";
|
|
21
|
+
import { is } from "../2_tl.js";
|
|
22
|
+
import { constructUserGift } from "./4_user_gift.js";
|
|
23
|
+
export function constructUserGifts(userGifts) {
|
|
24
|
+
return cleanObject({
|
|
25
|
+
all: userGifts.count,
|
|
26
|
+
offset: userGifts.next_offset,
|
|
27
|
+
gifts: userGifts.gifts.map((v) => [v, v.from_id ? userGifts.users.find((u) => is("user", u) && u.id == v.from_id) : undefined]).map((v) => constructUserGift(v[0], v[1])),
|
|
28
|
+
});
|
|
29
|
+
}
|
package/package.json
CHANGED
package/script/3_types.d.ts
CHANGED
|
@@ -92,6 +92,7 @@ export * from "./types/2_chat_member.js";
|
|
|
92
92
|
export * from "./types/2_chosen_inline_result.js";
|
|
93
93
|
export * from "./types/2_forward_header.js";
|
|
94
94
|
export * from "./types/2_game.js";
|
|
95
|
+
export * from "./types/2_gift_upgraded_component.js";
|
|
95
96
|
export * from "./types/2_inactive_chat.js";
|
|
96
97
|
export * from "./types/2_inline_keyboard_button.js";
|
|
97
98
|
export * from "./types/2_inline_query.js";
|
|
@@ -107,13 +108,16 @@ export * from "./types/2_story_interactions.js";
|
|
|
107
108
|
export * from "./types/2_story_interactive_area.js";
|
|
108
109
|
export * from "./types/2_successful_payment.js";
|
|
109
110
|
export * from "./types/3_chat_member_updated.js";
|
|
111
|
+
export * from "./types/3_gift.js";
|
|
110
112
|
export * from "./types/3_join_request.js";
|
|
111
113
|
export * from "./types/3_reply_markup.js";
|
|
112
114
|
export * from "./types/3_story.js";
|
|
113
115
|
export * from "./types/4_inline_query_result.js";
|
|
114
116
|
export * from "./types/4_message.js";
|
|
117
|
+
export * from "./types/4_user_gift.js";
|
|
115
118
|
export * from "./types/5_callback_query.js";
|
|
116
119
|
export * from "./types/5_chat_list_item.js";
|
|
117
120
|
export * from "./types/5_inline_query_answer.js";
|
|
121
|
+
export * from "./types/5_user_gifts.js";
|
|
118
122
|
export * from "./types/6_update.js";
|
|
119
123
|
//# sourceMappingURL=3_types.d.ts.map
|
package/script/3_types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"3_types.d.ts","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AAC;AACpD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,mCAAmC,CAAC;AAClD,cAAc,qCAAqC,CAAC;AACpD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mBAAmB,CAAC;AAClC,cAAc,iCAAiC,CAAC;AAChD,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,qCAAqC,CAAC;AACpD,cAAc,iCAAiC,CAAC;AAChD,cAAc,kCAAkC,CAAC;AACjD,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,kCAAkC,CAAC;AACjD,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kCAAkC,CAAC;AACjD,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC"}
|
package/script/3_types.js
CHANGED
|
@@ -108,6 +108,7 @@ __exportStar(require("./types/2_chat_member.js"), exports);
|
|
|
108
108
|
__exportStar(require("./types/2_chosen_inline_result.js"), exports);
|
|
109
109
|
__exportStar(require("./types/2_forward_header.js"), exports);
|
|
110
110
|
__exportStar(require("./types/2_game.js"), exports);
|
|
111
|
+
__exportStar(require("./types/2_gift_upgraded_component.js"), exports);
|
|
111
112
|
__exportStar(require("./types/2_inactive_chat.js"), exports);
|
|
112
113
|
__exportStar(require("./types/2_inline_keyboard_button.js"), exports);
|
|
113
114
|
__exportStar(require("./types/2_inline_query.js"), exports);
|
|
@@ -123,12 +124,15 @@ __exportStar(require("./types/2_story_interactions.js"), exports);
|
|
|
123
124
|
__exportStar(require("./types/2_story_interactive_area.js"), exports);
|
|
124
125
|
__exportStar(require("./types/2_successful_payment.js"), exports);
|
|
125
126
|
__exportStar(require("./types/3_chat_member_updated.js"), exports);
|
|
127
|
+
__exportStar(require("./types/3_gift.js"), exports);
|
|
126
128
|
__exportStar(require("./types/3_join_request.js"), exports);
|
|
127
129
|
__exportStar(require("./types/3_reply_markup.js"), exports);
|
|
128
130
|
__exportStar(require("./types/3_story.js"), exports);
|
|
129
131
|
__exportStar(require("./types/4_inline_query_result.js"), exports);
|
|
130
132
|
__exportStar(require("./types/4_message.js"), exports);
|
|
133
|
+
__exportStar(require("./types/4_user_gift.js"), exports);
|
|
131
134
|
__exportStar(require("./types/5_callback_query.js"), exports);
|
|
132
135
|
__exportStar(require("./types/5_chat_list_item.js"), exports);
|
|
133
136
|
__exportStar(require("./types/5_inline_query_answer.js"), exports);
|
|
137
|
+
__exportStar(require("./types/5_user_gifts.js"), exports);
|
|
134
138
|
__exportStar(require("./types/6_update.js"), exports);
|
|
@@ -81,7 +81,7 @@ export interface SendMessageParams extends _SendCommon, _ReplyMarkupCommon {
|
|
|
81
81
|
export interface SendChatActionParams extends _BusinessConnectionIdCommon {
|
|
82
82
|
messageThreadId?: number;
|
|
83
83
|
}
|
|
84
|
-
export interface
|
|
84
|
+
export interface _EditMessageTextCommon extends _ReplyMarkupCommon {
|
|
85
85
|
/** The parse mode to use. if omitted, the default parse mode will be used. */
|
|
86
86
|
parseMode?: ParseMode;
|
|
87
87
|
/** The message's entities. */
|
|
@@ -89,7 +89,11 @@ export interface EditMessageParams extends _BusinessConnectionIdCommon, _ReplyMa
|
|
|
89
89
|
/** The message's link preview. */
|
|
90
90
|
linkPreview?: LinkPreview;
|
|
91
91
|
}
|
|
92
|
-
export interface
|
|
92
|
+
export interface EditMessageTextParams extends _BusinessConnectionIdCommon, _EditMessageTextCommon {
|
|
93
|
+
}
|
|
94
|
+
export interface EditInlineMessageTextParams extends _EditMessageTextCommon {
|
|
95
|
+
}
|
|
96
|
+
export interface _EditMessageCaptionCommon extends _ReplyMarkupCommon {
|
|
93
97
|
/** The message's new caption. If omitted, the caption will be removed. */
|
|
94
98
|
caption?: string;
|
|
95
99
|
/** The parse mode to use. If omitted, the default parse mode will be used. */
|
|
@@ -97,6 +101,10 @@ export interface EditMessageCaptionParams extends _BusinessConnectionIdCommon, _
|
|
|
97
101
|
/** The caption's entities. */
|
|
98
102
|
entities?: MessageEntity[];
|
|
99
103
|
}
|
|
104
|
+
export interface EditMessageCaptionParams extends _BusinessConnectionIdCommon, _EditMessageCaptionCommon {
|
|
105
|
+
}
|
|
106
|
+
export interface EditInlineMessageCaptionParams extends _EditMessageCaptionCommon {
|
|
107
|
+
}
|
|
100
108
|
export interface EditMessageReplyMarkupParams extends _BusinessConnectionIdCommon, _ReplyMarkupCommon {
|
|
101
109
|
}
|
|
102
110
|
export interface EditMessageMediaParams extends _BusinessConnectionIdCommon, _ReplyMarkupCommon {
|
|
@@ -512,4 +520,10 @@ export interface GetCommonChatsParams {
|
|
|
512
520
|
/** The maximum number of results to return. Must be in the range of 1-100. Defaults to 100. */
|
|
513
521
|
limit?: number;
|
|
514
522
|
}
|
|
523
|
+
export interface GetUserGiftsParams {
|
|
524
|
+
/** An offset key returned by a previous result. */
|
|
525
|
+
offset?: string;
|
|
526
|
+
/** The maximum number of results to return. */
|
|
527
|
+
limit?: number;
|
|
528
|
+
}
|
|
515
529
|
//# sourceMappingURL=0_params.d.ts.map
|