@mtkruto/node 0.125.0 → 0.127.0

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.
Files changed (59) hide show
  1. package/esm/3_types.d.ts +3 -0
  2. package/esm/3_types.d.ts.map +1 -1
  3. package/esm/3_types.js +3 -0
  4. package/esm/client/0_params.d.ts +6 -0
  5. package/esm/client/0_params.d.ts.map +1 -1
  6. package/esm/client/1_client_generic.d.ts +108 -8
  7. package/esm/client/1_client_generic.d.ts.map +1 -1
  8. package/esm/client/2_story_album_manager.d.ts +36 -0
  9. package/esm/client/2_story_album_manager.d.ts.map +1 -0
  10. package/esm/client/2_story_album_manager.js +99 -0
  11. package/esm/client/4_chat_manager.d.ts +3 -0
  12. package/esm/client/4_chat_manager.d.ts.map +1 -1
  13. package/esm/client/4_chat_manager.js +18 -0
  14. package/esm/client/4_story_manager.js +4 -4
  15. package/esm/client/6_client.d.ts +108 -8
  16. package/esm/client/6_client.d.ts.map +1 -1
  17. package/esm/client/6_client.js +138 -7
  18. package/esm/client/6_client_dispatcher.d.ts +109 -8
  19. package/esm/client/6_client_dispatcher.d.ts.map +1 -1
  20. package/esm/client/6_client_dispatcher.js +134 -7
  21. package/esm/types/2_story_album_icon.d.ts +35 -0
  22. package/esm/types/2_story_album_icon.d.ts.map +1 -0
  23. package/esm/types/2_story_album_icon.js +20 -0
  24. package/esm/types/3_story_album.d.ts +32 -0
  25. package/esm/types/3_story_album.d.ts.map +1 -0
  26. package/esm/types/3_story_album.js +50 -0
  27. package/esm/types/4_album_story_list.d.ts +33 -0
  28. package/esm/types/4_album_story_list.d.ts.map +1 -0
  29. package/esm/types/4_album_story_list.js +32 -0
  30. package/package.json +1 -1
  31. package/script/3_types.d.ts +3 -0
  32. package/script/3_types.d.ts.map +1 -1
  33. package/script/3_types.js +3 -0
  34. package/script/client/0_params.d.ts +6 -0
  35. package/script/client/0_params.d.ts.map +1 -1
  36. package/script/client/1_client_generic.d.ts +108 -8
  37. package/script/client/1_client_generic.d.ts.map +1 -1
  38. package/script/client/2_story_album_manager.d.ts +36 -0
  39. package/script/client/2_story_album_manager.d.ts.map +1 -0
  40. package/script/client/2_story_album_manager.js +103 -0
  41. package/script/client/4_chat_manager.d.ts +3 -0
  42. package/script/client/4_chat_manager.d.ts.map +1 -1
  43. package/script/client/4_chat_manager.js +18 -0
  44. package/script/client/4_story_manager.js +4 -4
  45. package/script/client/6_client.d.ts +108 -8
  46. package/script/client/6_client.d.ts.map +1 -1
  47. package/script/client/6_client.js +138 -7
  48. package/script/client/6_client_dispatcher.d.ts +109 -8
  49. package/script/client/6_client_dispatcher.d.ts.map +1 -1
  50. package/script/client/6_client_dispatcher.js +134 -7
  51. package/script/types/2_story_album_icon.d.ts +35 -0
  52. package/script/types/2_story_album_icon.d.ts.map +1 -0
  53. package/script/types/2_story_album_icon.js +21 -0
  54. package/script/types/3_story_album.d.ts +32 -0
  55. package/script/types/3_story_album.d.ts.map +1 -0
  56. package/script/types/3_story_album.js +53 -0
  57. package/script/types/4_album_story_list.d.ts +33 -0
  58. package/script/types/4_album_story_list.d.ts.map +1 -0
  59. package/script/types/4_album_story_list.js +35 -0
@@ -2043,6 +2043,34 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
2043
2043
  async getSimilarBots(chatId) {
2044
2044
  return await this.#dispatch("getSimilarBots", chatId);
2045
2045
  }
