@mtkruto/node 0.115.0 → 0.116.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 (105) hide show
  1. package/esm/3_types.d.ts +6 -0
  2. package/esm/3_types.d.ts.map +1 -1
  3. package/esm/3_types.js +6 -0
  4. package/esm/client/1_client_generic.d.ts +18 -5
  5. package/esm/client/1_client_generic.d.ts.map +1 -1
  6. package/esm/client/2_account_manager.d.ts +13 -4
  7. package/esm/client/2_account_manager.d.ts.map +1 -1
  8. package/esm/client/2_account_manager.js +44 -7
  9. package/esm/client/2_bot_info_manager.d.ts +9 -2
  10. package/esm/client/2_bot_info_manager.d.ts.map +1 -1
  11. package/esm/client/2_bot_info_manager.js +14 -0
  12. package/esm/client/3_filters.d.ts +1 -1
  13. package/esm/client/3_filters.d.ts.map +1 -1
  14. package/esm/client/5_client.d.ts +18 -5
  15. package/esm/client/5_client.d.ts.map +1 -1
  16. package/esm/client/5_client.js +29 -6
  17. package/esm/client/5_client_dispatcher.d.ts +18 -5
  18. package/esm/client/5_client_dispatcher.d.ts.map +1 -1
  19. package/esm/client/5_client_dispatcher.js +23 -6
  20. package/esm/types/0_emoji_status.d.ts +45 -0
  21. package/esm/types/0_emoji_status.d.ts.map +1 -0
  22. package/esm/types/0_emoji_status.js +33 -0
  23. package/esm/types/0_input_emoji_status.d.ts +33 -0
  24. package/esm/types/0_input_emoji_status.d.ts.map +1 -0
  25. package/esm/types/0_input_emoji_status.js +20 -0
  26. package/esm/types/0_user_status.d.ts +64 -0
  27. package/esm/types/0_user_status.d.ts.map +1 -0
  28. package/esm/types/0_user_status.js +35 -0
  29. package/esm/types/1_bot_commands.d.ts +30 -0
  30. package/esm/types/1_bot_commands.d.ts.map +1 -0
  31. package/esm/types/1_bot_commands.js +20 -0
  32. package/esm/types/1_chat_p.d.ts +6 -0
  33. package/esm/types/1_chat_p.d.ts.map +1 -1
  34. package/esm/types/1_chat_p.js +4 -0
  35. package/esm/types/2_user.d.ts +6 -0
  36. package/esm/types/2_user.d.ts.map +1 -1
  37. package/esm/types/2_user.js +5 -0
  38. package/esm/types/4_gift.d.ts +1 -1
  39. package/esm/types/4_gift.d.ts.map +1 -1
  40. package/esm/types/5_claimed_gift.d.ts +1 -1
  41. package/esm/types/5_claimed_gift.js +1 -1
  42. package/esm/types/5_gift_non_upgraded_information.d.ts +47 -0
  43. package/esm/types/5_gift_non_upgraded_information.d.ts.map +1 -0
  44. package/esm/types/5_gift_non_upgraded_information.js +69 -0
  45. package/esm/types/5_gift_upgraded_information.d.ts +41 -0
  46. package/esm/types/5_gift_upgraded_information.d.ts.map +1 -0
  47. package/esm/types/5_gift_upgraded_information.js +58 -0
  48. package/esm/types/6_message.d.ts +21 -1
  49. package/esm/types/6_message.d.ts.map +1 -1
  50. package/esm/types/6_message.js +12 -0
  51. package/esm/types/8_update.d.ts +60 -2
  52. package/esm/types/8_update.d.ts.map +1 -1
  53. package/package.json +1 -1
  54. package/script/3_types.d.ts +6 -0
  55. package/script/3_types.d.ts.map +1 -1
  56. package/script/3_types.js +6 -0
  57. package/script/client/1_client_generic.d.ts +18 -5
  58. package/script/client/1_client_generic.d.ts.map +1 -1
  59. package/script/client/2_account_manager.d.ts +13 -4
  60. package/script/client/2_account_manager.d.ts.map +1 -1
  61. package/script/client/2_account_manager.js +43 -6
  62. package/script/client/2_bot_info_manager.d.ts +9 -2
  63. package/script/client/2_bot_info_manager.d.ts.map +1 -1
  64. package/script/client/2_bot_info_manager.js +14 -0
  65. package/script/client/3_filters.d.ts +1 -1
  66. package/script/client/3_filters.d.ts.map +1 -1
  67. package/script/client/5_client.d.ts +18 -5
  68. package/script/client/5_client.d.ts.map +1 -1
  69. package/script/client/5_client.js +29 -6
  70. package/script/client/5_client_dispatcher.d.ts +18 -5
  71. package/script/client/5_client_dispatcher.d.ts.map +1 -1
  72. package/script/client/5_client_dispatcher.js +23 -6
  73. package/script/types/0_emoji_status.d.ts +45 -0
  74. package/script/types/0_emoji_status.d.ts.map +1 -0
  75. package/script/types/0_emoji_status.js +36 -0
  76. package/script/types/0_input_emoji_status.d.ts +33 -0
  77. package/script/types/0_input_emoji_status.d.ts.map +1 -0
  78. package/script/types/0_input_emoji_status.js +21 -0
  79. package/script/types/0_user_status.d.ts +64 -0
  80. package/script/types/0_user_status.d.ts.map +1 -0
  81. package/script/types/0_user_status.js +38 -0
  82. package/script/types/1_bot_commands.d.ts +30 -0
  83. package/script/types/1_bot_commands.d.ts.map +1 -0
  84. package/script/types/1_bot_commands.js +21 -0
  85. package/script/types/1_chat_p.d.ts +6 -0
  86. package/script/types/1_chat_p.d.ts.map +1 -1
  87. package/script/types/1_chat_p.js +4 -0
  88. package/script/types/2_user.d.ts +6 -0
  89. package/script/types/2_user.d.ts.map +1 -1
  90. package/script/types/2_user.js +5 -0
  91. package/script/types/4_gift.d.ts +1 -1
  92. package/script/types/4_gift.d.ts.map +1 -1
  93. package/script/types/5_claimed_gift.d.ts +1 -1
  94. package/script/types/5_claimed_gift.js +1 -1
  95. package/script/types/5_gift_non_upgraded_information.d.ts +47 -0
  96. package/script/types/5_gift_non_upgraded_information.d.ts.map +1 -0
  97. package/script/types/5_gift_non_upgraded_information.js +72 -0
  98. package/script/types/5_gift_upgraded_information.d.ts +41 -0
  99. package/script/types/5_gift_upgraded_information.d.ts.map +1 -0
  100. package/script/types/5_gift_upgraded_information.js +61 -0
  101. package/script/types/6_message.d.ts +21 -1
  102. package/script/types/6_message.d.ts.map +1 -1
  103. package/script/types/6_message.js +12 -0
  104. package/script/types/8_update.d.ts +60 -2
  105. package/script/types/8_update.d.ts.map +1 -1
