@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
package/esm/mod.d.ts CHANGED
@@ -4,10 +4,11 @@ export declare const utils: {
4
4
  checkPassword: typeof checkPassword;
5
5
  getRandomId: typeof getRandomId;
6
6
  };
7
- export * from "./2_tl.js";
8
7
  export * from "./2_connection.js";
9
8
  export * from "./3_storage.js";
10
9
  export * from "./3_transport.js";
10
+ export * from "./2_tl.js";
11
+ export * from "./3_types.js";
11
12
  export { APP_VERSION, DEVICE_MODEL, INITIAL_DC, LANG_CODE, LANG_PACK, LAYER, SYSTEM_LANG_CODE, SYSTEM_VERSION } from "./4_constants.js";
13
+ export * as errors from "./4_errors.js";
12
14
  export * from "./5_client.js";
13
- export * from "./3_types.js";
package/esm/mod.js CHANGED
@@ -1,10 +1,11 @@
1
1
  import { getRandomId } from "./1_utilities.js";
2
2
  import { checkPassword } from "./client/0_password.js";
3
3
  export const utils = { checkPassword, getRandomId };
4
- export * from "./2_tl.js";
5
4
  export * from "./2_connection.js";
6
5
  export * from "./3_storage.js";
7
6
  export * from "./3_transport.js";
7
+ export * from "./2_tl.js";
8
+ export * from "./3_types.js";
8
9
  export { APP_VERSION, DEVICE_MODEL, INITIAL_DC, LANG_CODE, LANG_PACK, LAYER, SYSTEM_LANG_CODE, SYSTEM_VERSION } from "./4_constants.js";
10
+ export * as errors from "./4_errors.js";
9
11
  export * from "./5_client.js";
10
- export * from "./3_types.js";
@@ -1,4 +1,4 @@
1
- import { id, params, TLObject, Params, TLObjectConstructor, ParamDesc, paramDesc } from "./1_tl_object.js";
1
+ import { id, ParamDesc, paramDesc, Params, params, TLObject, TLObjectConstructor } from "./1_tl_object.js";
2
2
  export declare abstract class Type extends TLObject {
3
3
  }