2046
+ /**
2047
+ * Get the count of online members in a chat. User-only.
2048
+ *
2049
+ * @method ch
2050
+ * @param chatId The identifier of a chat.
2051
+ * @returns The count of online members in the chat.
2052
+ */
2053
+ async getOnlineCount(chatId) {
2054
+ return await this.#dispatch("getOnlineCount", chatId);
2055
+ }
2056
+ /**
2057
+ * Enable chat history for new members. User-only.
2058
+ *
2059
+ * @method ch
2060
+ * @param chatId The identifier of a chat.
2061
+ */
2062
+ async enableChatHistoryForNewMembers(chatId) {
2063
+ return await this.#dispatch("enableChatHistoryForNewMembers", chatId);
2064
+ }
2065
+ /**
2066
+ * Disable chat history for new members. User-only.
2067
+ *
2068
+ * @method ch
2069
+ * @param chatId The identifier of a chat.
2070
+ */
2071
+ async disableChatHistoryForNewMembers(chatId) {
2072
+ return await this.#dispatch("disableChatHistoryForNewMembers", chatId);
2073
+ }
2046
2074
  //
2047
2075
  // ========================= CALLBACK QUERIES ========================= //
2048
2076
  //
@@ -2297,6 +2325,105 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
2297
2325
  return await this.#dispatch("removeStoryFromHighlights", chatId, storyId);
2298
2326
  }
2299
2327
  //
2328
+ // ========================= STORY ALBUMS ========================= //
2329
+ //
2330
+ /**
2331
+ * Create a story album. User-only.
2332
+ *
2333
+ * @method sa
2334
+ * @param chatId The identifier of the chat to create the album in.
2335
+ * @param name The name of the album.
2336
+ * @param storyIds The initial stories inside the album.
2337
+ */
2338
+ async createStoryAlbum(chatId, name, storyIds) {
2339
+ return await this.#dispatch("createStoryAlbum", chatId, name, storyIds);
2340
+ }
2341
+ /**
2342
+ * Set the name of a story album. User-only.
2343
+ *
2344
+ * @method sa
2345
+ * @param chatId The identifier of the chat including the album.
2346
+ * @param albumId The identifier of the album to rename.
2347
+ * @param name The new name of the album.
2348
+ */
2349
+ async setStoryAlbumName(chatId, albumId, name) {
2350
+ return await this.#dispatch("setStoryAlbumName", chatId, albumId, name);
2351
+ }
2352
+ /**
2353
+ * Add multiple stories to an album. User-only.
2354
+ *
2355
+ * @method sa
2356
+ * @param chatId The identifier of the chat including the album.
2357
+ * @param albumId The identifier of an album.
2358
+ * @param storyIds The identifiers of the stories to add.
2359
+ */
2360
+ async addStoriesToAlbum(chatId, albumId, storyIds) {
2361
+ return await this.#dispatch("addStoriesToAlbum", chatId, albumId, storyIds);
2362
+ }
2363
+ /**
2364
+ * Add a single story to an album. User-only.
2365
+ *
2366
+ * @method sa
2367
+ * @param chatId The identifier of the chat including the album.
2368
+ * @param albumId The identifier of an album.
2369
+ * @param storyIds The identifier of the story to add.
2370
+ */
2371
+ async addStoryToAlbum(chatId, albumId, storyId) {
2372
+ return await this.#dispatch("addStoryToAlbum", chatId, albumId, storyId);
2373
+ }
2374
+ /**
2375
+ * Remove multiple stories from an album. User-only.
2376
+ *
2377
+ * @method sa
2378
+ * @param chatId The identifier of the chat including the album.
2379
+ * @param albumId The identifier of an album.
2380
+ * @param storyIds The identifiers of the stories to remove.
2381
+ */
2382
+ async removeStoriesFromAlbum(chatId, albumId, storyIds) {
2383
+ return await this.#dispatch("removeStoriesFromAlbum", chatId, albumId, storyIds);
2384
+ }
2385
+ /**
2386
+ * Remove a single story from an album. User-only.
2387
+ *
2388
+ * @method sa
2389
+ * @param chatId The identifier of the chat including the album.
2390
+ * @param albumId The identifier of an album.
2391
+ * @param storyIds The identifier of the story to remove.
2392
+ */
2393
+ async removeStoryFromAlbum(chatId, albumId, storyId) {
2394
+ return await this.#dispatch("removeStoryFromAlbum", chatId, albumId, storyId);
2395
+ }
2396
+ /**
2397
+ * Reorder stories in an album. User-only.
2398
+ *
2399
+ * @method sa
2400
+ * @param chatId The identifier of the chat including the album.
2401
+ * @param albumId The identifier of an album.
2402
+ * @param storyIds The new order of stories.
2403
+ */
2404
+ async reorderStoriesInAlbum(chatId, albumId, storyIds) {
2405
+ return await this.#dispatch("reorderStoriesInAlbum", chatId, albumId, storyIds);
2406
+ }
2407
+ /**
2408
+ * Get story albums in a chat. User-only.
2409
+ *
2410
+ * @method sa
2411
+ * @param chatId The identifier of a chat including albums.
2412
+ */
2413
+ async getStoryAlbums(chatId) {
2414
+ return await this.#dispatch("getStoryAlbums", chatId);
2415
+ }
2416
+ /**
2417
+ * Get stories inside an album. User-only.
2418
+ *
2419
+ * @method sa
2420
+ * @param chatId The identifier of the chat including albums.
2421
+ * @param albumId The identifier of an album.
2422
+ */
2423
+ async getStoriesInAlbum(chatId, albumId) {
2424
+ return await this.#dispatch("getStoriesInAlbum", chatId, albumId);
2425
+ }
2426
+ //
2300
2427
  // ========================= MISC ========================= //