@@ -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,64 @@
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 { Api } from "../2_tl.js";
21
+ /**
22
+ * A user status indicating that the user is currently online.
23
+ * @unlisted
24
+ */
25
+ export interface UserStatusOnline {
26
+ type: "online";
27
+ }
28
+ /**
29
+ * A user status indicating that the user is currently offline.
30
+ * @unlisted
31
+ */
32
+ export interface UserStatusOffline {
33
+ /** @discriminator */
34
+ type: "offline";
35
+ /** A point in time in which the user was last seen online. */
36
+ lastSeenAt: number;
37
+ }
38
+ /**
39
+ * A user status indictating that the user was last seen online recently.
40
+ * @unlisted
41
+ */
42
+ export interface UserStatusLastSeenRecently {
43
+ /** @discriminator */
44
+ type: "lastSeenRecently";
45
+ }
46
+ /**
47
+ * A user status indictating that the user was last seen online around a week ago.
48
+ * @unlisted
49
+ */
50
+ export interface UserStatusLastSeenLastWeek {
51
+ /** @discriminator */
52
+ type: "lastSeenLastWeek";
53
+ }
54
+ /**
55
+ * A user status indictating that the user was last seen online around a month ago.
56
+ * @unlisted
57
+ */
58
+ export interface UserStatusLastSeenLastMonth {
59
+ /** @discriminator */
60
+ type: "lastSeenLastMonth";
61
+ }
62
+ export type UserStatus = UserStatusOnline | UserStatusOffline | UserStatusLastSeenRecently | UserStatusLastSeenLastWeek | UserStatusLastSeenLastMonth;
63
+ export declare function constructUserStatus(userStatus: Api.UserStatus): UserStatus;
64
+ //# sourceMappingURL=0_user_status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"0_user_status.d.ts","sourceRoot":"","sources":["../../src/types/0_user_status.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEtC;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,QAAQ,CAAC;CAChB;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,qBAAqB;IACrB,IAAI,EAAE,SAAS,CAAC;IAChB,8DAA8D;IAC9D,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,0BAA0B;IACzC,qBAAqB;IACrB,IAAI,EAAE,kBAAkB,CAAC;CAC1B;AAED;;;GAGG;AACH,MAAM,WAAW,0BAA0B;IACzC,qBAAqB;IACrB,IAAI,EAAE,kBAAkB,CAAC;CAC1B;AAED;;;GAGG;AACH,MAAM,WAAW,2BAA2B;IAC1C,qBAAqB;IACrB,IAAI,EAAE,mBAAmB,CAAC;CAC3B;AAED,MAAM,MAAM,UAAU,GAAG,gBAAgB,GAAG,iBAAiB,GAAG,0BAA0B,GAAG,0BAA0B,GAAG,2BAA2B,CAAC;AAEtJ,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,GAAG,CAAC,UAAU,GAAG,UAAU,CAe1E"}
@@ -0,0 +1,38 @@
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.constructUserStatus = constructUserStatus;
23
+ function constructUserStatus(userStatus) {
24
+ switch (userStatus._) {
25
+ case "userStatusEmpty":
26
+ return { type: "lastSeenRecently" };
27
+ case "userStatusOnline":
28
+ return { type: "online" };
29
+ case "userStatusOffline":
30
+ return { type: "offline", lastSeenAt: userStatus.was_online };
31
+ case "userStatusRecently":
32
+ return { type: "lastSeenRecently" };
33
+ case "userStatusLastWeek":
34
+ return { type: "lastSeenLastWeek" };
35
+ case "userStatusLastMonth":
36
+ return { type: "lastSeenLastMonth" };
37
+ }
38
+ }
@@ -0,0 +1,30 @@
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 { BotCommand } from "./0_bot_command.js";
21
+ /** A bot's list of commands. */
22
+ export interface BotCommands {
23
+ /** The identifier of the bot. */
24
+ botId: number;
25
+ /** The identifier of the chat in which the command list is valid. */
26
+ chatId: number;
27
+ /** The list of commands. */
28
+ commands: BotCommand[];
29
+ }
30
+ //# sourceMappingURL=1_bot_commands.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1_bot_commands.d.ts","sourceRoot":"","sources":["../../src/types/1_bot_commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,gCAAgC;AAChC,MAAM,WAAW,WAAW;IAC1B,iCAAiC;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,qEAAqE;IACrE,MAAM,EAAE,MAAM,CAAC;IACf,4BAA4B;IAC5B,QAAQ,EAAE,UAAU,EAAE,CAAC;CACxB"}
@@ -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 });
@@ -19,7 +19,9 @@
19
19
  */
