@mtkruto/node 0.0.998 → 0.1.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 (237) hide show
  1. package/esm/0_deps.d.ts +1 -1
  2. package/esm/0_deps.js +1 -1
  3. package/esm/3_errors.d.ts +1531 -0
  4. package/esm/3_errors.js +1531 -0
  5. package/esm/3_types.d.ts +39 -3
  6. package/esm/3_types.js +39 -3
  7. package/esm/4_constants.d.ts +1 -1
  8. package/esm/4_constants.js +1 -1
  9. package/esm/4_errors.d.ts +25 -0
  10. package/esm/4_errors.js +64 -0
  11. package/esm/client/2_client_plain.js +1 -1
  12. package/esm/client/3_types.d.ts +1 -5
  13. package/esm/client/4_client.d.ts +20 -3
  14. package/esm/client/4_client.js +61 -62
  15. package/esm/connection/1_connection_web_socket.js +2 -1
  16. package/esm/deps/deno.land/x/{tgcrypto@0.1.3 → tgcrypto@0.2.1}/mod.d.ts +2 -2
  17. package/esm/deps/deno.land/x/{tgcrypto@0.1.3 → tgcrypto@0.2.1}/mod.js +19 -6
  18. package/esm/deps/deno.land/x/tgcrypto@0.2.1/tgcrypto.d.ts +2 -0
  19. package/esm/deps/deno.land/x/tgcrypto@0.2.1/tgcrypto.js +991 -0
  20. package/esm/mod.d.ts +3 -2
  21. package/esm/mod.js +3 -2
  22. package/esm/tl/2_types.d.ts +1 -1
  23. package/esm/tl/2_types.js +1 -2
  24. package/esm/tl/3_functions.d.ts +1 -1
  25. package/esm/tl/3_functions.js +1 -2
  26. package/esm/types/{!0_file_id.js → 0__file_id.js} +0 -1
  27. package/esm/types/0_bot_command.d.ts +4 -0
  28. package/esm/types/0_chat_id.d.ts +4 -0
  29. package/esm/types/0_chat_id.js +1 -0
  30. package/esm/types/0_chat_photo.js +1 -1
  31. package/esm/types/0_input_contact_message_content.d.ts +6 -0
  32. package/esm/types/0_input_contact_message_content.js +1 -0
  33. package/esm/types/0_input_location_message_content.d.ts +8 -0
  34. package/esm/types/0_input_location_message_content.js +1 -0
  35. package/esm/types/0_input_venue_message_content.d.ts +10 -0
  36. package/esm/types/0_input_venue_message_content.js +1 -0
  37. package/esm/types/0_labeled_price.d.ts +4 -0
  38. package/esm/types/0_labeled_price.js +1 -0
  39. package/esm/types/0_parse_mode.d.ts +1 -0
  40. package/esm/types/0_parse_mode.js +1 -0
  41. package/esm/types/0_thumbnail.js +1 -1
  42. package/esm/types/{!0_misc.d.ts → 1__getters.d.ts} +7 -0
  43. package/esm/types/1__getters.js +1 -0
  44. package/esm/types/1_bot_command_scope.d.ts +32 -0
  45. package/esm/types/1_bot_command_scope.js +27 -0
  46. package/esm/types/1_chat.d.ts +1 -1
  47. package/esm/types/1_chat.js +1 -1
  48. package/esm/types/1_inline_query_result_button.d.ts +6 -0
  49. package/esm/types/1_inline_query_result_button.js +1 -0
  50. package/esm/types/1_input_invoice_message_content.d.ts +23 -0
  51. package/esm/types/1_input_invoice_message_content.js +1 -0
  52. package/esm/types/1_input_text_message_content.d.ts +8 -0
  53. package/esm/types/1_input_text_message_content.js +1 -0
  54. package/esm/types/1_photo.js +1 -1
  55. package/esm/types/1_sticker.d.ts +1 -1
  56. package/esm/types/1_sticker.js +1 -1
  57. package/esm/types/1_user.d.ts +1 -1
  58. package/esm/types/1_user.js +1 -1
  59. package/esm/types/2_game.js +1 -1
  60. package/{script/types/1_inline_keyboard_button.d.ts → esm/types/2_inline_keyboard_button.d.ts} +3 -3
  61. package/esm/types/2_inline_query.d.ts +1 -1
  62. package/esm/types/2_input_message_content.d.ts +6 -0
  63. package/esm/types/2_input_message_content.js +1 -0
  64. package/esm/types/{2_inline_keyboard_markup.d.ts → 3_inline_keyboard_markup.d.ts} +3 -2
  65. package/esm/types/{2_inline_keyboard_markup.js → 3_inline_keyboard_markup.js} +1 -1
  66. package/esm/types/3_message.d.ts +13 -13
  67. package/esm/types/3_message.js +13 -13
  68. package/esm/types/4_callback_query.d.ts +1 -1
  69. package/esm/types/4_inline_query_result_article.d.ts +15 -0
  70. package/esm/types/4_inline_query_result_article.js +1 -0
  71. package/esm/types/4_inline_query_result_audio.d.ts +17 -0
  72. package/esm/types/4_inline_query_result_audio.js +1 -0
  73. package/esm/types/4_inline_query_result_cached_audio.d.ts +14 -0
  74. package/esm/types/4_inline_query_result_cached_audio.js +1 -0
  75. package/esm/types/4_inline_query_result_cached_document.d.ts +15 -0
  76. package/esm/types/4_inline_query_result_cached_document.js +1 -0
  77. package/esm/types/4_inline_query_result_cached_gif.d.ts +15 -0
  78. package/esm/types/4_inline_query_result_cached_gif.js +1 -0
  79. package/esm/types/4_inline_query_result_cached_mpeg4_gif.d.ts +15 -0
  80. package/esm/types/4_inline_query_result_cached_mpeg4_gif.js +1 -0
  81. package/esm/types/4_inline_query_result_cached_photo.d.ts +16 -0
  82. package/esm/types/4_inline_query_result_cached_photo.js +1 -0
  83. package/esm/types/4_inline_query_result_cached_sticker.d.ts +9 -0
  84. package/esm/types/4_inline_query_result_cached_sticker.js +1 -0
  85. package/esm/types/4_inline_query_result_cached_video.d.ts +16 -0
  86. package/esm/types/4_inline_query_result_cached_video.js +1 -0
  87. package/esm/types/4_inline_query_result_cached_voice.d.ts +15 -0
  88. package/esm/types/4_inline_query_result_cached_voice.js +1 -0
  89. package/esm/types/4_inline_query_result_contact.d.ts +15 -0
  90. package/esm/types/4_inline_query_result_contact.js +1 -0
  91. package/esm/types/4_inline_query_result_document.d.ts +18 -0
  92. package/esm/types/4_inline_query_result_document.js +1 -0
  93. package/esm/types/4_inline_query_result_game.d.ts +7 -0
  94. package/esm/types/4_inline_query_result_game.js +1 -0
  95. package/esm/types/4_inline_query_result_gif.d.ts +20 -0
  96. package/esm/types/4_inline_query_result_gif.js +1 -0
  97. package/esm/types/4_inline_query_result_location.d.ts +18 -0
  98. package/esm/types/4_inline_query_result_location.js +1 -0
  99. package/esm/types/4_inline_query_result_mpeg4_gif.d.ts +20 -0
  100. package/esm/types/4_inline_query_result_mpeg4_gif.js +1 -0
  101. package/esm/types/4_inline_query_result_photo.d.ts +19 -0
  102. package/esm/types/4_inline_query_result_photo.js +1 -0
  103. package/esm/types/4_inline_query_result_venue.d.ts +19 -0
  104. package/esm/types/4_inline_query_result_venue.js +1 -0
  105. package/esm/types/4_inline_query_result_video.d.ts +21 -0
  106. package/esm/types/4_inline_query_result_video.js +1 -0
  107. package/esm/types/4_inline_query_result_voice.d.ts +16 -0
  108. package/esm/types/4_inline_query_result_voice.js +1 -0
  109. package/esm/types/4_reply_markup.d.ts +7 -0
  110. package/esm/types/4_reply_markup.js +22 -0
  111. package/esm/types/5_inline_query_result.d.ts +29 -0
  112. package/esm/types/5_inline_query_result.js +256 -0
  113. package/esm/utilities/0_crypto.js +6 -4
  114. package/package.json +1 -1
  115. package/script/0_deps.d.ts +1 -1
  116. package/script/0_deps.js +1 -1
  117. package/script/3_errors.d.ts +1531 -0
  118. package/script/3_errors.js +2053 -0
  119. package/script/3_types.d.ts +39 -3
  120. package/script/3_types.js +39 -3
  121. package/script/4_constants.d.ts +1 -1
  122. package/script/4_constants.js +1 -1
  123. package/script/4_errors.d.ts +25 -0
  124. package/script/4_errors.js +88 -0
  125. package/script/client/2_client_plain.js +1 -1
  126. package/script/client/3_types.d.ts +1 -5
  127. package/script/client/4_client.d.ts +20 -3
  128. package/script/client/4_client.js +60 -61
  129. package/script/connection/1_connection_web_socket.js +2 -1
  130. package/script/deps/deno.land/x/{tgcrypto@0.1.3 → tgcrypto@0.2.1}/mod.d.ts +2 -2
  131. package/script/deps/deno.land/x/{tgcrypto@0.1.3 → tgcrypto@0.2.1}/mod.js +19 -6
  132. package/script/deps/deno.land/x/tgcrypto@0.2.1/tgcrypto.d.ts +2 -0
  133. package/script/deps/deno.land/x/tgcrypto@0.2.1/tgcrypto.js +993 -0
  134. package/script/mod.d.ts +3 -2
  135. package/script/mod.js +16 -3
  136. package/script/tl/2_types.d.ts +1 -1
  137. package/script/tl/2_types.js +0 -1
  138. package/script/tl/3_functions.d.ts +1 -1
  139. package/script/tl/3_functions.js +0 -1
  140. package/script/types/{!0_file_id.js → 0__file_id.js} +0 -1
  141. package/script/types/0_bot_command.d.ts +4 -0
  142. package/script/types/0_chat_id.d.ts +4 -0
  143. package/script/types/0_chat_id.js +2 -0
  144. package/script/types/0_chat_photo.js +7 -7
  145. package/script/types/0_input_contact_message_content.d.ts +6 -0
  146. package/script/types/0_input_contact_message_content.js +2 -0
  147. package/script/types/0_input_location_message_content.d.ts +8 -0
  148. package/script/types/0_input_location_message_content.js +2 -0
  149. package/script/types/0_input_venue_message_content.d.ts +10 -0
  150. package/script/types/0_input_venue_message_content.js +2 -0
  151. package/script/types/0_labeled_price.d.ts +4 -0
  152. package/script/types/0_labeled_price.js +2 -0
  153. package/script/types/0_parse_mode.d.ts +1 -0
  154. package/script/types/0_parse_mode.js +2 -0
  155. package/script/types/0_thumbnail.js +5 -5
  156. package/script/types/{!0_misc.d.ts → 1__getters.d.ts} +7 -0
  157. package/script/types/1__getters.js +2 -0
  158. package/script/types/1_bot_command_scope.d.ts +32 -0
  159. package/script/types/1_bot_command_scope.js +31 -0
  160. package/script/types/1_chat.d.ts +1 -1
  161. package/script/types/1_chat.js +1 -1
  162. package/script/types/1_inline_query_result_button.d.ts +6 -0
  163. package/script/types/1_inline_query_result_button.js +2 -0
  164. package/script/types/1_input_invoice_message_content.d.ts +23 -0
  165. package/script/types/1_input_invoice_message_content.js +2 -0
  166. package/script/types/1_input_text_message_content.d.ts +8 -0
  167. package/script/types/1_input_text_message_content.js +2 -0
  168. package/script/types/1_photo.js +5 -5
  169. package/script/types/1_sticker.d.ts +1 -1
  170. package/script/types/1_sticker.js +1 -1
  171. package/script/types/1_user.d.ts +1 -1
  172. package/script/types/1_user.js +1 -1
  173. package/script/types/2_game.js +3 -3
  174. package/{esm/types/1_inline_keyboard_button.d.ts → script/types/2_inline_keyboard_button.d.ts} +3 -3
  175. package/script/types/2_inline_query.d.ts +1 -1
  176. package/script/types/2_input_message_content.d.ts +6 -0
  177. package/script/types/2_input_message_content.js +2 -0
  178. package/script/types/{2_inline_keyboard_markup.d.ts → 3_inline_keyboard_markup.d.ts} +3 -2
  179. package/script/types/{2_inline_keyboard_markup.js → 3_inline_keyboard_markup.js} +3 -3
  180. package/script/types/3_message.d.ts +13 -13
  181. package/script/types/3_message.js +23 -23
  182. package/script/types/4_callback_query.d.ts +1 -1
  183. package/script/types/4_inline_query_result_article.d.ts +15 -0
  184. package/script/types/4_inline_query_result_article.js +2 -0
  185. package/script/types/4_inline_query_result_audio.d.ts +17 -0
  186. package/script/types/4_inline_query_result_audio.js +2 -0
  187. package/script/types/4_inline_query_result_cached_audio.d.ts +14 -0
  188. package/script/types/4_inline_query_result_cached_audio.js +2 -0
  189. package/script/types/4_inline_query_result_cached_document.d.ts +15 -0
  190. package/script/types/4_inline_query_result_cached_document.js +2 -0
  191. package/script/types/4_inline_query_result_cached_gif.d.ts +15 -0
  192. package/script/types/4_inline_query_result_cached_gif.js +2 -0
  193. package/script/types/4_inline_query_result_cached_mpeg4_gif.d.ts +15 -0
  194. package/script/types/4_inline_query_result_cached_mpeg4_gif.js +2 -0
  195. package/script/types/4_inline_query_result_cached_photo.d.ts +16 -0
  196. package/script/types/4_inline_query_result_cached_photo.js +2 -0
  197. package/script/types/4_inline_query_result_cached_sticker.d.ts +9 -0
  198. package/script/types/4_inline_query_result_cached_sticker.js +2 -0
  199. package/script/types/4_inline_query_result_cached_video.d.ts +16 -0
  200. package/script/types/4_inline_query_result_cached_video.js +2 -0
  201. package/script/types/4_inline_query_result_cached_voice.d.ts +15 -0
  202. package/script/types/4_inline_query_result_cached_voice.js +2 -0
  203. package/script/types/4_inline_query_result_contact.d.ts +15 -0
  204. package/script/types/4_inline_query_result_contact.js +2 -0
  205. package/script/types/4_inline_query_result_document.d.ts +18 -0
  206. package/script/types/4_inline_query_result_document.js +2 -0
  207. package/script/types/4_inline_query_result_game.d.ts +7 -0
  208. package/script/types/4_inline_query_result_game.js +2 -0
  209. package/script/types/4_inline_query_result_gif.d.ts +20 -0
  210. package/script/types/4_inline_query_result_gif.js +2 -0
  211. package/script/types/4_inline_query_result_location.d.ts +18 -0
  212. package/script/types/4_inline_query_result_location.js +2 -0
  213. package/script/types/4_inline_query_result_mpeg4_gif.d.ts +20 -0
  214. package/script/types/4_inline_query_result_mpeg4_gif.js +2 -0
  215. package/script/types/4_inline_query_result_photo.d.ts +19 -0
  216. package/script/types/4_inline_query_result_photo.js +2 -0
  217. package/script/types/4_inline_query_result_venue.d.ts +19 -0
  218. package/script/types/4_inline_query_result_venue.js +2 -0
  219. package/script/types/4_inline_query_result_video.d.ts +21 -0
  220. package/script/types/4_inline_query_result_video.js +2 -0
  221. package/script/types/4_inline_query_result_voice.d.ts +16 -0
  222. package/script/types/4_inline_query_result_voice.js +2 -0
  223. package/script/types/4_reply_markup.d.ts +7 -0
  224. package/script/types/4_reply_markup.js +26 -0
  225. package/script/types/5_inline_query_result.d.ts +29 -0
  226. package/script/types/5_inline_query_result.js +260 -0
  227. package/script/utilities/0_crypto.js +6 -4
  228. package/esm/deps/deno.land/x/tgcrypto@0.1.3/tgcrypto.d.ts +0 -2
  229. package/esm/deps/deno.land/x/tgcrypto@0.1.3/tgcrypto.js +0 -1078
  230. package/script/deps/deno.land/x/tgcrypto@0.1.3/tgcrypto.d.ts +0 -2
  231. package/script/deps/deno.land/x/tgcrypto@0.1.3/tgcrypto.js +0 -1080
  232. /package/esm/types/{!0_file_id.d.ts → 0__file_id.d.ts} +0 -0
  233. /package/esm/types/{!0_misc.js → 0_bot_command.js} +0 -0
  234. /package/esm/types/{1_inline_keyboard_button.js → 2_inline_keyboard_button.js} +0 -0
  235. /package/script/types/{!0_file_id.d.ts → 0__file_id.d.ts} +0 -0
  236. /package/script/types/{!0_misc.js → 0_bot_command.js} +0 -0
  237. /package/script/types/{1_inline_keyboard_button.js → 2_inline_keyboard_button.js} +0 -0