2301
2428
  //
2302
2429
  /**
@@ -2563,7 +2690,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
2563
2690
  // ========================= GIFT COLLECTIONS ========================= //
2564
2691
  //
2565
2692
  /**
2566
- * Get gift collections of a chat.
2693
+ * Get gift collections of a chat. User-only.
2567
2694
  *
2568
2695
  * @method gc
2569
2696
  * @param chatId The identifier of a chat to get gift collections for.
@@ -2572,7 +2699,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
2572
2699
  return await this.#dispatch("getGiftCollections", chatId);
2573
2700
  }
2574
2701
  /**
2575
- * Create a gift collection.
2702
+ * Create a gift collection. User-only.
2576
2703
  *
2577
2704
  * @method gc
2578
2705
  * @param chatId The identifier of a chat to create the gift collection in.
@@ -2583,7 +2710,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
2583
2710
  return await this.#dispatch("createGiftCollection", chatId, name, gifts);
2584
2711
  }
2585
2712
  /**
2586
- * Set the name of a gift collection.
2713
+ * Set the name of a gift collection. User-only.
2587
2714
  *
2588
2715
  * @method gc
2589
2716
  * @param chatId The identifier of the chat that includes the gift collection.
@@ -2594,7 +2721,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
2594
2721
  return await this.#dispatch("setGiftCollectionName", chatId, collectionId, name);
2595
2722
  }
2596
2723
  /**
2597
- * Add gifts to a gift collection.
2724
+ * Add gifts to a gift collection. User-only.
2598
2725
  *
2599
2726
  * @method gc
2600
2727
  * @param chatId The identifier of the chat that includes the gift collection.
@@ -2605,7 +2732,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
2605
2732
  return await this.#dispatch("addGiftsToCollection", chatId, collectionId, gifts);
2606
2733
  }
2607
2734
  /**
2608
- * Remove gifts from a gift collection.
2735
+ * Remove gifts from a gift collection. User-only.
2609
2736
  *
2610
2737
  * @method gc
2611
2738
  * @param chatId The identifier of the chat that includes the gift collection.
@@ -2616,7 +2743,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
2616
2743
  return await this.#dispatch("removeGiftsFromCollection", chatId, collectionId, gifts);
2617
2744
  }
2618
2745
  /**
2619
- * Reorder gifts in a gift collection.
2746
+ * Reorder gifts in a gift collection. User-only.
2620
2747
  *
2621
2748
  * @method gc
2622
2749
  * @param chatId The identifier of the chat that includes the gift collection.
@@ -2627,7 +2754,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
2627
2754
  return await this.#dispatch("reorderGiftsInCollection", chatId, collectionId, gifts);
2628
2755
  }
2629
2756
  /**
2630
- * Delete a gift collection.
2757
+ * Delete a gift collection. User-only.
2631
2758
  *
2632
2759
  * @method gc
2633
2760
  * @param chatId The identifier of the chat that includes the gift collection.
@@ -0,0 +1,35 @@
1
+ /**
2
+ * MTKruto - Cross-runtime JavaScript library for building Telegram clients
3
+ * Copyright (C) 2023-2026 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 type { Document } from "./1_document.js";
21
+ import type { Photo } from "./1_photo.js";
22
+ /** @unlisted */
23
+ export interface StoryAlbumIconPhoto {
24
+ /** @discriminator */
25
+ type: "photo";
26
+ photo: Photo;
27
+ }
28
+ /** @unlisted */
29
+ export interface StoryAlbumIconVideo {
30
+ /** @discriminator */
31
+ type: "video";
32
+ video: Document;
33
+ }
34
+ export type StoryAlbumIcon = StoryAlbumIconPhoto | StoryAlbumIconVideo;
35
+ //# sourceMappingURL=2_story_album_icon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"2_story_album_icon.d.ts","sourceRoot":"","sources":["../../src/types/2_story_album_icon.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAE1C,gBAAgB;AAChB,MAAM,WAAW,mBAAmB;IAClC,qBAAqB;IACrB,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,KAAK,CAAC;CACd;AAED,gBAAgB;AAChB,MAAM,WAAW,mBAAmB;IAClC,qBAAqB;IACrB,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,QAAQ,CAAC;CACjB;AAED,MAAM,MAAM,cAAc,GAAG,mBAAmB,GAAG,mBAAmB,CAAC"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ /**
3
+ * MTKruto - Cross-runtime JavaScript library for building Telegram clients
4
+ * Copyright (C) 2023-2026 Roj <https://roj.im/>
5
+ *
6
+ * This file is part of MTKruto.
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU Lesser General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU Lesser General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU Lesser General Public License
19
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
20
+ */
21
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,32 @@
1
+ /**
2
+ * MTKruto - Cross-runtime JavaScript library for building Telegram clients
3
+ * Copyright (C) 2023-2026 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 type { StoryAlbumIcon } from "./2_story_album_icon.js";
22
+ /** A story album. */
23
+ export interface StoryAlbum {
24
+ /** The identifier of the album. */
25
+ id: number;
26
+ /** The name of the album. */
27
+ name: string;
28
+ /** The icon of the album. */
29
+ icon?: StoryAlbumIcon;
30
+ }
31
+ export declare function constructStoryAlbum(album: Api.StoryAlbum): StoryAlbum;
32
+ //# sourceMappingURL=3_story_album.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"3_story_album.d.ts","sourceRoot":"","sources":["../../src/types/3_story_album.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAIjC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE9D,qBAAqB;AACrB,MAAM,WAAW,UAAU;IACzB,mCAAmC;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,6BAA6B;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,6BAA6B;IAC7B,IAAI,CAAC,EAAE,cAAc,CAAC;CACvB;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,GAAG,CAAC,UAAU,GAAG,UAAU,CAwBrE"}
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ /**
3
+ * MTKruto - Cross-runtime JavaScript library for building Telegram clients
4
+ * Copyright (C) 2023-2026 Roj <https://roj.im/>
5
+ *
6
+ * This file is part of MTKruto.
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU Lesser General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU Lesser General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU Lesser General Public License
19
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
20
+ */
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ exports.constructStoryAlbum = constructStoryAlbum;
23
+ const _1_utilities_js_1 = require("../1_utilities.js");
24
+ const _2_tl_js_1 = require("../2_tl.js");
25
+ const _file_id_js_1 = require("./_file_id.js");
26
+ const _1_document_js_1 = require("./1_document.js");
27
+ const _1_photo_js_1 = require("./1_photo.js");
28
+ function constructStoryAlbum(album) {
29
+ let icon;
30
+ if (album.icon_photo) {
31
+ icon = {
32
+ type: "photo",
33
+ photo: (0, _1_photo_js_1.constructPhoto)(_2_tl_js_1.Api.as("photo", album.icon_photo)),
34
+ };
35
+ }
36
+ else if (_2_tl_js_1.Api.is("document", album.icon_video)) {
37
+ const fileId = {
38
+ type: _file_id_js_1.FileType.Video,
39
+ dcId: album.icon_video.dc_id,
40
+ fileReference: album.icon_video.file_reference,
41
+ location: { type: "common", id: album.icon_video.id, accessHash: album.icon_video.access_hash },
42
+ };
43
+ icon = {
44
+ type: "video",
45
+ video: (0, _1_document_js_1.constructDocument)(album.icon_video, { _: "documentAttributeFilename", file_name: "video.mp4" }, (0, _file_id_js_1.serializeFileId)(fileId), (0, _file_id_js_1.toUniqueFileId)(fileId)),
46
+ };
47
+ }
48
+ return (0, _1_utilities_js_1.cleanObject)({
49
+ id: album.album_id,
50
+ name: album.title,
51
+ icon,
52
+ });
53
+ }
@@ -0,0 +1,33 @@
1
+ /**
2
+ * MTKruto - Cross-runtime JavaScript library for building Telegram clients
3
+ * Copyright (C) 2023-2026 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 type { PeerGetter } from "./1_chat_p.js";
22
+ import { type Story } from "./3_story.js";
23
+ /** A list of stories in a specific album. */
24
+ export interface AlbumStoryList {
25
+ /** The stories. */
26
+ stories: Story[];
27
+ /** The identifiers of the pinned stories. */
28
+ pinnedStoryIds: number[];
29
+ /** The total number of stories in this album. */
30
+ count: number;
31
+ }
32
+ export declare function constructAlbumStoryList(result: Api.stories_stories, peer: Api.peerUser | Api.peerChat | Api.peerChannel, getPeer: PeerGetter): AlbumStoryList;
33
+ //# sourceMappingURL=4_album_story_list.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"4_album_story_list.d.ts","sourceRoot":"","sources":["../../src/types/4_album_story_list.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAkB,KAAK,KAAK,EAAE,MAAM,cAAc,CAAC;AAE1D,6CAA6C;AAC7C,MAAM,WAAW,cAAc;IAC7B,mBAAmB;IACnB,OAAO,EAAE,KAAK,EAAE,CAAC;IACjB,6CAA6C;IAC7C,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,GAAG,CAAC,eAAe,EAAE,IAAI,EAAE,GAAG,CAAC,QAAQ,GAAG,GAAG,CAAC,QAAQ,GAAG,GAAG,CAAC,WAAW,EAAE,OAAO,EAAE,UAAU,GAAG,cAAc,CAS7J"}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ /**
3
+ * MTKruto - Cross-runtime JavaScript library for building Telegram clients
4
+ * Copyright (C) 2023-2026 Roj <https://roj.im/>
5
+ *
6
+ * This file is part of MTKruto.
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU Lesser General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU Lesser General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU Lesser General Public License
19
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
20
+ */
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ exports.constructAlbumStoryList = constructAlbumStoryList;
23
+ const _1_utilities_js_1 = require("../1_utilities.js");
24
+ const _2_tl_js_1 = require("../2_tl.js");
25
+ const _3_story_js_1 = require("./3_story.js");
26
+ function constructAlbumStoryList(result, peer, getPeer) {
27
+ const stories = result.stories.filter((v) => _2_tl_js_1.Api.is("storyItem", v)).map((v) => (0, _3_story_js_1.constructStory)(v, peer, getPeer));
28
+ const pinnedStoryIds = result.pinned_to_top ?? [];
29
+ const count = result.count;
30
+ return (0, _1_utilities_js_1.cleanObject)({
31
+ stories,
32
+ pinnedStoryIds,
33
+ count,
34
+ });
35
+ }