20
20
  import { Api } from "../2_tl.js";
21
21
  import { type ChatPhoto } from "./0_chat_photo.js";
22
+ import { type EmojiStatus } from "./0_emoji_status.js";
22
23
  import { type RestrictionReason } from "./0_restriction_reason.js";
24
+ import { type UserStatus } from "./0_user_status.js";
23
25
  /** @unlisted */
24
26
  export type ChatType = "private" | "group" | "supergroup" | "channel";
25
27
  /** @unlisted */
@@ -47,6 +49,10 @@ export interface ChatPPrivate extends _ChatPBase {
47
49
  username?: string;
48
50
  /** The user's additional usernames. */
49
51
  also?: string[];
52
+ /** The user's status. */
53
+ status?: UserStatus;
54
+ /** The user's emoji status. */
55
+ emojiStatus?: EmojiStatus;
50
56
  /** The user's [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag). */
51
57
  languageCode?: string;
52
58
  /** Whether the user has been identified as scam. */
@@ -1 +1 @@
1
- {"version":3,"file":"1_chat_p.d.ts","sourceRoot":"","sources":["../../src/types/1_chat_p.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEjC,OAAO,EAAE,KAAK,SAAS,EAAsB,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAA8B,KAAK,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAE/F,gBAAgB;AAChB,MAAM,MAAM,QAAQ,GAChB,SAAS,GACT,OAAO,GACP,YAAY,GACZ,SAAS,CAAC;AAEd,gBAAgB;AAChB,MAAM,WAAW,UAAU;IACzB,kCAAkC;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,4BAA4B;IAC5B,IAAI,EAAE,QAAQ,CAAC;IACf,+EAA+E;IAC/E,KAAK,EAAE,MAAM,CAAC;IACd,wBAAwB;IACxB,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAED,gBAAgB;AAChB,MAAM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AAI,EAAE,GAAG,CAAC,QAAQ,GAAG,GAAG,CAAC,QAAQ,GAAG,GAAG,CAAC,WAAW,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;CAC/E;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,YAAY,CAE/D"}
@@ -26,7 +26,9 @@ const _1_utilities_js_1 = require("../1_utilities.js");
26
26
  const _2_tl_js_1 = require("../2_tl.js");
27
27
  const _2_telegram_js_1 = require("../tl/2_telegram.js");
28
28
  const _0_chat_photo_js_1 = require("./0_chat_photo.js");
29
+ const _0_emoji_status_js_1 = require("./0_emoji_status.js");
29
30
  const _0_restriction_reason_js_1 = require("./0_restriction_reason.js");
31
+ const _0_user_status_js_1 = require("./0_user_status.js");
30
32
  function constructChatP(chat) {
31
33
  if (_2_tl_js_1.Api.is("user", chat)) {
32
34
  const id = Number(chat.id);
@@ -42,6 +44,8 @@ function constructChatP(chat) {
42
44
  username,
43
45
  languageCode: chat.lang_code,
44
46
  also: usernames?.filter((v) => v !== username),
47
+ status: chat.status ? (0, _0_user_status_js_1.constructUserStatus)(chat.status) : undefined,
48
+ emojiStatus: chat.emoji_status ? (0, _0_emoji_status_js_1.constructEmojiStatus)(chat.emoji_status) : undefined,
45
49
  isScam: chat.scam || false,
46
50
  isFake: chat.fake || false,
47
51
  isPremium: chat.premium || false,
@@ -19,7 +19,9 @@
19
19
  */
20
20
  import { Api } from "../2_tl.js";
21
21
  import { type ChatPhoto } from "./0_chat_photo.js";
22
+ import { type EmojiStatus } from "./0_emoji_status.js";
22
23
  import type { RestrictionReason } from "./0_restriction_reason.js";
24
+ import { type UserStatus } from "./0_user_status.js";
23
25
  import type { ChatPPrivate } from "./1_chat_p.js";
24
26
  /** A user. */
25
27
  export interface User {
@@ -37,6 +39,10 @@ export interface User {
37
39
  username?: string;
38
40
  /** The user's additional usernames. */
39
41
  also?: string[];
42
+ /** The user's status. */
43
+ status?: UserStatus;
44
+ /** The user's emoji status. */
45
+ emojiStatus?: EmojiStatus;
40
46
  /** The user's profile photo. */
41
47
  photo?: ChatPhoto;
42
48
  /** The user's [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag). */
@@ -1 +1 @@
1
- {"version":3,"file":"2_user.d.ts","sourceRoot":"","sources":["../../src/types/2_user.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,KAAK,SAAS,EAAsB,MAAM,mBAAmB,CAAC;AACvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD,cAAc;AACd,MAAM,WAAW,IAAI;IACnB,6CAA6C;IAC7C,EAAE,EAAE,MAAM,CAAC;IACX,6EAA6E;IAC7E,KAAK,EAAE,MAAM,CAAC;IACd,iCAAiC;IACjC,KAAK,EAAE,OAAO,CAAC;IACf,kCAAkC;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,iCAAiC;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gCAAgC;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,uCAAuC;IACvC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,gCAAgC;IAChC,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,uFAAuF;IACvF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oDAAoD;IACpD,MAAM,EAAE,OAAO,CAAC;IAChB,+DAA+D;IAC/D,MAAM,EAAE,OAAO,CAAC;IAChB,0DAA0D;IAC1D,SAAS,EAAE,OAAO,CAAC;IACnB,0CAA0C;IAC1C,UAAU,EAAE,OAAO,CAAC;IACpB,4CAA4C;IAC5C,SAAS,EAAE,OAAO,CAAC;IACnB,4CAA4C;IAC5C,YAAY,EAAE,OAAO,CAAC;IACtB,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B,gCAAgC;IAChC,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,uFAAuF;IACvF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oDAAoD;IACpD,MAAM,EAAE,OAAO,CAAC;IAChB,+DAA+D;IAC/D,MAAM,EAAE,OAAO,CAAC;IAChB,0DAA0D;IAC1D,SAAS,EAAE,OAAO,CAAC;IACnB,0CAA0C;IAC1C,UAAU,EAAE,OAAO,CAAC;IACpB,4CAA4C;IAC5C,SAAS,EAAE,OAAO,CAAC;IACnB,4CAA4C;IAC5C,YAAY,EAAE,OAAO,CAAC;IACtB,mDAAmD;IACnD,iBAAiB,CAAC,EAAE,iBAAiB,EAAE,CAAC;IACxC,gGAAgG;IAChG,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,0DAA0D;IAC1D,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,GAAG,CAAC,IAAI,GAAG,IAAI,CA+BnD;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAsBxD"}
@@ -24,10 +24,13 @@ exports.constructUser2 = constructUser2;
24
24
  const _1_utilities_js_1 = require("../1_utilities.js");
25
25
  const _2_tl_js_1 = require("../2_tl.js");
26
26
  const _0_chat_photo_js_1 = require("./0_chat_photo.js");
27
+ const _0_emoji_status_js_1 = require("./0_emoji_status.js");
28
+ const _0_user_status_js_1 = require("./0_user_status.js");
27
29
  function constructUser(user_) {
28
30
  const id = Number(user_.id);
29
31
  const usernames = user_.usernames?.map((v) => v.username);
30
32
  const username = user_.username ?? usernames?.shift();
33
+ user_.emoji_status;
31
34
  const user = {
32
35
  id,
33
36
  color: _2_tl_js_1.Api.is("peerColor", user_.color) && user_.color.color !== undefined ? user_.color.color : (0, _1_utilities_js_1.getColorFromPeerId)(id),
@@ -36,6 +39,8 @@ function constructUser(user_) {
36
39
  lastName: user_.last_name,
37
40
  username: username,
38
41
  also: usernames?.filter((v) => v !== username),
42
+ status: user_.status ? (0, _0_user_status_js_1.constructUserStatus)(user_.status) : undefined,
43
+ emojiStatus: user_.emoji_status ? (0, _0_emoji_status_js_1.constructEmojiStatus)(user_.emoji_status) : undefined,
39
44
  languageCode: user_.lang_code,
40
45
  isScam: user_.scam || false,
41
46
  isFake: user_.fake || false,
@@ -96,5 +96,5 @@ export interface GiftUpgraded {
96
96
  export type Gift = GiftNonUpgraded | GiftUpgraded;
97
97
  export declare function constructGift(gift: Api.StarGift, getPeer: PeerGetter): Gift;
98
98
  export declare function constructGiftUpgraded(gift: Api.starGiftUnique, getPeer: PeerGetter): GiftUpgraded;
99
- export declare function constructGiftNonUpgraded(gift: Api.starGift): Gift;
99
+ export declare function constructGiftNonUpgraded(gift: Api.starGift): GiftNonUpgraded;
100
100
  //# sourceMappingURL=4_gift.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"4_gift.d.ts","sourceRoot":"","sources":["../../src/types/4_gift.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEjC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAqB,KAAK,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAkC,KAAK,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAE5G;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,qBAAqB;IACrB,IAAI,EAAE,aAAa,CAAC;IACpB,kCAAkC;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,4CAA4C;IAC5C,OAAO,EAAE,OAAO,CAAC;IACjB,kDAAkD;IAClD,KAAK,EAAE,MAAM,CAAC;IACd,kDAAkD;IAClD,SAAS,EAAE,OAAO,CAAC;IACnB,mDAAmD;IACnD,SAAS,CAA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ClaimedGift {
38
38
  /** The identifier of the service message announcing the receival of the gift. */
39
39
  messageId?: number;
40
40
  /** The amount of stars the gift would be worth. */
41
- convertionStars?: number;
41
+ conversionStars?: number;
42
42
  }
43
43
  export declare function constructClaimedGift(savedStarGift: Api.SavedStarGift, fromPeer: Api.User | Api.Chat | undefined, getPeer: PeerGetter): ClaimedGift;
44
44
  //# sourceMappingURL=5_claimed_gift.d.ts.map
@@ -32,7 +32,7 @@ function constructClaimedGift(savedStarGift, fromPeer, getPeer) {
32
32
  const message = savedStarGift.message?.text;
33
33
  const entities = savedStarGift.message ? savedStarGift.message.entities.map(_2_message_entity_js_1.constructMessageEntity).filter((v) => !!v) : undefined;
34
34
  const messageId = savedStarGift.msg_id;
35
- const conversionStars = savedStarGift.convert_stars;
35
+ const conversionStars = savedStarGift.convert_stars ? Number(savedStarGift.convert_stars) : undefined;
36
36
  return (0, _1_utilities_js_1.cleanObject)({
37
37
  date,
38
38
  gift,
@@ -0,0 +1,47 @@
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 { ChatP, PeerGetter } from "./1_chat_p.js";
22
+ import { type MessageEntity } from "./2_message_entity.js";
23
+ import { type GiftNonUpgraded } from "./4_gift.js";
24
+ /** Information on a non-upgraded gift. */
25
+ export interface GiftNonUpgradedInformation {
26
+ isNameHidden: boolean;
27
+ isSaved: boolean;
28
+ isConverted: boolean;
29
+ isUpgraded: boolean;
30
+ isRefunded: boolean;
31
+ isUpgradable: boolean;
32
+ isPrepaidUpgrade: boolean;
33
+ isUpgradedSeparately: boolean;
34
+ gift: GiftNonUpgraded;
35
+ message?: string;
36
+ messageEntities?: MessageEntity[];
37
+ conversionPrice?: number;
38
+ upgradeMessageId?: number;
39
+ upgradePrice?: number;
40
+ from?: ChatP;
41
+ to?: ChatP;
42
+ inputId?: string;
43
+ prepaidUpgradeHash?: string;
44
+ giftMessageId?: number;
45
+ }
46
+ export declare function constructGiftNonUpgradedInformation(action: Api.messageActionStarGift, getPeer: PeerGetter): GiftNonUpgradedInformation;
47
+ //# sourceMappingURL=5_gift_non_upgraded_information.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"5_gift_non_upgraded_information.d.ts","sourceRoot":"","sources":["../../src/types/5_gift_non_upgraded_information.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAA0B,KAAK,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACnF,OAAO,EAA4B,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAE7E,0CAA0C;AAC1C,MAAM,WAAW,0BAA0B;IACzC,YAAY,EAAE,OAAO,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;IACtB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,IAAI,EAAE,eAAe,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,aAAa,EAAE,CAAC;IAClC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,KAAK,CAAC;IACb,EAAE,CAAC,EAAE,KAAK,CAAC;IACX,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,wBAAgB,mCAAmC,CAAC,MAAM,EAAE,GAAG,CAAC,qBAAqB,EAAE,OAAO,EAAE,UAAU,GAAG,0BAA0B,CA8CtI"}
@@ -0,0 +1,72 @@
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.constructGiftNonUpgradedInformation = constructGiftNonUpgradedInformation;
23
+ const _0_deps_js_1 = require("../0_deps.js");
24
+ const _1_utilities_js_1 = require("../1_utilities.js");
25
+ const _2_tl_js_1 = require("../2_tl.js");
26
+ const _2_message_entity_js_1 = require("./2_message_entity.js");
27
+ const _4_gift_js_1 = require("./4_gift.js");
28
+ function constructGiftNonUpgradedInformation(action, getPeer) {
29
+ const isNameHidden = action.name_hidden ? true : false;
30
+ const isSaved = action.saved ? true : false;
31
+ const isConverted = action.converted ? true : false;
32
+ const isUpgraded = action.upgraded ? true : false;
33
+ const isRefunded = action.refunded ? true : false;
34
+ const isUpgradable = action.can_upgrade ? true : false;
35
+ const isPrepaidUpgrade = action.prepaid_upgrade ? true : false;
36
+ const isUpgradedSeparately = action.upgrade_separate ? true : false;
37
+ const gift = (0, _4_gift_js_1.constructGiftNonUpgraded)(_2_tl_js_1.Api.as("starGift", action.gift));
38
+ const message = action.message?.text;
39
+ const messageEntities = action.message?.entities.map((v) => (0, _2_message_entity_js_1.constructMessageEntity)(v)).filter((v) => v !== null);
40
+ const conversionPrice = action.convert_stars ? Number(action.convert_stars) : undefined;
41
+ const upgradeMessageId = action.upgrade_msg_id;
42
+ const upgradePrice = action.upgrade_stars ? Number(action.upgrade_stars) : undefined;
43
+ const from = action.from_id ? getPeer(action.from_id)?.[0] : undefined;
44
+ const to = action.to_id ? getPeer(action.to_id)?.[0] : undefined;
45
+ const inputId = action.saved_id ? String(action.saved_id) : undefined;
46
+ const prepaidUpgradeHash = action.prepaid_upgrade_hash;
47
+ const giftMessageId = action.gift_msg_id;
48
+ if ((action.from_id && !from) || (action.to_id && !to)) {
49
+ (0, _0_deps_js_1.unreachable)();
50
+ }
51
+ return (0, _1_utilities_js_1.cleanObject)({
52
+ isNameHidden,
53
+ isSaved,
54
+ isConverted,
55
+ isUpgraded,
56
+ isRefunded,
57
+ isUpgradable,
58
+ isPrepaidUpgrade,
59
+ isUpgradedSeparately,
60
+ gift,
61
+ message,
62
+ messageEntities,
63
+ conversionPrice,
64
+ upgradeMessageId,
65
+ upgradePrice,
66
+ from,
67
+ to,
68
+ inputId,
69
+ prepaidUpgradeHash,
70
+ giftMessageId,
71
+ });
72
+ }
@@ -0,0 +1,41 @@
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 { ChatP, PeerGetter } from "./1_chat_p.js";
22
+ import { type GiftUpgraded } from "./4_gift.js";
23
+ /** Information on an upgraded gift. */
24
+ export interface GiftUpgradedInformation {
25
+ isUpgraded: boolean;
26
+ isTransferred: boolean;
27
+ isSaved: boolean;
28
+ isRefunded: boolean;
29
+ isPrepaidUpgrade: boolean;
30
+ gift: GiftUpgraded;
31
+ exportableAt?: number;
32
+ transferPrice?: number;
33
+ from?: ChatP;
34
+ to?: ChatP;
35
+ inputId?: string;
36
+ resalePrice?: number;
37
+ transferrableAt?: number;
38
+ resellableAt?: number;
39
+ }
40
+ export declare function constructGiftUpgradedInformation(action: Api.messageActionStarGiftUnique, getPeer: PeerGetter): GiftUpgradedInformation;
41
+ //# sourceMappingURL=5_gift_upgraded_information.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"5_gift_upgraded_information.d.ts","sourceRoot":"","sources":["../../src/types/5_gift_upgraded_information.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAyB,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAEvE,uCAAuC;AACvC,MAAM,WAAW,uBAAuB;IACtC,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,OAAO,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,OAAO,CAAC;IACpB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,IAAI,EAAE,YAAY,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,KAAK,CAAC;IACb,EAAE,CAAC,EAAE,KAAK,CAAC;IACX,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,wBAAgB,gCAAgC,CAAC,MAAM,EAAE,GAAG,CAAC,2BAA2B,EAAE,OAAO,EAAE,UAAU,GAAG,uBAAuB,CAoCtI"}
@@ -0,0 +1,61 @@
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.constructGiftUpgradedInformation = constructGiftUpgradedInformation;
23
+ const _0_deps_js_1 = require("../0_deps.js");
24
+ const _1_utilities_js_1 = require("../1_utilities.js");
25
+ const _2_tl_js_1 = require("../2_tl.js");
26
+ const _4_gift_js_1 = require("./4_gift.js");
27
+ function constructGiftUpgradedInformation(action, getPeer) {
28
+ const isUpgraded = action.upgrade ? true : false;
29
+ const isTransferred = action.transferred ? true : false;
30
+ const isSaved = action.saved ? true : false;
31
+ const isRefunded = action.refunded ? true : false;
32
+ const isPrepaidUpgrade = action.prepaid_upgrade ? true : false;
33
+ const gift = (0, _4_gift_js_1.constructGiftUpgraded)(_2_tl_js_1.Api.as("starGiftUnique", action.gift), getPeer);
34
+ const exportableAt = action.can_export_at;
35
+ const transferPrice = action.transfer_stars ? Number(action.transfer_stars) : undefined;
36
+ const from = action.from_id ? getPeer(action.from_id)?.[0] : undefined;
37
+ const to = action.peer ? getPeer(action.peer)?.[0] : undefined;
38
+ const inputId = action.saved_id ? String(action.saved_id) : undefined;
39
+ const resalePrice = action.resale_amount ? Number(action.resale_amount) : undefined;
40
+ const transferrableAt = action.can_transfer_at;
41
+ const resellableAt = action.can_resell_at;
42
+ if ((action.from_id && !from) || (action.peer && !to)) {
43
+ (0, _0_deps_js_1.unreachable)();
44
+ }
45
+ return (0, _1_utilities_js_1.cleanObject)({
46
+ isUpgraded,
47
+ isTransferred,
48
+ isSaved,
49
+ isRefunded,
50
+ isPrepaidUpgrade,
51
+ gift,
52
+ exportableAt,
53
+ transferPrice,
54
+ from,
55
+ to,
56
+ inputId,
57
+ resalePrice,
58
+ transferrableAt,
59
+ resellableAt,
60
+ });
61
+ }
@@ -48,6 +48,8 @@ import { type Game } from "./3_game.js";
48
48
  import { type ReplyQuote } from "./3_reply_quote.js";
49
49
  import { type Checklist } from "./4_checklist.js";
50
50
  import { type Poll } from "./4_poll.js";
51
+ import { type GiftNonUpgradedInformation } from "./5_gift_non_upgraded_information.js";
52
+ import { type GiftUpgradedInformation } from "./5_gift_upgraded_information.js";
51
53
  import { type LinkPreview } from "./5_link_preview.js";
52
54
  /**
53
55
  * Properties shared between all message types.
@@ -586,6 +588,22 @@ export interface MessageChecklistExtended extends _MessageBase {
586
588
  /** @discriminator */
587
589
  checklistExtended: ChecklistItem[];
588
590
  }
591
+ /**
592
+ * An action related to a non-upgraded gift.
593
+ * @unlisted
594
+ */
595
+ export interface MessageGiftNonUpgraded extends _MessageBase {
596
+ /** @discriminator */
597
+ giftNonUpgraded: GiftNonUpgradedInformation;
598
+ }
599
+ /**
600
+ * An action related an upgraded gift.
601
+ * @unlisted
602
+ */
603
+ export interface MessageGiftUpgraded extends _MessageBase {
604
+ /** @discriminator */
605
+ giftUpgraded: GiftUpgradedInformation;
606
+ }
589
607
  /** @unlisted */
590
608
  export interface MessageTypes {
591
609
  text: MessageText;
@@ -633,11 +651,13 @@ export interface MessageTypes {
633
651
  refundedPayment: MessageRefundedPayment;
634
652
  checklistChanged: MessageChecklistChanged;
635
653
  checklistExtended: MessageChecklistExtended;
654
+ giftNonUpgraded: MessageGiftNonUpgraded;
655
+ giftUpgraded: MessageGiftUpgraded;
636
656
  }
637
657
  export declare function isMessageType<T extends keyof MessageTypes>(message: Message, type: T): message is MessageTypes[T];
638
658
  export declare function assertMessageType<T extends keyof MessageTypes>(message: Message, type: T): MessageTypes[T];
639
659
  /** Any type of message. */
640
- export type Message = MessageText | MessageLink | MessagePhoto | MessageDocument | MessageVideo | MessageSticker | MessageAnimation | MessageVoice | MessageAudio | MessageDice | MessageVideoNote | MessageContact | MessageGame | MessagePoll | MessageChecklist | MessageInvoice | MessageVenue | MessageLocation | MessageNewChatMembers | MessageLeftChatMember | MessageNewChatTitle | MessageNewChatPhoto | MessageDeletedChatPhoto | MessageGroupCreated | MessageSupergroupCreated | MessageChannelCreated | MessageAutoDeleteTimerChanged | MessageChatMigratedTo | MessageChatMigratedFrom | MessagePinnedMessage | MessageUserShared | MessageWriteAccessAllowed | MessageForumTopicCreated | MessageForumTopicEdited | MessageForumTopicClosed | MessageForumTopicReopened | MessageVideoChatScheduled | MessageVideoChatStarted | MessageVideoChatEnded | MessageGiveaway | MessageUnsupported | MessageSuccessfulPayment | MessageRefundedPayment | MessageChecklistChanged | MessageChecklistExtended;
660
+ export type Message = MessageText | MessageLink | MessagePhoto | MessageDocument | MessageVideo | MessageSticker | MessageAnimation | MessageVoice | MessageAudio | MessageDice | MessageVideoNote | MessageContact | MessageGame | MessagePoll | MessageChecklist | MessageInvoice | MessageVenue | MessageLocation | MessageNewChatMembers | MessageLeftChatMember | MessageNewChatTitle | MessageNewChatPhoto | MessageDeletedChatPhoto | MessageGroupCreated | MessageSupergroupCreated | MessageChannelCreated | MessageAutoDeleteTimerChanged | MessageChatMigratedTo | MessageChatMigratedFrom | MessagePinnedMessage | MessageUserShared | MessageWriteAccessAllowed | MessageForumTopicCreated | MessageForumTopicEdited | MessageForumTopicClosed | MessageForumTopicReopened | MessageVideoChatScheduled | MessageVideoChatStarted | MessageVideoChatEnded | MessageGiveaway | MessageUnsupported | MessageSuccessfulPayment | MessageRefundedPayment | MessageChecklistChanged | MessageChecklistExtended | MessageGiftNonUpgraded | MessageGiftUpgraded;
641
661
  /** @unlisted */
642
662
  export interface MessageGetter {
643
663
  (chatId: number, messageId: number): MaybePromise<Message | null>;