@mtkruto/node 0.0.997 → 0.0.998

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 (175) hide show
  1. package/esm/0_deps.d.ts +2 -2
  2. package/esm/0_deps.js +2 -2
  3. package/esm/4_constants.d.ts +1 -1
  4. package/esm/4_constants.js +1 -1
  5. package/esm/client/0_html.js +1 -1
  6. package/esm/client/3_types.d.ts +2 -1
  7. package/esm/client/3_types.js +1 -1
  8. package/esm/client/4_client.d.ts +2 -3
  9. package/esm/client/4_client.js +19 -19
  10. package/esm/deps/deno.land/std@0.201.0/assert/assert_greater.d.ts +5 -0
  11. package/esm/deps/deno.land/std@0.201.0/assert/assert_greater.js +14 -0
  12. package/esm/deps/deno.land/std@0.201.0/assert/assert_greater_or_equal.d.ts +5 -0
  13. package/esm/deps/deno.land/std@0.201.0/assert/assert_greater_or_equal.js +14 -0
  14. package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_instance_of.js +2 -2
  15. package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_is_error.js +4 -1
  16. package/esm/deps/deno.land/std@0.201.0/assert/assert_less.d.ts +5 -0
  17. package/esm/deps/deno.land/std@0.201.0/assert/assert_less.js +14 -0
  18. package/esm/deps/deno.land/std@0.201.0/assert/assert_less_or_equal.d.ts +5 -0
  19. package/esm/deps/deno.land/std@0.201.0/assert/assert_less_or_equal.js +14 -0
  20. package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/mod.d.ts +4 -0
  21. package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/mod.js +4 -0
  22. package/{script/deps/deno.land/std@0.200.0 → esm/deps/deno.land/std@0.201.0}/fmt/colors.d.ts +8 -1
  23. package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/fmt/colors.js +8 -1
  24. package/esm/tl/3_tl_reader.d.ts +1 -1
  25. package/esm/tl/3_tl_reader.js +6 -0
  26. package/esm/tl/4_tl_writer.js +8 -0
  27. package/esm/tl/6_message.js +3 -0
  28. package/esm/types/0_chat_action.d.ts +1 -1
  29. package/esm/types/0_message_entity.d.ts +10 -10
  30. package/esm/types/0_message_entity.js +12 -12
  31. package/esm/types/1_chat.d.ts +5 -10
  32. package/esm/types/1_chat.js +4 -11
  33. package/esm/types/1_sticker.d.ts +2 -2
  34. package/esm/types/1_sticker.js +1 -1
  35. package/esm/types/3_message.js +3 -3
  36. package/package.json +1 -1
  37. package/script/0_deps.d.ts +2 -2
  38. package/script/0_deps.js +2 -2
  39. package/script/4_constants.d.ts +1 -1
  40. package/script/4_constants.js +1 -1
  41. package/script/client/0_html.js +1 -1
  42. package/script/client/3_types.d.ts +2 -1
  43. package/script/client/3_types.js +3 -0
  44. package/script/client/4_client.d.ts +2 -3
  45. package/script/client/4_client.js +19 -19
  46. package/script/deps/deno.land/std@0.201.0/assert/assert_greater.d.ts +5 -0
  47. package/script/deps/deno.land/std@0.201.0/assert/assert_greater.js +18 -0
  48. package/script/deps/deno.land/std@0.201.0/assert/assert_greater_or_equal.d.ts +5 -0
  49. package/script/deps/deno.land/std@0.201.0/assert/assert_greater_or_equal.js +18 -0
  50. package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_instance_of.js +2 -2
  51. package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_is_error.js +4 -1
  52. package/script/deps/deno.land/std@0.201.0/assert/assert_less.d.ts +5 -0
  53. package/script/deps/deno.land/std@0.201.0/assert/assert_less.js +18 -0
  54. package/script/deps/deno.land/std@0.201.0/assert/assert_less_or_equal.d.ts +5 -0
  55. package/script/deps/deno.land/std@0.201.0/assert/assert_less_or_equal.js +18 -0
  56. package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/mod.d.ts +4 -0
  57. package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/mod.js +4 -0
  58. package/{esm/deps/deno.land/std@0.200.0 → script/deps/deno.land/std@0.201.0}/fmt/colors.d.ts +8 -1
  59. package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/fmt/colors.js +10 -3
  60. package/script/tl/3_tl_reader.d.ts +1 -1
  61. package/script/tl/3_tl_reader.js +6 -0
  62. package/script/tl/4_tl_writer.js +8 -0
  63. package/script/tl/6_message.js +3 -0
  64. package/script/types/0_chat_action.d.ts +1 -1
  65. package/script/types/0_message_entity.d.ts +10 -10
  66. package/script/types/0_message_entity.js +12 -12
  67. package/script/types/1_chat.d.ts +5 -10
  68. package/script/types/1_chat.js +5 -12
  69. package/script/types/1_sticker.d.ts +2 -2
  70. package/script/types/1_sticker.js +1 -1
  71. package/script/types/3_message.js +2 -2
  72. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/_constants.d.ts +0 -0
  73. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/_constants.js +0 -0
  74. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/_diff.d.ts +0 -0
  75. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/_diff.js +0 -0
  76. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/_format.d.ts +0 -0
  77. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/_format.js +0 -0
  78. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert.d.ts +0 -0
  79. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert.js +0 -0
  80. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_almost_equals.d.ts +0 -0
  81. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_almost_equals.js +0 -0
  82. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_array_includes.d.ts +0 -0
  83. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_array_includes.js +0 -0
  84. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_equals.d.ts +0 -0
  85. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_equals.js +0 -0
  86. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_exists.d.ts +0 -0
  87. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_exists.js +0 -0
  88. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_false.d.ts +0 -0
  89. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_false.js +0 -0
  90. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_instance_of.d.ts +0 -0
  91. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_is_error.d.ts +0 -0
  92. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_match.d.ts +0 -0
  93. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_match.js +0 -0
  94. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_not_equals.d.ts +0 -0
  95. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_not_equals.js +0 -0
  96. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_not_instance_of.d.ts +0 -0
  97. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_not_instance_of.js +0 -0
  98. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_not_match.d.ts +0 -0
  99. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_not_match.js +0 -0
  100. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_not_strict_equals.d.ts +0 -0
  101. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_not_strict_equals.js +0 -0
  102. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_object_match.d.ts +0 -0
  103. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_object_match.js +0 -0
  104. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_rejects.d.ts +0 -0
  105. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_rejects.js +0 -0
  106. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_strict_equals.d.ts +0 -0
  107. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_strict_equals.js +0 -0
  108. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_string_includes.d.ts +0 -0
  109. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_string_includes.js +0 -0
  110. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_throws.d.ts +0 -0
  111. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_throws.js +0 -0
  112. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assertion_error.d.ts +0 -0
  113. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assertion_error.js +0 -0
  114. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/equal.d.ts +0 -0
  115. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/equal.js +0 -0
  116. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/fail.d.ts +0 -0
  117. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/fail.js +0 -0
  118. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/unimplemented.d.ts +0 -0
  119. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/unimplemented.js +0 -0
  120. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/unreachable.d.ts +0 -0
  121. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/unreachable.js +0 -0
  122. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/encoding/base64.d.ts +0 -0
  123. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/encoding/base64.js +0 -0
  124. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/_constants.d.ts +0 -0
  125. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/_constants.js +0 -0
  126. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/_diff.d.ts +0 -0
  127. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/_diff.js +0 -0
  128. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/_format.d.ts +0 -0
  129. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/_format.js +0 -0
  130. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert.d.ts +0 -0
  131. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert.js +0 -0
  132. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_almost_equals.d.ts +0 -0
  133. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_almost_equals.js +0 -0
  134. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_array_includes.d.ts +0 -0
  135. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_array_includes.js +0 -0
  136. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_equals.d.ts +0 -0
  137. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_equals.js +0 -0
  138. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_exists.d.ts +0 -0
  139. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_exists.js +0 -0
  140. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_false.d.ts +0 -0
  141. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_false.js +0 -0
  142. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_instance_of.d.ts +0 -0
  143. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_is_error.d.ts +0 -0
  144. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_match.d.ts +0 -0
  145. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_match.js +0 -0
  146. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_not_equals.d.ts +0 -0
  147. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_not_equals.js +0 -0
  148. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_not_instance_of.d.ts +0 -0
  149. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_not_instance_of.js +0 -0
  150. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_not_match.d.ts +0 -0
  151. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_not_match.js +0 -0
  152. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_not_strict_equals.d.ts +0 -0
  153. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_not_strict_equals.js +0 -0
  154. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_object_match.d.ts +0 -0
  155. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_object_match.js +0 -0
  156. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_rejects.d.ts +0 -0
  157. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_rejects.js +0 -0
  158. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_strict_equals.d.ts +0 -0
  159. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_strict_equals.js +0 -0
  160. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_string_includes.d.ts +0 -0
  161. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_string_includes.js +0 -0
  162. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_throws.d.ts +0 -0
  163. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_throws.js +0 -0
  164. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assertion_error.d.ts +0 -0
  165. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assertion_error.js +0 -0
  166. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/equal.d.ts +0 -0
  167. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/equal.js +0 -0
  168. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/fail.d.ts +0 -0
  169. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/fail.js +0 -0
  170. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/unimplemented.d.ts +0 -0
  171. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/unimplemented.js +0 -0
  172. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/unreachable.d.ts +0 -0
  173. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/unreachable.js +0 -0
  174. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/encoding/base64.d.ts +0 -0
  175. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/encoding/base64.js +0 -0