4
4
  export declare abstract class TypeX extends Type {
package/esm/tl/2_types.js CHANGED
@@ -1,5 +1,4 @@
1
- // deno-fmt-ignore-file
2
- import { id, params, TLObject, paramDesc, flags } from "./1_tl_object.js";
1
+ import { flags, id, paramDesc, params, TLObject } from "./1_tl_object.js";
3
2
  export class Type extends TLObject {
4
3
  }
5
4
  // Unknown type (generic)
@@ -1,4 +1,4 @@
1
- import { id, params, TLObject, Params, paramDesc, ParamDesc } from "./1_tl_object.js";
1
+ import { id, ParamDesc, paramDesc, Params, params, TLObject } from "./1_tl_object.js";
2
2
  import * as types from "./2_types.js";
3
3
  export declare abstract class Function<T> extends TLObject {
4
4
  __R: T;
@@ -1,5 +1,4 @@
1
- // deno-fmt-ignore-file
2
- import { id, params, TLObject, paramDesc, flags } from "./1_tl_object.js";
1
+ import { flags, id, paramDesc, params, TLObject } from "./1_tl_object.js";
3
2
  import * as types from "./2_types.js";
4
3
  export class Function extends TLObject {
5
4
  constructor() {
@@ -1,4 +1,3 @@
1
- // Direct port from Pyrogram
2
1
  import { base64DecodeUrlSafe, base64EncodeUrlSafe, rleDecode, rleEncode, UNREACHABLE } from "../1_utilities.js";
3
2
  import { TLReader, TLWriter } from "../2_tl.js";
4
3
  export var FileType;
@@ -0,0 +1,4 @@
1
+ export interface BotCommand {
2
+ command: string;
3
+ description: string;
4
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * A chat identifier as provided by MTKruto or a string starting with a @ that is followed by a username.
3
+ */
4
+ export type ChatID = number | string;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,5 @@
1
1
  import { types } from "../2_tl.js";
2
- import { FileID, FileType, FileUniqueID, FileUniqueType, ThumbnailSource } from "./!0_file_id.js";
2
+ import { FileID, FileType, FileUniqueID, FileUniqueType, ThumbnailSource } from "./0__file_id.js";
3
3
  export function constructChatPhoto(photo, chatId, chatAccessHash) {
4
4
  const smallFileId = new FileID(null, null, FileType.ChatPhoto, photo.dcId, {
5
5
  mediaId: photo.photoId,
@@ -0,0 +1,6 @@
1
+ export interface InputContactMessageContent {
2
+ phoneNumber: string;
3
+ firstName: string;
4
+ lastName?: string;
5
+ vcard?: string;
6
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ export interface InputLocationMessageContent {
2
+ latitude: number;
3
+ longitude: number;
4
+ horizontalAccuracy?: number;
5
+ livePeriod?: number;
6
+ heading?: number;
7
+ proximityAlertRadius?: number;
8
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,10 @@
1
+ export interface InputVenuMessageContent {
2
+ latitude: number;
3
+ loingitude: number;
4
+ title: string;
5
+ address: string;
6
+ foursquareId?: string;
7
+ foursquareType?: string;
8
+ googlePlaceId?: string;
9
+ googlePlaceType?: string;
10
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ export interface LabeledPrice {
2
+ label: string;
3
+ amount: number;
4
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export type ParseMode = "HTML" | null;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,5 @@
1
1
  import { types } from "../2_tl.js";
2
- import { FileID, FileType, FileUniqueID, FileUniqueType, ThumbnailSource } from "./!0_file_id.js";
2
+ import { FileID, FileType, FileUniqueID, FileUniqueType, ThumbnailSource } from "./0__file_id.js";
3
3
  export function constructThumbnail(size, file) {
4
4
  const fileType = file instanceof types.Photo ? FileType.Photo : FileType.Document;
5
5
  const fileId = new FileID(null, null, fileType, file.dcId, {
@@ -1,7 +1,14 @@
1
1
  import { MaybePromise } from "../1_utilities.js";
2
2
  import { types } from "../2_tl.js";
3
+ import { ChatID } from "./0_chat_id.js";
3
4
  export interface EntityGetter {
4
5
  (peer: types.PeerUser): MaybePromise<types.User | null>;
5
6
  (peer: types.PeerChat): MaybePromise<types.Chat | null>;
6
7
  (peer: types.PeerChannel): MaybePromise<types.Channel | null>;
7
8
  }
9
+ export interface InputPeerGetter {
10
+ (id: ChatID): Promise<types.InputPeerUser | types.InputPeerChannel | types.InputPeerChat>;
11
+ }
12
+ export interface UsernameResolver {
13
+ (username: string): MaybePromise<types.InputUser>;
14
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,32 @@
1
+ import { types } from "../2_tl.js";
2
+ import { ChatID } from "./0_chat_id.js";
3
+ import { InputPeerGetter } from "./1__getters.js";
4
+ export declare namespace BotCommandScope {
5
+ interface Default {
6
+ type: "default";
7
+ }
8
+ interface AllPrivateChats {
9
+ type: "allPrivateChats";
10
+ }
11
+ interface AllGroupChats {
12
+ type: "allGroupChats";
13
+ }
14
+ interface AllChatAdministrators {
15
+ type: "allChatAdministrators";
16
+ }
17
+ interface Chat {
18
+ type: "chat";
19
+ chatId: ChatID;
20
+ }
21
+ interface ChatAdministrators {
22
+ type: "chatAdministrators";
23
+ chatId: ChatID;
24
+ }
25
+ interface ChatMember {
26
+ type: "chatMember";
27
+ chatId: ChatID;
28
+ userId: number;
29
+ }
30
+ }
31
+ export type BotCommandScope = BotCommandScope.Default | BotCommandScope.AllPrivateChats | BotCommandScope.AllGroupChats | BotCommandScope.AllChatAdministrators | BotCommandScope.Chat | BotCommandScope.ChatAdministrators | BotCommandScope.ChatMember;
32
+ export declare function botCommandScopeToTlObject(scope: BotCommandScope, getInputPeer: InputPeerGetter): Promise<types.BotCommandScopeDefault | types.BotCommandScopeUsers | types.BotCommandScopeChats | types.BotCommandScopeChatAdmins | types.BotCommandScopePeer | types.BotCommandScopePeerAdmins | types.BotCommandScopePeerUser>;
@@ -0,0 +1,27 @@
1
+ import { UNREACHABLE } from "../1_utilities.js";
2
+ import { types } from "../2_tl.js";
3
+ export async function botCommandScopeToTlObject(scope, getInputPeer) {
4
+ switch (scope.type) {
5
+ case "default":
6
+ return new types.BotCommandScopeDefault();
7
+ case "allPrivateChats":
8
+ return new types.BotCommandScopeUsers();
9
+ case "allGroupChats":
10
+ return new types.BotCommandScopeChats();
11
+ case "allChatAdministrators":
12
+ return new types.BotCommandScopeChatAdmins();
13
+ case "chat":
14
+ return new types.BotCommandScopePeer({ peer: await getInputPeer(scope.chatId) });
15
+ case "chatAdministrators":
16
+ return new types.BotCommandScopePeerAdmins({ peer: await getInputPeer(scope.chatId) });
17
+ case "chatMember": {
18
+ const user = await getInputPeer(scope.userId);
19
+ if (!(user instanceof types.InputPeerUser)) {
20
+ UNREACHABLE();
21
+ }
22
+ return new types.BotCommandScopePeerUser({ peer: await getInputPeer(scope.chatId), userId: new types.InputUser({ userId: user.userId, accessHash: user.accessHash }) });
23
+ }
24
+ default:
25
+ UNREACHABLE();
26
+ }
27
+ }
@@ -1,6 +1,6 @@
1
1
  import { types } from "../2_tl.js";
2
- import { Color } from "./0_color.js";
3
2
  import { ChatPhoto } from "./0_chat_photo.js";
3
+ import { Color } from "./0_color.js";
4
4
  export type ChatType = "private" | "group" | "supergroup" | "channel";
5
5
  export declare namespace Chat {
6
6
  interface Base {
@@ -1,8 +1,8 @@
1
1
  import { cleanObject, UNREACHABLE } from "../1_utilities.js";
2
2
  import { types } from "../2_tl.js";
3
3
  import { ZERO_CHANNEL_ID } from "../4_constants.js";
4
- import { getColor } from "./0_color.js";
5
4
  import { constructChatPhoto } from "./0_chat_photo.js";
5
+ import { getColor } from "./0_color.js";
6
6
  export function constructChat(chat) {
7
7
  if (chat instanceof types.User) {
8
8
  const id = Number(chat.id);
@@ -0,0 +1,6 @@
1
+ import { WebAppInfo } from "./0_web_app_info.js";
2
+ export interface InlineQueryResultButton {
3
+ text: string;
4
+ webApp?: WebAppInfo;
5
+ startParameter?: string;
6
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,23 @@
1
+ import { LabeledPrice } from "../tl/2_types.js";
2
+ export interface InputInvoiceMessageContent {
3
+ title: string;
4
+ description: string;
5
+ payload: string;
6
+ providerToken: string;
7
+ currency: string;
8
+ prices: LabeledPrice[];
9
+ maxTipAmount?: number;
10
+ suggestedTipAmounts?: number[];
11
+ providerData?: string;
12
+ photoUrl?: string;
13
+ photoSize?: number;
14
+ photoWidth?: number;
15
+ photoHeight?: number;
16
+ needName?: boolean;
17
+ needPhoneNumber?: boolean;
18
+ needEmail?: boolean;
19
+ needShippingAAddress?: boolean;
20
+ sendPhoneNumberToPorvider?: boolean;
21
+ sendEmailToProvider?: boolean;
22
+ isFlexible?: boolean;
23
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ import { MessageEntity } from "./0_message_entity.js";
2
+ import { ParseMode } from "./0_parse_mode.js";
3
+ export interface InputTextMessageContent {
4
+ messageText: string;
5
+ parseMode?: ParseMode;
6
+ entities?: MessageEntity[];
7
+ disableWebPagePreview?: boolean;
8
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,5 @@
1
1
  import { types } from "../2_tl.js";
2
- import { FileID, FileType, FileUniqueID, FileUniqueType, ThumbnailSource } from "./!0_file_id.js";
2
+ import { FileID, FileType, FileUniqueID, FileUniqueType, ThumbnailSource } from "./0__file_id.js";
3
3
  import { constructThumbnail } from "./0_thumbnail.js";
4
4
  export function constructPhoto(photo) {
5
5
  const sizes = photo.sizes
@@ -1,7 +1,7 @@
1
1
  import { MaybePromise } from "../1_utilities.js";
2
2
  import { types } from "../2_tl.js";
3
- import { Thumbnail } from "./0_thumbnail.js";
4
3
  import { MaskPosition } from "./0_mask_position.js";
4
+ import { Thumbnail } from "./0_thumbnail.js";
5
5
  /** This object represents a sticker. */
6
6
  export interface Sticker {
7
7
  /** Identifier for this file, which can be used to download or reuse the file */
@@ -1,6 +1,6 @@
1
1
  import { as, types } from "../2_tl.js";
2
- import { constructThumbnail } from "./0_thumbnail.js";
3
2
  import { constructMaskPosition } from "./0_mask_position.js";
3
+ import { constructThumbnail } from "./0_thumbnail.js";
4
4
  export async function constructSticker(document, fileId, fileUniqueId, getStickerSetName) {
5
5
  const stickerAttribute = document.attributes.find((v) => v instanceof types.DocumentAttributeSticker);
6
6
  const imageSizeAttribute = document.attributes.find((v) => v instanceof types.DocumentAttributeImageSize);
@@ -1,6 +1,6 @@
1
1
  import { types } from "../2_tl.js";
2
- import { Color } from "./0_color.js";
3
2
  import { ChatPhoto } from "./0_chat_photo.js";
3
+ import { Color } from "./0_color.js";
4
4
  /** This object represents a Telegram user or bot. */
5
5
  export interface User {
6
6
  /** Unique identifier for this user or bot */
@@ -1,7 +1,7 @@
1
1
  import { cleanObject } from "../1_utilities.js";
2
2
  import { types } from "../2_tl.js";
3
- import { getColor } from "./0_color.js";
4
3
  import { constructChatPhoto } from "./0_chat_photo.js";
4
+ import { getColor } from "./0_color.js";
5
5
  export function constructUser(user_) {
6
6
  const id = Number(user_.id);
7
7
  const user = {
@@ -1,6 +1,6 @@
1
1
  import { cleanObject } from "../1_utilities.js";
2
2
  import { as, types } from "../2_tl.js";
3
- import { FileID, FileType, FileUniqueID, FileUniqueType } from "./!0_file_id.js";
3
+ import { FileID, FileType, FileUniqueID, FileUniqueType } from "./0__file_id.js";
4
4
  import { constructAnimation } from "./1_animation.js";
5
5
  import { constructPhoto } from "./1_photo.js";
6
6
  export function constructGame(media_) {
@@ -1,7 +1,7 @@
1
- import { MaybePromise } from "../1_utilities.js";
2
1
  import { types } from "../2_tl.js";
3
- import { WebAppInfo } from "./0_web_app_info.js";
4
2
  import { LoginUrl } from "./0_login_url.js";
3
+ import { WebAppInfo } from "./0_web_app_info.js";
4
+ import { UsernameResolver } from "./1__getters.js";
5
5
  export declare namespace InlineKeyboardButton {
6
6
  interface Base {
7
7
  /** Label text on the button */
@@ -42,4 +42,4 @@ export declare namespace InlineKeyboardButton {
42
42
  /** This object represents one button of an inline keyboard. You **must** use exactly one of the optional fields. */
43
43
  export type InlineKeyboardButton = InlineKeyboardButton.URL | InlineKeyboardButton.Callback | InlineKeyboardButton.WebApp | InlineKeyboardButton.Login | InlineKeyboardButton.SwitchInline | InlineKeyboardButton.SwitchInlineCurrent | InlineKeyboardButton.Game | InlineKeyboardButton.Pay;
44
44
  export declare function constructInlineKeyboardButton(button_: types.TypeKeyboardButton): InlineKeyboardButton;
45
- export declare function inlineKeyboardButtonToTlObject(button: InlineKeyboardButton, usernameResolver: (username: string) => MaybePromise<types.InputUser>): Promise<types.KeyboardButtonURL | types.KeyboardButtonCallback | types.KeyboardButtonSwitchInline | types.KeyboardButtonBuy | types.InputKeyboardButtonURLAuth | types.KeyboardButtonWebView>;
45
+ export declare function inlineKeyboardButtonToTlObject(button: InlineKeyboardButton, usernameResolver: UsernameResolver): Promise<types.KeyboardButtonURL | types.KeyboardButtonCallback | types.KeyboardButtonSwitchInline | types.KeyboardButtonBuy | types.InputKeyboardButtonURLAuth | types.KeyboardButtonWebView>;
@@ -1,6 +1,6 @@
1
1
  import { types } from "../2_tl.js";
2
- import { EntityGetter } from "./!0_misc.js";
3
2
  import { Location } from "./0_location.js";
3
+ import { EntityGetter } from "./1__getters.js";
4
4
  import { User } from "./1_user.js";
5
5
  export interface InlineQuery {
6
6
  /** Unique identifier for this query */
@@ -0,0 +1,6 @@
1
+ import { InputContactMessageContent } from "./0_input_contact_message_content.js";
2
+ import { InputLocationMessageContent } from "./0_input_location_message_content.js";
3
+ import { InputVenuMessageContent } from "./0_input_venue_message_content.js";
4
+ import { InputInvoiceMessageContent } from "./1_input_invoice_message_content.js";
5
+ import { InputTextMessageContent } from "./1_input_text_message_content.js";
6
+ export type InputMessageContent = InputTextMessageContent | InputLocationMessageContent | InputVenuMessageContent | InputContactMessageContent | InputInvoiceMessageContent;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,9 +1,10 @@
1
1
  import { types } from "../2_tl.js";
2
- import { InlineKeyboardButton, inlineKeyboardButtonToTlObject } from "./1_inline_keyboard_button.js";
2
+ import { UsernameResolver } from "./1__getters.js";
3
+ import { InlineKeyboardButton } from "./2_inline_keyboard_button.js";
3
4
  /** This object represents an inline keyboard that appears right next to the message it belongs to. */
4
5
  export interface InlineKeyboardMarkup {
5
6
  /** Array of button rows, each represented by an Array of InlineKeyboardButton objects */
6
7
  inlineKeyboard: InlineKeyboardButton[][];
7
8
  }
8
9
  export declare function constructInlineKeyboardMarkup(keyboard_: types.ReplyInlineMarkup): InlineKeyboardMarkup;
9
- export declare function inlineKeyboardMarkupToTlObject(keyboard: InlineKeyboardMarkup, usernameResolver: Parameters<typeof inlineKeyboardButtonToTlObject>[1]): Promise<types.ReplyInlineMarkup>;
10
+ export declare function inlineKeyboardMarkupToTlObject(keyboard: InlineKeyboardMarkup, usernameResolver: UsernameResolver): Promise<types.ReplyInlineMarkup>;
@@ -1,5 +1,5 @@
1
1
  import { types } from "../2_tl.js";
2
- import { constructInlineKeyboardButton, inlineKeyboardButtonToTlObject } from "./1_inline_keyboard_button.js";
2
+ import { constructInlineKeyboardButton, inlineKeyboardButtonToTlObject } from "./2_inline_keyboard_button.js";
3
3
  export function constructInlineKeyboardMarkup(keyboard_) {
4
4
  const rows = new Array();
5
5
  for (const row_ of keyboard_.rows) {
@@ -1,27 +1,27 @@
1
1
  import { MaybePromise } from "../1_utilities.js";
2
2
  import { types } from "../2_tl.js";
3
- import { EntityGetter } from "./!0_misc.js";
4
- import { ForceReply } from "./0_force_reply.js";
5
- import { MessageEntity } from "./0_message_entity.js";
6
3
  import { Audio } from "./0_audio.js";
7
4
  import { Contact } from "./0_contact.js";
8
- import { Voice } from "./0_voice.js";
9
- import { Venue } from "./0_venue.js";
10
- import { Location } from "./0_location.js";
11
5
  import { Dice } from "./0_dice.js";
6
+ import { ForceReply } from "./0_force_reply.js";
7
+ import { Location } from "./0_location.js";
8
+ import { MessageEntity } from "./0_message_entity.js";
12
9
  import { ReplyKeyboardRemove } from "./0_reply_keyboard_remove.js";
10
+ import { Venue } from "./0_venue.js";
11
+ import { Voice } from "./0_voice.js";
12
+ import { EntityGetter } from "./1__getters.js";
13
+ import { Animation } from "./1_animation.js";
13
14
  import { Chat } from "./1_chat.js";
14
- import { Photo } from "./1_photo.js";
15
15
  import { Document } from "./1_document.js";
16
- import { Video } from "./1_video.js";
17
- import { VideoNote } from "./1_video_note.js";
18
- import { Animation } from "./1_animation.js";
19
- import { User } from "./1_user.js";
16
+ import { Photo } from "./1_photo.js";
20
17
  import { Poll } from "./1_poll.js";
21
18
  import { Sticker, StickerSetNameGetter } from "./1_sticker.js";
22
- import { InlineKeyboardMarkup } from "./2_inline_keyboard_markup.js";
23
- import { ReplyKeyboardMarkup } from "./2_reply_keyboard_markup.js";
19
+ import { User } from "./1_user.js";
20
+ import { VideoNote } from "./1_video_note.js";
21
+ import { Video } from "./1_video.js";
24
22
  import { Game } from "./2_game.js";
23
+ import { ReplyKeyboardMarkup } from "./2_reply_keyboard_markup.js";
24
+ import { InlineKeyboardMarkup } from "./3_inline_keyboard_markup.js";
25
25
  /** This object represents a message. */
26
26
  export interface Message {
27
27
  /** Whether the message is outgoing */
@@ -2,28 +2,28 @@ import { debug } from "../0_deps.js";
2
2
  import { cleanObject, UNREACHABLE } from "../1_utilities.js";
3
3
  import { as, types } from "../2_tl.js";
4
4
  import { ZERO_CHANNEL_ID } from "../4_constants.js";
5
- import { FileID, FileType, FileUniqueID, FileUniqueType } from "./!0_file_id.js";
6
- import { constructForceReply } from "./0_force_reply.js";
7
- import { constructMessageEntity } from "./0_message_entity.js";
5
+ import { FileID, FileType, FileUniqueID, FileUniqueType } from "./0__file_id.js";
8
6
  import { constructAudio } from "./0_audio.js";
9
7
  import { constructContact } from "./0_contact.js";
10
- import { constructVoice } from "./0_voice.js";
11
- import { constructVenue } from "./0_venue.js";
12
- import { constructLocation } from "./0_location.js";
13
8
  import { constructDice } from "./0_dice.js";
9
+ import { constructForceReply } from "./0_force_reply.js";
10
+ import { constructLocation } from "./0_location.js";
11
+ import { constructMessageEntity } from "./0_message_entity.js";
14
12
  import { constructReplyKeyboardRemove } from "./0_reply_keyboard_remove.js";
13
+ import { constructVenue } from "./0_venue.js";
14
+ import { constructVoice } from "./0_voice.js";
15
+ import { constructAnimation } from "./1_animation.js";
15
16
  import { constructChat } from "./1_chat.js";
16
- import { constructPhoto } from "./1_photo.js";
17
17
  import { constructDocument } from "./1_document.js";
18
- import { constructVideo } from "./1_video.js";
19
- import { constructVideoNote } from "./1_video_note.js";
20
- import { constructAnimation } from "./1_animation.js";
21
- import { constructUser } from "./1_user.js";
18
+ import { constructPhoto } from "./1_photo.js";
22
19
  import { constructPoll } from "./1_poll.js";
23
20
  import { constructSticker } from "./1_sticker.js";
24
- import { constructInlineKeyboardMarkup } from "./2_inline_keyboard_markup.js";
25
- import { constructReplyKeyboardMarkup } from "./2_reply_keyboard_markup.js";
21
+ import { constructUser } from "./1_user.js";
22
+ import { constructVideoNote } from "./1_video_note.js";
23
+ import { constructVideo } from "./1_video.js";
26
24
  import { constructGame } from "./2_game.js";
25
+ import { constructReplyKeyboardMarkup } from "./2_reply_keyboard_markup.js";
26
+ import { constructInlineKeyboardMarkup } from "./3_inline_keyboard_markup.js";
27
27
  const d = debug("types/Message");
28
28
  async function getSender(message_, getEntity) {
29
29
  if (message_.fromId instanceof types.PeerUser) {
@@ -1,5 +1,5 @@
1
1
  import { types } from "../2_tl.js";
2
- import { EntityGetter } from "./!0_misc.js";
2
+ import { EntityGetter } from "./1__getters.js";
3
3
  import { User } from "./1_user.js";
4
4
  import { Message, MessageGetter } from "./3_message.js";
5
5
  export interface CallbackQuery {
@@ -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 InlineQueryResultArticle {
4
+ type: "article";
5
+ id: string;
6
+ title: string;
7
+ inputMessageContent: InputMessageContent;
8
+ replyMarkup?: InlineKeyboardMarkup;
9
+ url?: string;
10
+ hideUrl?: boolean;
11
+ description?: string;
12
+ thumbnailUrl?: string;
13
+ thumbnailWidth?: string;
14
+ thumbnailHeight?: string;
15
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,17 @@
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 InlineQueryResultAudio {
6
+ type: "audio";
7
+ id: string;
8
+ audioUrl: string;
9
+ title: string;
10
+ caption?: string;
11
+ parseMode?: ParseMode;
12
+ captionEntities?: MessageEntity[];
13
+ performer?: string;
14
+ audioDuration?: number;
15
+ replyMarkup?: InlineKeyboardMarkup;
16
+ inputMessageContent?: InputMessageContent;
17
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,14 @@
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 InlineQueryResultCachedAudio {
6
+ type: "audio";
7
+ id: string;
8
+ audioFileId: string;
9
+ caption?: string;
10
+ parseMode?: ParseMode;
11
+ captionEntities?: MessageEntity[];
12
+ replyMarkup?: InlineKeyboardMarkup;
13
+ inputMessageContent?: InputMessageContent;
14
+ }
@@ -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 InlineQueryResultCachedDocument {
6
+ type: "document";
7
+ id: string;
8
+ documentFileId: string;
9
+ description?: 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 { 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 InlineQueryResultCachedGif {
6
+ type: "gif";
7
+ id: string;
8
+ gifFileId: 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 {};