@@ -0,0 +1,15 @@
1
+ import { MessageEntity } from "./0_message_entity.js";
2
+ import { ParseMode } from "./0_parse_mode.js";
3
+ import { InputMessageContent } from "./2_input_message_content.js";
4
+ import { InlineKeyboardMarkup } from "./3_inline_keyboard_markup.js";
5
+ export interface InlineQueryResultCachedMpeg4Gif {
6
+ type: "mpeg4_gif";
7
+ id: string;
8
+ mpeg4FileId: string;
9
+ title?: string;
10
+ caption?: string;
11
+ parseMode?: ParseMode;
12
+ captionEntities?: MessageEntity[];
13
+ replyMarkup?: InlineKeyboardMarkup;
14
+ inputMessageContent?: InputMessageContent;
15
+ }
@@ -0,0 +1,16 @@
1
+ import { MessageEntity } from "./0_message_entity.js";
2
+ import { ParseMode } from "./0_parse_mode.js";
3
+ import { InputMessageContent } from "./2_input_message_content.js";
4
+ import { InlineKeyboardMarkup } from "./3_inline_keyboard_markup.js";
5
+ export interface InlineQueryResultCachedPhoto {
6
+ type: "photo";
7
+ id: string;
8
+ photoFileId: string;
9
+ title?: string;
10
+ description?: string;
11
+ caption?: string;
12
+ parseMode?: ParseMode;
13
+ captionEntities?: MessageEntity[];
14
+ replyMarkup?: InlineKeyboardMarkup;
15
+ inputMessageContent?: InputMessageContent;
16
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ import { InputMessageContent } from "./2_input_message_content.js";
2
+ import { InlineKeyboardMarkup } from "./3_inline_keyboard_markup.js";
3
+ export interface InlineQueryResultCachedSticker {
4
+ type: "sticker";
5
+ id: string;
6
+ stickerFileId: string;
7
+ replyMarkup?: InlineKeyboardMarkup;
8
+ inputMessageContent?: InputMessageContent;
9
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,16 @@
1
+ import { MessageEntity } from "./0_message_entity.js";
2
+ import { ParseMode } from "./0_parse_mode.js";
3
+ import { InputMessageContent } from "./2_input_message_content.js";
4
+ import { InlineKeyboardMarkup } from "./3_inline_keyboard_markup.js";
5
+ export interface InlineQueryResultCachedVideo {
6
+ type: "video";
7
+ id: string;
8
+ videoFileId: string;
9
+ title: string;
10
+ description?: string;
11
+ caption?: string;
12
+ parseMode?: ParseMode;
13
+ captionEntities?: MessageEntity[];
14
+ replyMarkup?: InlineKeyboardMarkup;
15
+ inputMessageContent?: InputMessageContent;
16
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,15 @@
1
+ import { MessageEntity } from "./0_message_entity.js";
2
+ import { ParseMode } from "./0_parse_mode.js";
3
+ import { InputMessageContent } from "./2_input_message_content.js";
4
+ import { InlineKeyboardMarkup } from "./3_inline_keyboard_markup.js";
5
+ export interface InlineQueryResultCachedVoice {
6
+ type: "voice";
7
+ id: string;
8
+ voiceFileId: string;
9
+ title: string;
10
+ caption?: string;
11
+ parseMode?: ParseMode;
12
+ captionEntities?: MessageEntity[];
13
+ replyMarkup?: InlineKeyboardMarkup;
14
+ inputMessageContent?: InputMessageContent;
15
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,15 @@
1
+ import { InputMessageContent } from "./2_input_message_content.js";
2
+ import { InlineKeyboardMarkup } from "./3_inline_keyboard_markup.js";
3
+ export interface InlineQueryResultContact {
4
+ type: "game";
5
+ id: string;
6
+ phoneNumber: string;
7
+ firstName: string;
8
+ lastName?: string;
9
+ vcard?: string;
10
+ replyMarkup?: InlineKeyboardMarkup;
11
+ inputMessageContent?: InputMessageContent;
12
+ thumbnailUrl?: string;
13
+ thumbnailWidth?: string;
14
+ thumbnailHeight?: string;
15
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,18 @@
1
+ import { MessageEntity } from "./0_message_entity.js";
2
+ import { ParseMode } from "./0_parse_mode.js";
3
+ import { InputMessageContent } from "./2_input_message_content.js";
4
+ import { InlineKeyboardMarkup } from "./3_inline_keyboard_markup.js";
5
+ export interface InlineQueryResultDocument {
6
+ type: "document";
7
+ id: string;
8
+ documentUrl: string;
9
+ title: string;
10
+ caption?: string;
11
+ parseMode?: ParseMode;
12
+ captionEntities?: MessageEntity[];
13
+ replyMarkup?: InlineKeyboardMarkup;
14
+ inputMessageContent?: InputMessageContent;
15
+ thumbnailUrl?: string;
16
+ thumbnailWidth?: string;
17
+ thumbnailHeight?: string;
18
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ import { InlineKeyboardMarkup } from "./3_inline_keyboard_markup.js";
2
+ export interface InlineQueryResultGame {
3
+ type: "game";
4
+ id: string;
5
+ gameShortName: string;
6
+ replyMarkup?: InlineKeyboardMarkup;
7
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,20 @@
1
+ import { MessageEntity } from "./0_message_entity.js";
2
+ import { ParseMode } from "./0_parse_mode.js";
3
+ import { InputMessageContent } from "./2_input_message_content.js";
4
+ import { InlineKeyboardMarkup } from "./3_inline_keyboard_markup.js";
5
+ export interface InlineQueryResultGif {
6
+ type: "gif";
7
+ id: string;
8
+ gifUrl: string;
9
+ gifWidth?: number;
10
+ gifHeight?: number;
11
+ gifDuration?: number;
12
+ thumbnailUrl?: string;
13
+ thumbnailMimeType?: string;
14
+ title?: string;
15
+ caption?: string;
16
+ parseMode?: ParseMode;
17
+ captionEntities?: MessageEntity[];
18
+ replyMarkup?: InlineKeyboardMarkup;
19
+ inputMessageContent?: InputMessageContent;
20
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,18 @@
1
+ import { InputMessageContent } from "./2_input_message_content.js";
2
+ import { InlineKeyboardMarkup } from "./3_inline_keyboard_markup.js";
3
+ export interface InlineQueryResultLocation {
4
+ type: "location";
5
+ id: string;
6
+ latitude: number;
7
+ longitude: number;
8
+ title: string;
9
+ horizontalAccuracy?: number;
10
+ livePeriod?: number;
11
+ heading?: number;
12
+ proximityAlertRadius?: number;
13
+ replyMarkup?: InlineKeyboardMarkup;
14
+ inputMessageContent?: InputMessageContent;
15
+ thumbnailUrl?: string;
16
+ thumbnailWidth?: string;
17
+ thumbnailHeight?: string;
18
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,20 @@
1
+ import { MessageEntity } from "./0_message_entity.js";
2
+ import { ParseMode } from "./0_parse_mode.js";
3
+ import { InputMessageContent } from "./2_input_message_content.js";
4
+ import { InlineKeyboardMarkup } from "./3_inline_keyboard_markup.js";
5
+ export interface InlineQueryResultMpeg4Gif {
6
+ type: "mpeg4_gif";
7
+ id: string;
8
+ mpeg4Url: string;
9
+ mpeg4Width?: number;
10
+ mpeg4Height?: number;
11
+ mpeg4Duration?: number;
12
+ thumbnailUrl?: string;
13
+ thumbnailMimeType?: string;
14
+ title?: string;
15
+ caption?: string;
16
+ parseMode?: ParseMode;
17
+ captionEntities?: MessageEntity[];
18
+ replyMarkup?: InlineKeyboardMarkup;
19
+ inputMessageContent?: InputMessageContent;
20
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,19 @@
1
+ import { MessageEntity } from "./0_message_entity.js";
2
+ import { ParseMode } from "./0_parse_mode.js";
3
+ import { InputMessageContent } from "./2_input_message_content.js";
4
+ import { InlineKeyboardMarkup } from "./3_inline_keyboard_markup.js";
5
+ export interface InlineQueryResultPhoto {
6
+ type: "photo";
7
+ id: string;
8
+ photoUrl: string;
9
+ thumbnailUrl: string;
10
+ photoWidth?: number;
11
+ photoHeight?: number;
12
+ title?: string;
13
+ description?: string;
14
+ caption?: string;
15
+ parseMode?: ParseMode;
16
+ captionEntities?: MessageEntity[];
17
+ replyMarkup?: InlineKeyboardMarkup;
18
+ inputMessageContent?: InputMessageContent;
19
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,19 @@
1
+ import { InputMessageContent } from "./2_input_message_content.js";
2
+ import { InlineKeyboardMarkup } from "./3_inline_keyboard_markup.js";
3
+ export interface InlineQueryResultVenue {
4
+ type: "venue";
5
+ id: string;
6
+ latitude: number;
7
+ longitude: number;
8
+ title: string;
9
+ address: string;
10
+ fourSquareId?: string;
11
+ foursquareType?: string;
12
+ googlePlaceId?: string;
13
+ googlePlaceType?: string;
14
+ replyMarkup?: InlineKeyboardMarkup;
15
+ inputMessageContent?: InputMessageContent;
16
+ thumbnailUrl?: string;
17
+ thumbnailWidth?: string;
18
+ thumbnailHeight?: string;
19
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,21 @@
1
+ import { MessageEntity } from "./0_message_entity.js";
2
+ import { ParseMode } from "./0_parse_mode.js";
3
+ import { InputMessageContent } from "./2_input_message_content.js";
4
+ import { InlineKeyboardMarkup } from "./3_inline_keyboard_markup.js";
5
+ export interface InlineQueryResultVideo {
6
+ type: "video";
7
+ id: string;
8
+ videoUrl: string;
9
+ mimeType: string;
10
+ thumbnailUrl: string;
11
+ title: string;
12
+ caption?: string;
13
+ parseMode?: ParseMode;
14
+ captionEntities?: MessageEntity[];
15
+ videoWidth?: number;
16
+ videoHeight?: number;
17
+ videoDuration?: number;
18
+ description?: string;
19
+ replyMarkup?: InlineKeyboardMarkup;
20
+ inputMessageContent?: InputMessageContent;
21
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,16 @@
1
+ import { MessageEntity } from "./0_message_entity.js";
2
+ import { ParseMode } from "./0_parse_mode.js";
3
+ import { InputMessageContent } from "./2_input_message_content.js";
4
+ import { InlineKeyboardMarkup } from "./3_inline_keyboard_markup.js";
5
+ export interface InlineQueryResultVoice {
6
+ type: "voice";
7
+ id: string;
8
+ voiceUrl: string;
9
+ title: string;
10
+ caption?: string;
11
+ parseMode?: ParseMode;
12
+ captionEntities?: MessageEntity[];
13
+ voiceDuration?: number;
14
+ replyMarkup?: InlineKeyboardMarkup;
15
+ inputMessageContent?: InputMessageContent;
16
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ import { ForceReply } from "./0_force_reply.js";
2
+ import { ReplyKeyboardRemove } from "./0_reply_keyboard_remove.js";
3
+ import { UsernameResolver } from "./1__getters.js";
4
+ import { ReplyKeyboardMarkup } from "./2_reply_keyboard_markup.js";
5
+ import { InlineKeyboardMarkup } from "./3_inline_keyboard_markup.js";
6
+ export type ReplyMarkup = InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
7
+ export declare function replyMarkupToTlObject(replyMarkup: ReplyMarkup, usernameResolver: UsernameResolver): Promise<import("../tl/2_types.js").ReplyKeyboardHide | import("../tl/2_types.js").ReplyKeyboardForceReply | import("../tl/2_types.js").ReplyKeyboardMarkup | import("../tl/2_types.js").ReplyInlineMarkup>;
@@ -0,0 +1,22 @@
1
+ import { UNREACHABLE } from "../1_utilities.js";
2
+ import { forceReplyToTlObject } from "./0_force_reply.js";
3
+ import { replyKeyboardRemoveToTlObject } from "./0_reply_keyboard_remove.js";
4
+ import { replyKeyboardMarkupToTlObject } from "./2_reply_keyboard_markup.js";
5
+ import { inlineKeyboardMarkupToTlObject } from "./3_inline_keyboard_markup.js";
6
+ export async function replyMarkupToTlObject(replyMarkup, usernameResolver) {
7
+ if ("inlineKeyboard" in replyMarkup) {
8
+ return await inlineKeyboardMarkupToTlObject(replyMarkup, usernameResolver);
9
+ }
10
+ else if ("keyboard" in replyMarkup) {
11
+ return replyKeyboardMarkupToTlObject(replyMarkup);
12
+ }
13
+ else if ("removeKeyboard" in replyMarkup) {
14
+ return replyKeyboardRemoveToTlObject(replyMarkup);
15
+ }
16
+ else if ("forceReply" in replyMarkup) {
17
+ return forceReplyToTlObject(replyMarkup);
18
+ }
19
+ else {
20
+ UNREACHABLE();
21
+ }
22
+ }
@@ -0,0 +1,29 @@
1
+ import { types } from "../2_tl.js";
2
+ import { MessageEntity } from "./0_message_entity.js";
3
+ import { ParseMode } from "./0_parse_mode.js";
4
+ import { UsernameResolver } from "./1__getters.js";
5
+ import { InlineQueryResultArticle } from "./4_inline_query_result_article.js";
6
+ import { InlineQueryResultAudio } from "./4_inline_query_result_audio.js";
7
+ import { InlineQueryResultCachedAudio } from "./4_inline_query_result_cached_audio.js";
8
+ import { InlineQueryResultCachedDocument } from "./4_inline_query_result_cached_document.js";
9
+ import { InlineQueryResultCachedGif } from "./4_inline_query_result_cached_gif.js";
10
+ import { InlineQueryResultCachedMpeg4Gif } from "./4_inline_query_result_cached_mpeg4_gif.js";
11
+ import { InlineQueryResultCachedPhoto } from "./4_inline_query_result_cached_photo.js";
12
+ import { InlineQueryResultCachedSticker } from "./4_inline_query_result_cached_sticker.js";
13
+ import { InlineQueryResultCachedVideo } from "./4_inline_query_result_cached_video.js";
14
+ import { InlineQueryResultCachedVoice } from "./4_inline_query_result_cached_voice.js";
15
+ import { InlineQueryResultContact } from "./4_inline_query_result_contact.js";
16
+ import { InlineQueryResultDocument } from "./4_inline_query_result_document.js";
17
+ import { InlineQueryResultGame } from "./4_inline_query_result_game.js";
18
+ import { InlineQueryResultGif } from "./4_inline_query_result_gif.js";
19
+ import { InlineQueryResultLocation } from "./4_inline_query_result_location.js";
20
+ import { InlineQueryResultMpeg4Gif } from "./4_inline_query_result_mpeg4_gif.js";
21
+ import { InlineQueryResultPhoto } from "./4_inline_query_result_photo.js";
22
+ import { InlineQueryResultVenue } from "./4_inline_query_result_venue.js";
23
+ import { InlineQueryResultVideo } from "./4_inline_query_result_video.js";
24
+ import { InlineQueryResultVoice } from "./4_inline_query_result_voice.js";
25
+ export type InlineQueryResult = InlineQueryResultCachedAudio | InlineQueryResultCachedDocument | InlineQueryResultCachedGif | InlineQueryResultCachedMpeg4Gif | InlineQueryResultCachedPhoto | InlineQueryResultCachedSticker | InlineQueryResultCachedVideo | InlineQueryResultCachedVoice | InlineQueryResultArticle | InlineQueryResultAudio | InlineQueryResultContact | InlineQueryResultGame | InlineQueryResultDocument | InlineQueryResultGif | InlineQueryResultLocation | InlineQueryResultMpeg4Gif | InlineQueryResultPhoto | InlineQueryResultVenue | InlineQueryResultVideo | InlineQueryResultVoice;
26
+ export declare function inlineQueryResultToTlObject(result_: InlineQueryResult, parseText: (text: string, params?: {
27
+ parseMode?: ParseMode;
28
+ entities?: MessageEntity[];
29
+ }) => readonly [string, any[] | undefined], usernameResolver: UsernameResolver): Promise<types.InputBotInlineResult | types.InputBotInlineResultDocument>;
@@ -0,0 +1,256 @@
1
+ import { UNREACHABLE } from "../1_utilities.js";
2
+ import { types } from "../2_tl.js";
3
+ import { FileID } from "./0__file_id.js";
4
+ import { replyMarkupToTlObject } from "./4_reply_markup.js";
5
+ // deno-lint-ignore no-explicit-any
6
+ export async function inlineQueryResultToTlObject(result_, parseText, usernameResolver) {
7
+ let document = null;
8
+ let thumb = null;
9
+ let fileId_ = null;
10
+ switch (result_.type) {
11
+ case "audio":
12
+ if ("audioUrl" in result_) {
13
+ document = new types.InputWebDocument({
14
+ url: result_.audioUrl,
15
+ size: 0,
16
+ mimeType: "audio/mpeg",
17
+ attributes: [
18
+ new types.DocumentAttributeAudio({
19
+ duration: result_.audioDuration ?? 0,
20
+ title: result_.title,
21
+ performer: result_.performer,
22
+ }),
23
+ ],
24
+ });
25
+ }
26
+ else {
27
+ fileId_ = result_.audioFileId;
28
+ }
29
+ break;
30
+ case "video":
31
+ if ("videoUrl" in result_) {
32
+ document = new types.InputWebDocument({
33
+ url: result_.videoUrl,
34
+ size: 0,
35
+ mimeType: result_.mimeType ?? "video/mp4",
36
+ attributes: [
37
+ new types.DocumentAttributeVideo({
38
+ duration: result_.videoDuration ?? 0,
39
+ h: result_.videoHeight ?? 0,
40
+ w: result_.videoWidth ?? 0,
41
+ }),
42
+ ],
43
+ });
44
+ }
45
+ else {
46
+ fileId_ = result_.videoFileId;
47
+ }
48
+ break;
49
+ case "document":
50
+ if ("documentUrl" in result_) {
51
+ document = new types.InputWebDocument({
52
+ url: result_.documentUrl,
53
+ mimeType: "application/octet-stream",
54
+ attributes: [],
55
+ size: 0,
56
+ });
57
+ }
58
+ else {
59
+ fileId_ = result_.documentFileId;
60
+ }
61
+ break;
62
+ case "gif":
63
+ if ("gifUrl" in result_) {
64
+ document = new types.InputWebDocument({
65
+ url: result_.gifUrl,
66
+ size: 0,
67
+ mimeType: "image/gif",
68
+ attributes: [
69
+ new types.DocumentAttributeVideo({
70
+ duration: result_.gifDuration ?? 0,
71
+ h: result_.gifHeight ?? 0,
72
+ w: result_.gifWidth ?? 0,
73
+ }),
74
+ ],
75
+ });
76
+ }
77
+ else {
78
+ fileId_ = result_.gifFileId;
79
+ }
80
+ break;
81
+ case "mpeg4_gif":
82
+ if ("mpeg4Url" in result_) {
83
+ document = new types.InputWebDocument({
84
+ url: result_.mpeg4Url,
85
+ size: 0,
86
+ mimeType: "video/mp4",
87
+ attributes: [
88
+ new types.DocumentAttributeVideo({
89
+ nosound: true,
90
+ duration: result_.mpeg4Duration ?? 0,
91
+ w: result_.mpeg4Width ?? 0,
92
+ h: result_.mpeg4Height ?? 0,
93
+ supportsStreaming: true,
94
+ }),
95
+ ],
96
+ });
97
+ }
98
+ else {
99
+ fileId_ = result_.mpeg4FileId;
100
+ }
101
+ break;
102
+ case "photo":
103
+ if ("photoUrl" in result_) {
104
+ document = new types.InputWebDocument({
105
+ url: result_.photoUrl,
106
+ size: 0,
107
+ mimeType: "image/jpeg",
108
+ attributes: [new types.DocumentAttributeImageSize({ w: result_.photoWidth ?? 0, h: result_.photoHeight ?? 0 })],
109
+ });
110
+ }
111
+ else {
112
+ fileId_ = result_.photoFileId;
113
+ }
114
+ break;
115
+ case "sticker":
116
+ fileId_ = result_.stickerFileId;
117
+ break;
118
+ case "voice":
119
+ if ("voiceUrl" in result_) {
120
+ document = new types.InputWebDocument({
121
+ url: result_.voiceUrl,
122
+ size: 0,
123
+ mimeType: "audio/mpeg",
124
+ attributes: [
125
+ new types.DocumentAttributeAudio({
126
+ duration: result_.voiceDuration ?? 0,
127
+ voice: true,
128
+ }),
129
+ ],
130
+ });
131
+ }
132
+ else {
133
+ fileId_ = result_.voiceFileId;
134
+ }
135
+ break;
136
+ }
137
+ const replyMarkup = "replyMarkup" in result_ && result_.replyMarkup ? await replyMarkupToTlObject(result_.replyMarkup, usernameResolver) : undefined;
138
+ if ("thumbnailUrl" in result_ && result_.thumbnailUrl) {
139
+ thumb = new types.InputWebDocument({
140
+ url: result_.thumbnailUrl,
141
+ size: 0,
142
+ mimeType: "image/jpeg",
143
+ attributes: [],
144
+ });
145
+ }
146
+ else if (result_.type == "photo") {
147
+ thumb = document;
148
+ }
149
+ let ret = ["", []];
150
+ if ("caption" in result_ && result_.caption) {
151
+ ret = parseText(result_.caption, { parseMode: result_.parseMode, entities: result_.captionEntities });
152
+ }
153
+ const { type, id } = result_;
154
+ const [message, entities] = ret;
155
+ const sendMessage = new types.InputBotInlineMessageMediaAuto({
156
+ message,
157
+ entities,
158
+ replyMarkup,
159
+ });
160
+ const title = "title" in result_ ? result_.title : undefined;
161
+ if (document != null) {
162
+ return new types.InputBotInlineResult({
163
+ id,
164
+ type,
165
+ title,
166
+ thumb: thumb == null ? undefined : thumb,
167
+ content: document,
168
+ sendMessage: new types.InputBotInlineMessageMediaAuto({
169
+ message,
170
+ entities,
171
+ replyMarkup,
172
+ }),
173
+ });
174
+ }
175
+ else if (fileId_ != null) {
176
+ const fileId = FileID.decode(fileId_);
177
+ return new types.InputBotInlineResultDocument({
178
+ id,
179
+ type,
180
+ title,
181
+ document: new types.InputDocument({
182
+ id: fileId.params.mediaId,
183
+ accessHash: fileId.params.accessHash,
184
+ fileReference: fileId.params.fileReference,
185
+ }),
186
+ sendMessage,
187
+ });
188
+ }
189
+ else if (result_.type == "location") {
190
+ return new types.InputBotInlineResult({
191
+ id,
192
+ type,
193
+ title,
194
+ sendMessage: new types.InputBotInlineMessageMediaGeo({
195
+ geoPoint: new types.InputGeoPoint({
196
+ lat: result_.latitude,
197
+ long: result_.longitude,
198
+ accuracyRadius: result_.horizontalAccuracy,
199
+ }),
200
+ heading: result_.heading,
201
+ period: result_.livePeriod,
202
+ proximityNotificationRadius: result_.proximityAlertRadius,
203
+ replyMarkup,
204
+ }),
205
+ });
206
+ }
207
+ else if (result_.type == "game") {
208
+ return new types.InputBotInlineResult({
209
+ id,
210
+ type,
211
+ title,
212
+ sendMessage: new types.InputBotInlineMessageGame({
213
+ replyMarkup,
214
+ }),
215
+ });
216
+ }
217
+ else if (result_.type == "article") {
218
+ if (!("messageText" in result_.inputMessageContent)) {
219
+ UNREACHABLE();
220
+ }
221
+ const [message, entities] = parseText(result_.inputMessageContent.messageText, { entities: result_.inputMessageContent.entities, parseMode: result_.inputMessageContent.parseMode });
222
+ return new types.InputBotInlineResult({
223
+ id,
224
+ type,
225
+ title,
226
+ sendMessage: new types.InputBotInlineMessageText({
227
+ message,
228
+ entities,
229
+ noWebpage: result_.inputMessageContent.disableWebPagePreview ? true : undefined,
230
+ replyMarkup,
231
+ }),
232
+ });
233
+ }
234
+ else if (result_.type == "venue") {
235
+ if (!result_.fourSquareId || !result_.foursquareType) {
236
+ UNREACHABLE();
237
+ }
238
+ return new types.InputBotInlineResult({
239
+ id,
240
+ type,
241
+ title,
242
+ sendMessage: new types.InputBotInlineMessageMediaVenue({
243
+ geoPoint: new types.InputGeoPoint({ long: result_.longitude, lat: result_.latitude }),
244
+ address: result_.address,
245
+ provider: "foursquare",
246
+ title: result_.title,
247
+ venueId: result_.fourSquareId,
248
+ venueType: result_.foursquareType,
249
+ replyMarkup,
250
+ }),
251
+ });
252
+ }
253
+ else {
254
+ UNREACHABLE();
255
+ }
256
+ }
@@ -21,15 +21,17 @@ export class CTR {
21
21
  });
22
22
  }
23
23
  encrypt(data) {
24
- const [encrypted, iv, state] = ctr256Encrypt(data, this.key, this.iv, this.state);
24
+ const v = new Uint8Array(data); // TODO: don't copy
25
+ const [iv, state] = ctr256Encrypt(v, this.key, this.iv, this.state);
25
26
  this.iv = iv;
26
27
  this.state = state;
27
- return new Uint8Array(encrypted);
28
+ return v;
28
29
  }
29
30
  decrypt(data) {
30
- const [decrypted, iv, state] = ctr256Decrypt(data, this.key, this.iv, this.state);
31
+ const v = new Uint8Array(data); // TODO: don't copy
32
+ const [iv, state] = ctr256Decrypt(v, this.key, this.iv, this.state);
31
33
  this.iv = iv;
32
34
  this.state = state;
33
- return new Uint8Array(decrypted);
35
+ return v;
34
36
  }
35
37
  }