@@ -3,18 +3,11 @@ import { types } from "../2_tl.js";
3
3
  import { ZERO_CHANNEL_ID } from "../4_constants.js";
4
4
  import { getColor } from "./0_color.js";
5
5
  import { constructChatPhoto } from "./0_chat_photo.js";
6
- export var ChatType;
7
- (function (ChatType) {
8
- ChatType["Private"] = "private";
9
- ChatType["Group"] = "group";
10
- ChatType["Supergroup"] = "supergroup";
11
- ChatType["Channel"] = "channel";
12
- })(ChatType || (ChatType = {}));
13
6
  export function constructChat(chat) {
14
7
  if (chat instanceof types.User) {
15
8
  const id = Number(chat.id);
16
9
  const chat_ = {
17
- type: ChatType.Private,
10
+ type: "private",
18
11
  isBot: chat.bot || false,
19
12
  id,
20
13
  color: getColor(id),
@@ -37,7 +30,7 @@ export function constructChat(chat) {
37
30
  else if (chat instanceof types.Chat) {
38
31
  const id = Number(-chat.id);
39
32
  const chat_ = {
40
- type: ChatType.Group,
33
+ type: "group",
41
34
  id,
42
35
  color: getColor(id),
43
36
  title: chat.title,
@@ -56,7 +49,7 @@ export function constructChat(chat) {
56
49
  chat_ = {
57
50
  id,
58
51
  color: getColor(id),
59
- type: ChatType.Supergroup,
52
+ type: "supergroup",
60
53
  title,
61
54
  isScam,
62
55
  isFake,
@@ -70,7 +63,7 @@ export function constructChat(chat) {
70
63
  chat_ = {
71
64
  id,
72
65
  color: getColor(id),
73
- type: ChatType.Channel,
66
+ type: "channel",
74
67
  title,
75
68
  isScam,
76
69
  isFake,
@@ -8,8 +8,8 @@ export interface Sticker {
8
8
  fileId: string;
9
9
  /** Unique identifier for this file, which is supposed to be the same over time and for different users and bots. Can't be used to download or reuse the file. */
10
10
  fileUniqueId: string;
11
- /** Type of the sticker, currently one of "regular", "mask", "custom_emoji". The type of the sticker is independent from its format, which is determined by the fields is_animated and is_video. */
12
- type: "regular" | "mask" | "custom_emoji";
11
+ /** Type of the sticker, currently one of "regular", "mask", "customEmoji". The type of the sticker is independent from its format, which is determined by the fields is_animated and is_video. */
12
+ type: "regular" | "mask" | "customEmoji";
13
13
  /** Sticker width */
14
14
  width: number;
15
15
  /** Sticker height */
@@ -9,7 +9,7 @@ export async function constructSticker(document, fileId, fileUniqueId, getSticke
9
9
  return {
10
10
  fileId,
11
11
  fileUniqueId,
12
- // TODO: custom_emoji type?
12
+ // TODO: custom emoji type?
13
13
  type: stickerAttribute.mask ? "mask" : "regular",
14
14
  width: imageSizeAttribute ? imageSizeAttribute.w : videoAttribute ? videoAttribute.w : 512,
15
15
  height: imageSizeAttribute ? imageSizeAttribute.h : videoAttribute ? videoAttribute.h : 512,
@@ -12,7 +12,7 @@ import { constructVenue } from "./0_venue.js";
12
12
  import { constructLocation } from "./0_location.js";
13
13
  import { constructDice } from "./0_dice.js";
14
14
  import { constructReplyKeyboardRemove } from "./0_reply_keyboard_remove.js";
15
- import { ChatType, constructChat } from "./1_chat.js";
15
+ import { constructChat } from "./1_chat.js";
16
16
  import { constructPhoto } from "./1_photo.js";
17
17
  import { constructDocument } from "./1_document.js";
18
18
  import { constructVideo } from "./1_video.js";
@@ -117,10 +117,10 @@ async function constructServiceMessage(message_, chat, getEntity, getMessage) {
117
117
  }
118
118
  }
119
119
  else if (message_.action instanceof types.MessageActionChannelCreate) {
120
- if (message.chat.type == ChatType.Channel) {
120
+ if (message.chat.type == "channel") {
121
121
  message.channelCreated = true;
122
122
  }
123
- else if (message.chat.type == ChatType.Supergroup) {
123
+ else if (message.chat.type == "supergroup") {
124
124
  message.supergroupCreated = true;
125
125
  }
126
126
  else {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "module": "./esm/mod.js",
3
3
  "main": "./script/mod.js",
4
4
  "name": "@mtkruto/node",
5
- "version": "0.0.997",
5
+ "version": "0.0.998",
6
6
  "description": "MTKruto for Node.js",
7
7
  "author": "Roj <rojvv@icloud.com>",
8
8
  "license": "LGPL-3.0-or-later",
@@ -1,8 +1,8 @@
1
- export * from "./deps/deno.land/std@0.200.0/assert/mod.js";
1
+ export * from "./deps/deno.land/std@0.201.0/assert/mod.js";
2
2
  export { ctr256Decrypt, ctr256Encrypt, factorize, ige256Decrypt, ige256Encrypt, init as initTgCrypto } from "./deps/deno.land/x/tgcrypto@0.1.3/mod.js";
3
3
  export { gunzip, gzip } from "./deps/raw.githubusercontent.com/MTKruto/compress/main/gzip/gzip.js";
4
4
  export { Mutex, type MutexInterface } from "async-mutex";
5
5
  export { Parser } from "./deps/deno.land/x/html_parser@v0.1.3/src/mod.js";
6
6
  import { debug as debug_ } from "./deps/raw.githubusercontent.com/MTKruto/debug/main/mod.js";
7
7
  export declare const debug: typeof debug_;
8
- export { decode as base64Decode, encode as base64Encode } from "./deps/deno.land/std@0.200.0/encoding/base64.js";
8
+ export { decode as base64Decode, encode as base64Encode } from "./deps/deno.land/std@0.201.0/encoding/base64.js";
package/script/0_deps.js CHANGED
@@ -15,7 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.base64Encode = exports.base64Decode = exports.debug = exports.Parser = exports.Mutex = exports.gzip = exports.gunzip = exports.initTgCrypto = exports.ige256Encrypt = exports.ige256Decrypt = exports.factorize = exports.ctr256Encrypt = exports.ctr256Decrypt = void 0;
18
- __exportStar(require("./deps/deno.land/std@0.200.0/assert/mod.js"), exports);
18
+ __exportStar(require("./deps/deno.land/std@0.201.0/assert/mod.js"), exports);
19
19
  var mod_js_1 = require("./deps/deno.land/x/tgcrypto@0.1.3/mod.js");
20
20
  Object.defineProperty(exports, "ctr256Decrypt", { enumerable: true, get: function () { return mod_js_1.ctr256Decrypt; } });
21
21
  Object.defineProperty(exports, "ctr256Encrypt", { enumerable: true, get: function () { return mod_js_1.ctr256Encrypt; } });
@@ -33,6 +33,6 @@ Object.defineProperty(exports, "Parser", { enumerable: true, get: function () {
33
33
  const mod_js_3 = require("./deps/raw.githubusercontent.com/MTKruto/debug/main/mod.js");
34
34
  const debug = (v) => (0, mod_js_3.debug)(v);
35
35
  exports.debug = debug;
36
- var base64_js_1 = require("./deps/deno.land/std@0.200.0/encoding/base64.js");
36
+ var base64_js_1 = require("./deps/deno.land/std@0.201.0/encoding/base64.js");
37
37
  Object.defineProperty(exports, "base64Decode", { enumerable: true, get: function () { return base64_js_1.decode; } });
38
38
  Object.defineProperty(exports, "base64Encode", { enumerable: true, get: function () { return base64_js_1.encode; } });
@@ -5,7 +5,7 @@ export declare const PUBLIC_KEYS: PublicKeys;
5
5
  export declare const VECTOR_CONSTRUCTOR = 481674261;
6
6
  export declare const INITIAL_DC: DC;
7
7
  export declare const LAYER = 161;
8
- export declare const APP_VERSION = "MTKruto 0.0.997";
8
+ export declare const APP_VERSION = "MTKruto 0.0.998";
9
9
  export declare const DEVICE_MODEL: string;
10
10
  export declare const LANG_CODE: string;
11
11
  export declare const LANG_PACK = "";
@@ -80,7 +80,7 @@ exports.PUBLIC_KEYS = Object.freeze([
80
80
  exports.VECTOR_CONSTRUCTOR = 0x1CB5C415;
81
81
  exports.INITIAL_DC = "2-test";
82
82
  exports.LAYER = 161;
83
- exports.APP_VERSION = "MTKruto 0.0.997";
83
+ exports.APP_VERSION = "MTKruto 0.0.998";
84
84
  // @ts-ignore: lib
85
85
  exports.DEVICE_MODEL = typeof dntShim.Deno === "undefined" ? typeof navigator === "undefined" ? typeof process === "undefined" ? "Unknown" : process.platform + "-" + process.arch : navigator.userAgent.split(" ")[0] : dntShim.Deno.build.os + "-" + dntShim.Deno.build.arch;
86
86
  exports.LANG_CODE = typeof navigator === "undefined" ? "en" : navigator.language.split("-")[0];
@@ -30,7 +30,7 @@ function parseHtml(html) {
30
30
  if (!url) {
31
31
  throw new Error("Missing attribute href");
32
32
  }
33
- queue.push({ type: "text_link", offset: text.length, length: 0, url });
33
+ queue.push({ type: "textLink", offset: text.length, length: 0, url });
34
34
  break;
35
35
  }
36
36
  case "ins":
@@ -2,7 +2,7 @@ import { MaybePromise } from "../1_utilities.js";
2
2
  import { CallbackQuery, ForceReply, InlineKeyboardMarkup, InlineQuery, Message, MessageEntity, ReplyKeyboardMarkup, ReplyKeyboardRemove } from "../3_types.js";
3
3
  import { With } from "./0_utilities.js";
4
4
  import { ClientPlainParams } from "./2_client_plain.js";
5
- export type ParseMode = "html" | "none";
5
+ export type ParseMode = "HTML" | null;
6
6
  export interface ClientParams extends ClientPlainParams {
7
7
  /**
8
8
  * A parse mode to use when the `parseMode` parameter is not specified when sending or editing messages. Defauls to `ParseMode.None`.
@@ -217,3 +217,4 @@ export interface Handler<U extends Partial<Update> = Partial<Update>> {
217
217
  export type FilterUpdate<U extends Update, T extends keyof U, F extends keyof NonNullable<U[T]>> = With<U, T> & Pick<{
218
218
  [P in T]-?: With<NonNullable<U[T]>, F>;
219
219
  }, T>;
220
+ export declare const skip: Handler;
@@ -1,2 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.skip = void 0;
4
+ const skip = (__, _) => _();
5
+ exports.skip = skip;
@@ -36,7 +36,6 @@ export declare class Client extends ClientAbstract {
36
36
  * @param storage The storage provider to use. Defaults to memory storage.
37
37
  * @param apiId App's API ID from [my.telegram.org](https://my.telegram.org/apps). Defaults to 0 (unset).
38
38
  * @param apiHash App's API hash from [my.telegram.org/apps](https://my.telegram.org/apps). Defaults to empty string (unset).
39
- * @param params Other parameters.
40
39
  */
41
40
  constructor(storage?: Storage, apiId?: number | null, apiHash?: string | null, params?: ClientParams);
42
41
  private propagateConnectionState;
@@ -214,7 +213,7 @@ export declare class Client extends ClientAbstract {
214
213
  private handle;
215
214
  use(handler: Handler): void;
216
215
  branch(predicate: (upd: Update) => MaybePromise<boolean>, trueHandler: Handler, falseHandler: Handler): void;
217
- filter<D extends Update>(predicate: (ctx: Update) => ctx is D, handler: Handler<D>): void;
218
- filter(predicate: (ctx: Update) => MaybePromise<boolean>, handler: Handler): void;
216
+ filter<D extends Update>(predicate: (update: Update) => update is D, handler: Handler<D>): void;
217
+ filter(predicate: (update: Update) => MaybePromise<boolean>, handler: Handler): void;
219
218
  on<T extends keyof Update, F extends keyof NonNullable<Update[T]>>(filter: T extends FilterableUpdates ? T | [T, F, ...F[]] : T, handler: Handler<FilterUpdate<Update, T, F>>): void;
220
219
  }
@@ -13,6 +13,7 @@ const _0_password_js_1 = require("./0_password.js");
13
13
  const _0_html_js_1 = require("./0_html.js");
14
14
  const _2_client_plain_js_1 = require("./2_client_plain.js");
15
15
  const _1_client_abstract_js_1 = require("./1_client_abstract.js");
16
+ const _3_types_js_2 = require("./3_types.js");
16
17
  const d = (0, _0_deps_js_1.debug)("Client");
17
18
  const dGap = (0, _0_deps_js_1.debug)("Client/recoverUpdateGap");
18
19
  const dGapC = (0, _0_deps_js_1.debug)("Client/recoverChannelUpdateGap");
@@ -30,7 +31,6 @@ class Client extends _1_client_abstract_js_1.ClientAbstract {
30
31
  * @param storage The storage provider to use. Defaults to memory storage.
31
32
  * @param apiId App's API ID from [my.telegram.org](https://my.telegram.org/apps). Defaults to 0 (unset).
32
33
  * @param apiHash App's API hash from [my.telegram.org/apps](https://my.telegram.org/apps). Defaults to empty string (unset).
33
- * @param params Other parameters.
34
34
  */
35
35
  constructor(storage = new _3_storage_js_1.StorageMemory(), apiId = 0, apiHash = "", params) {
36
36
  super(params);
@@ -219,11 +219,9 @@ class Client extends _1_client_abstract_js_1.ClientAbstract {
219
219
  enumerable: true,
220
220
  configurable: true,
221
221
  writable: true,
222
- value: (_, n) => {
223
- return n();
224
- }
222
+ value: _3_types_js_2.skip
225
223
  });
226
- this.parseMode = params?.parseMode ?? "none";
224
+ this.parseMode = params?.parseMode ?? null;
227
225
  this.appVersion = params?.appVersion ?? _4_constants_js_1.APP_VERSION;
228
226
  this.deviceModel = params?.deviceModel ?? _4_constants_js_1.DEVICE_MODEL;
229
227
  this.langCode = params?.langCode ?? _4_constants_js_1.LANG_CODE;
@@ -1224,9 +1222,9 @@ class Client extends _1_client_abstract_js_1.ClientAbstract {
1224
1222
  const entities_ = params?.entities ?? [];
1225
1223
  const parseMode = params?.parseMode ?? this.parseMode;
1226
1224
  switch (parseMode) {
1227
- case "none":
1225
+ case null:
1228
1226
  break;
1229
- case "html": {
1227
+ case "HTML": {
1230
1228
  const [newText, entitiesToPush] = (0, _0_html_js_1.parseHtml)(text);
1231
1229
  text = newText;
1232
1230
  for (const entity of entitiesToPush) {
@@ -1601,39 +1599,41 @@ class Client extends _1_client_abstract_js_1.ClientAbstract {
1601
1599
  async sendChatAction(chatId, action_, messageThreadId) {
1602
1600
  let action;
1603
1601
  switch (action_) {
1604
- case "typing":
1602
+ case "type":
1605
1603
  action = new _2_tl_js_1.types.SendMessageTypingAction();
1606
1604
  break;
1607
- case "upload_photo":
1605
+ case "uploadPhoto":
1608
1606
  action = new _2_tl_js_1.types.SendMessageUploadPhotoAction({ progress: 0 });
1609
1607
  break;
1610
- case "record_video":
1608
+ case "recordVideo":
1611
1609
  action = new _2_tl_js_1.types.SendMessageRecordVideoAction();
1612
1610
  break;
1613
- case "upload_video":
1611
+ case "uploadVideo":
1614
1612
  action = new _2_tl_js_1.types.SendMessageRecordVideoAction();
1615
1613
  break;
1616
- case "record_voice":
1614
+ case "recordVoice":
1617
1615
  action = new _2_tl_js_1.types.SendMessageRecordAudioAction();
1618
1616
  break;
1619
- case "upload_audio":
1617
+ case "uploadAudio":
1620
1618
  action = new _2_tl_js_1.types.SendMessageUploadAudioAction({ progress: 0 });
1621
1619
  break;
1622
- case "upload_document":
1620
+ case "uploadDocument":
1623
1621
  action = new _2_tl_js_1.types.SendMessageUploadDocumentAction({ progress: 0 });
1624
1622
  break;
1625
- case "choose_sticker":
1623
+ case "chooseSticker":
1626
1624
  action = new _2_tl_js_1.types.SendMessageChooseStickerAction();
1627
1625
  break;
1628
- case "find_location":
1626
+ case "findLocation":
1629
1627
  action = new _2_tl_js_1.types.SendMessageGeoLocationAction();
1630
1628
  break;
1631
- case "record_video_note":
1629
+ case "recordVideoNote":
1632
1630
  action = new _2_tl_js_1.types.SendMessageRecordRoundAction();
1633
1631
  break;
1634
- case "upload_video_note":
1632
+ case "uploadVideoNote":
1635
1633
  action = new _2_tl_js_1.types.SendMessageUploadRoundAction({ progress: 0 });
1636
1634
  break;
1635
+ default:
1636
+ throw new Error("Invalid chat action: " + action_);
1637
1637
  }
1638
1638
  await this.invoke(new _2_tl_js_1.functions.MessagesSetTyping({ peer: await this.getInputPeer(chatId), action, topMsgId: messageThreadId }));
1639
1639
  }
@@ -1660,7 +1660,7 @@ class Client extends _1_client_abstract_js_1.ClientAbstract {
1660
1660
  });
1661
1661
  }
1662
1662
  filter(predicate, handler) {
1663
- this.branch(predicate, handler, (_, n) => n());
1663
+ this.branch(predicate, handler, _3_types_js_2.skip);
1664
1664
  }
1665
1665
  on(filter, handler) {
1666
1666
  const type = typeof filter === "string" ? filter : filter[0];
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Make an assertion that `actual` is greater than `expected`.
3
+ * If not then throw.
4
+ */
5
+ export declare function assertGreater<T>(actual: T, expected: T, msg?: string): void;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.assertGreater = void 0;
4
+ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
5
+ const _format_js_1 = require("./_format.js");
6
+ const assertion_error_js_1 = require("./assertion_error.js");
7
+ /**
8
+ * Make an assertion that `actual` is greater than `expected`.
9
+ * If not then throw.
10
+ */
11
+ function assertGreater(actual, expected, msg) {
12
+ if (actual > expected)
13
+ return;
14
+ const actualString = (0, _format_js_1.format)(actual);
15
+ const expectedString = (0, _format_js_1.format)(expected);
16
+ throw new assertion_error_js_1.AssertionError(msg ?? `Expect ${actualString} > ${expectedString}`);
17
+ }
18
+ exports.assertGreater = assertGreater;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Make an assertion that `actual` is greater than or equal to `expected`.
3
+ * If not then throw.
4
+ */
5
+ export declare function assertGreaterOrEqual<T>(actual: T, expected: T, msg?: string): void;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.assertGreaterOrEqual = void 0;
4
+ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
5
+ const _format_js_1 = require("./_format.js");
6
+ const assertion_error_js_1 = require("./assertion_error.js");
7
+ /**
8
+ * Make an assertion that `actual` is greater than or equal to `expected`.
9
+ * If not then throw.
10
+ */
11
+ function assertGreaterOrEqual(actual, expected, msg) {
12
+ if (actual >= expected)
13
+ return;
14
+ const actualString = (0, _format_js_1.format)(actual);
15
+ const expectedString = (0, _format_js_1.format)(expected);
16
+ throw new assertion_error_js_1.AssertionError(msg ?? `Expect ${actualString} >= ${expectedString}`);
17
+ }
18
+ exports.assertGreaterOrEqual = assertGreaterOrEqual;
@@ -25,11 +25,11 @@ function assertInstanceOf(actual, expectedType, msg = "") {
25
25
  else {
26
26
  actualTypeStr = typeof actual;
27
27
  }
28
- if (expectedTypeStr == actualTypeStr) {
28
+ if (expectedTypeStr === actualTypeStr) {
29
29
  msg =
30
30
  `Expected object to be an instance of "${expectedTypeStr}"${msgSuffix}`;
31
31
  }
32
- else if (actualTypeStr == "function") {
32
+ else if (actualTypeStr === "function") {
33
33
  msg =
34
34
  `Expected object to be an instance of "${expectedTypeStr}" but was not an instanced object${msgSuffix}`;
35
35
  }
@@ -23,7 +23,10 @@ ErrorClass, msgIncludes, msg) {
23
23
  }
24
24
  if (msgIncludes && (!(error instanceof Error) ||
25
25
  !(0, colors_js_1.stripColor)(error.message).includes((0, colors_js_1.stripColor)(msgIncludes)))) {
26
- msg = `Expected error message to include "${msgIncludes}", but got "${error instanceof Error ? error.message : "[not an Error]"}"${msgSuffix}`;
26
+ msg = `Expected error message to include ${JSON.stringify(msgIncludes)}, but got ${error instanceof Error
27
+ ? JSON.stringify(error.message)
28
+ : '"[not an Error]"' // TODO(kt3k): show more useful information
29
+ }${msgSuffix}`;
27
30
  throw new assertion_error_js_1.AssertionError(msg);
28
31
  }
29
32
  }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Make an assertion that `actual` is less than `expected`.
3
+ * If not then throw.
4
+ */
5
+ export declare function assertLess<T>(actual: T, expected: T, msg?: string): void;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.assertLess = void 0;
4
+ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
5
+ const _format_js_1 = require("./_format.js");
6
+ const assertion_error_js_1 = require("./assertion_error.js");
7
+ /**
8
+ * Make an assertion that `actual` is less than `expected`.
9
+ * If not then throw.
10
+ */
11
+ function assertLess(actual, expected, msg) {
12
+ if (actual < expected)
13
+ return;
14
+ const actualString = (0, _format_js_1.format)(actual);
15
+ const expectedString = (0, _format_js_1.format)(expected);
16
+ throw new assertion_error_js_1.AssertionError(msg ?? `Expect ${actualString} < ${expectedString}`);
17
+ }
18
+ exports.assertLess = assertLess;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Make an assertion that `actual` is less than or equal to `expected`.
3
+ * If not then throw.
4
+ */
5
+ export declare function assertLessOrEqual<T>(actual: T, expected: T, msg?: string): void;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.assertLessOrEqual = void 0;
4
+ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
5
+ const _format_js_1 = require("./_format.js");
6
+ const assertion_error_js_1 = require("./assertion_error.js");
7
+ /**
8
+ * Make an assertion that `actual` is less than or equal to `expected`.
9
+ * If not then throw.
10
+ */
11
+ function assertLessOrEqual(actual, expected, msg) {
12
+ if (actual <= expected)
13
+ return;
14
+ const actualString = (0, _format_js_1.format)(actual);
15
+ const expectedString = (0, _format_js_1.format)(expected);
16
+ throw new assertion_error_js_1.AssertionError(msg ?? `Expect ${actualString} <= ${expectedString}`);
17
+ }
18
+ exports.assertLessOrEqual = assertLessOrEqual;
@@ -12,8 +12,12 @@ export * from "./assert_array_includes.js";
12
12
  export * from "./assert_equals.js";
13
13
  export * from "./assert_exists.js";
14
14
  export * from "./assert_false.js";
15
+ export * from "./assert_greater_or_equal.js";
16
+ export * from "./assert_greater.js";
15
17
  export * from "./assert_instance_of.js";
16
18
  export * from "./assert_is_error.js";
19
+ export * from "./assert_less_or_equal.js";
20
+ export * from "./assert_less.js";
17
21
  export * from "./assert_match.js";
18
22
  export * from "./assert_not_equals.js";
19
23
  export * from "./assert_not_instance_of.js";
@@ -29,8 +29,12 @@ __exportStar(require("./assert_array_includes.js"), exports);
29
29
  __exportStar(require("./assert_equals.js"), exports);
30
30
  __exportStar(require("./assert_exists.js"), exports);
31
31
  __exportStar(require("./assert_false.js"), exports);
32
+ __exportStar(require("./assert_greater_or_equal.js"), exports);
33
+ __exportStar(require("./assert_greater.js"), exports);
32
34
  __exportStar(require("./assert_instance_of.js"), exports);
33
35
  __exportStar(require("./assert_is_error.js"), exports);
36
+ __exportStar(require("./assert_less_or_equal.js"), exports);
37
+ __exportStar(require("./assert_less.js"), exports);
34
38
  __exportStar(require("./assert_match.js"), exports);
35
39
  __exportStar(require("./assert_not_equals.js"), exports);
36
40
  __exportStar(require("./assert_not_instance_of.js"), exports);
@@ -262,9 +262,16 @@ export declare function rgb24(str: string, color: number | Rgb): string;
262
262
  * @param color code
263
263
  */
264
264
  export declare function bgRgb24(str: string, color: number | Rgb): string;
265
+ /**
266
+ * @deprecated (will be removed in 1.0.0) Use `stripAnsiCode` instead.
267
+ *
268
+ * Remove ANSI escape codes from the string.
269
+ * @param string to remove ANSI escape codes from
270
+ */
271
+ export declare const stripColor: typeof stripAnsiCode;
265
272
  /**
266
273
  * Remove ANSI escape codes from the string.
267
274
  * @param string to remove ANSI escape codes from
268
275
  */
269
- export declare function stripColor(string: string): string;
276
+ export declare function stripAnsiCode(string: string): string;
270
277
  export {};
@@ -27,7 +27,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
27
27
  return result;
28
28
  };
29
29
  Object.defineProperty(exports, "__esModule", { value: true });
30
- exports.stripColor = exports.bgRgb24 = exports.rgb24 = exports.bgRgb8 = exports.rgb8 = exports.bgBrightWhite = exports.bgBrightCyan = exports.bgBrightMagenta = exports.bgBrightBlue = exports.bgBrightYellow = exports.bgBrightGreen = exports.bgBrightRed = exports.bgBrightBlack = exports.bgWhite = exports.bgCyan = exports.bgMagenta = exports.bgBlue = exports.bgYellow = exports.bgGreen = exports.bgRed = exports.bgBlack = exports.brightWhite = exports.brightCyan = exports.brightMagenta = exports.brightBlue = exports.brightYellow = exports.brightGreen = exports.brightRed = exports.brightBlack = exports.gray = exports.white = exports.cyan = exports.magenta = exports.blue = exports.yellow = exports.green = exports.red = exports.black = exports.strikethrough = exports.hidden = exports.inverse = exports.underline = exports.italic = exports.dim = exports.bold = exports.reset = exports.getColorEnabled = exports.setColorEnabled = void 0;
30
+ exports.stripAnsiCode = exports.stripColor = exports.bgRgb24 = exports.rgb24 = exports.bgRgb8 = exports.rgb8 = exports.bgBrightWhite = exports.bgBrightCyan = exports.bgBrightMagenta = exports.bgBrightBlue = exports.bgBrightYellow = exports.bgBrightGreen = exports.bgBrightRed = exports.bgBrightBlack = exports.bgWhite = exports.bgCyan = exports.bgMagenta = exports.bgBlue = exports.bgYellow = exports.bgGreen = exports.bgRed = exports.bgBlack = exports.brightWhite = exports.brightCyan = exports.brightMagenta = exports.brightBlue = exports.brightYellow = exports.brightGreen = exports.brightRed = exports.brightBlack = exports.gray = exports.white = exports.cyan = exports.magenta = exports.blue = exports.yellow = exports.green = exports.red = exports.black = exports.strikethrough = exports.hidden = exports.inverse = exports.underline = exports.italic = exports.dim = exports.bold = exports.reset = exports.getColorEnabled = exports.setColorEnabled = void 0;
31
31
  /**
32
32
  * String formatters and utilities for dealing with ANSI color codes.
33
33
  *
@@ -538,11 +538,18 @@ const ANSI_PATTERN = new RegExp([
538
538
  "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
539
539
  "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))",
540
540
  ].join("|"), "g");
541
+ /**
542
+ * @deprecated (will be removed in 1.0.0) Use `stripAnsiCode` instead.
543
+ *
544
+ * Remove ANSI escape codes from the string.
545
+ * @param string to remove ANSI escape codes from
546
+ */
547
+ exports.stripColor = stripAnsiCode;
541
548
  /**
542
549
  * Remove ANSI escape codes from the string.
543
550
  * @param string to remove ANSI escape codes from
544
551
  */
545
- function stripColor(string) {
552
+ function stripAnsiCode(string) {
546
553
  return string.replace(ANSI_PATTERN, "");
547
554
  }
548
- exports.stripColor = stripColor;
555
+ exports.stripAnsiCode = stripAnsiCode;
@@ -1,6 +1,6 @@
1
1
  import { TLRawReader } from "./0_tl_raw_reader.js";
2
2
  import { TLObject } from "./1_tl_object.js";
3
- export type ReadObject = TLObject | Array<ReadObject | TLObject>;
3
+ export type ReadObject = boolean | TLObject | Array<ReadObject | TLObject>;
4
4
  export declare class TLReader extends TLRawReader {
5
5
  readObject(id?: number): ReadObject;
6
6
  }
@@ -18,6 +18,12 @@ class TLReader extends _0_tl_raw_reader_js_1.TLRawReader {
18
18
  }
19
19
  return items;
20
20
  }
21
+ else if (id == 0x997275b5) {
22
+ return true;
23
+ }
24
+ else if (id == 0xbc799737) {
25
+ return false;
26
+ }
21
27
  const constructor = _2_types_js_1.map.get(id);
22
28
  if (constructor) {
23
29
  return (0, _3_deserialize_js_1.deserialize)(this, constructor[_1_tl_object_js_1.paramDesc], constructor);
@@ -13,6 +13,14 @@ class TLWriter extends _0_tl_raw_writer_js_1.TLRawWriter {
13
13
  this.writeObject(item);
14
14
  }
15
15
  }
16
+ else if (typeof object === "boolean") {
17
+ if (object) {
18
+ this.writeInt32(0x997275b5, false);
19
+ }
20
+ else {
21
+ this.writeInt32(0xbc799737, false);
22
+ }
23
+ }
16
24
  else {
17
25
  this.write(object[_1_tl_object_js_1.serialize]());
18
26
  }
@@ -15,6 +15,9 @@ function calculateLength(object) {
15
15
  length += calculateLength(item);
16
16
  }
17
17
  }
18
+ else if (typeof object === "boolean") {
19
+ length += 32 / 8; // constructor
20
+ }
18
21
  else {
19
22
  length += object[_1_tl_object_js_1.serialize]().length;
20
23
  }
@@ -1 +1 @@
1
- export type ChatAction = "typing" | "upload_photo" | "record_video" | "upload_video" | "record_voice" | "upload_audio" | "upload_document" | "choose_sticker" | "find_location" | "record_video_note" | "upload_video_note";
1
+ export type ChatAction = "type" | "uploadPhoto" | "recordVideo" | "uploadVideo" | "recordVoice" | "uploadAudio" | "uploadDocument" | "chooseSticker" | "findLocation" | "recordVideoNote" | "uploadVideoNote";