@mtkruto/node 0.1.138 → 0.1.140

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 (287) hide show
  1. package/esm/3_types.d.ts +10 -36
  2. package/esm/3_types.js +10 -36
  3. package/esm/4_constants.d.ts +1 -1
  4. package/esm/4_constants.js +1 -1
  5. package/esm/5_client.d.ts +1 -1
  6. package/esm/5_client.js +1 -1
  7. package/esm/_dnt.polyfills.d.ts +6 -0
  8. package/esm/client/0_filters.d.ts +60 -0
  9. package/esm/client/0_filters.js +27 -0
  10. package/esm/client/0_message.js +2 -2
  11. package/esm/client/{3_params.d.ts → 0_params.d.ts} +30 -33
  12. package/esm/client/0_types.d.ts +39 -0
  13. package/esm/client/0_types.js +2 -0
  14. package/esm/client/0_utilities.d.ts +1 -47
  15. package/esm/client/0_utilities.js +0 -27
  16. package/esm/client/1_composer.d.ts +1 -1
  17. package/esm/client/1_composer.js +1 -1
  18. package/esm/client/1_file_manager.d.ts +10 -0
  19. package/esm/client/1_file_manager.js +241 -0
  20. package/esm/client/1_update_manager.d.ts +18 -0
  21. package/esm/client/1_update_manager.js +553 -0
  22. package/esm/client/2_message_manager.d.ts +40 -0
  23. package/esm/client/2_message_manager.js +621 -0
  24. package/esm/client/3_chat_list_manager.d.ts +21 -0
  25. package/esm/client/3_chat_list_manager.js +353 -0
  26. package/esm/client/3_reaction_manager.d.ts +16 -0
  27. package/esm/client/3_reaction_manager.js +61 -0
  28. package/esm/client/4_client.d.ts +187 -60
  29. package/esm/client/4_client.js +492 -1699
  30. package/esm/connection/1_connection_web_socket.js +6 -6
  31. package/esm/deps/raw.githubusercontent.com/MTKruto/debug/main/deps.d.ts +1 -1
  32. package/esm/deps/raw.githubusercontent.com/MTKruto/debug/main/deps.js +1 -1
  33. package/esm/deps/raw.githubusercontent.com/MTKruto/object-inspect/main/index.d.ts +1 -0
  34. package/esm/deps/raw.githubusercontent.com/MTKruto/object-inspect/main/index.js +524 -0
  35. package/esm/mod.d.ts +1 -0
  36. package/esm/mod.js +1 -0
  37. package/esm/storage/0_storage.d.ts +5 -3
  38. package/esm/storage/0_storage.js +14 -4
  39. package/esm/tl/1_tl_object.d.ts +1 -0
  40. package/esm/tl/1_tl_object.js +24 -0
  41. package/esm/types/0_bot_command.d.ts +1 -0
  42. package/esm/types/0_chat_member_rights.d.ts +37 -0
  43. package/esm/types/0_chat_photo.d.ts +4 -4
  44. package/esm/types/0_file_source.d.ts +5 -0
  45. package/esm/types/0_giveaway_parameters.js +2 -1
  46. package/esm/types/0_id.d.ts +4 -0
  47. package/esm/types/0_message_entity.d.ts +20 -20
  48. package/esm/types/1__getters.d.ts +2 -2
  49. package/esm/types/1_animation.d.ts +1 -1
  50. package/esm/types/1_bot_command_scope.d.ts +5 -4
  51. package/esm/types/1_chat_p.d.ts +5 -6
  52. package/esm/types/1_document.d.ts +1 -0
  53. package/esm/types/1_input_message_content.d.ts +88 -0
  54. package/esm/types/1_photo.d.ts +1 -1
  55. package/esm/types/1_sticker.d.ts +1 -1
  56. package/esm/types/1_user.d.ts +1 -1
  57. package/esm/types/1_video.d.ts +1 -1
  58. package/esm/types/1_video_note.d.ts +1 -1
  59. package/esm/types/2_inline_keyboard_button.d.ts +10 -10
  60. package/esm/types/2_message_reaction_count.d.ts +3 -0
  61. package/esm/types/2_message_reaction_count.js +17 -1
  62. package/esm/types/2_message_reactions.d.ts +15 -0
  63. package/esm/types/2_message_reactions.js +37 -0
  64. package/esm/types/3_reply_markup.d.ts +42 -0
  65. package/esm/types/3_reply_markup.js +117 -0
  66. package/esm/types/4_inline_query_result.d.ts +193 -0
  67. package/esm/types/{5_inline_query_result.js → 4_inline_query_result.js} +2 -2
  68. package/esm/types/4_message.d.ts +36 -39
  69. package/esm/types/4_message.js +7 -24
  70. package/esm/types/5_callback_query.d.ts +2 -1
  71. package/esm/types/5_chat.d.ts +8 -5
  72. package/esm/types/6_update.d.ts +12 -2
  73. package/esm/utilities/0_buffer.js +9 -6
  74. package/esm/utilities/0_object.d.ts +1 -1
  75. package/esm/utilities/0_object.js +1 -6
  76. package/esm/utilities/1_misc.d.ts +2 -0
  77. package/esm/utilities/1_misc.js +6 -0
  78. package/package.json +1 -2
  79. package/script/3_types.d.ts +10 -36
  80. package/script/3_types.js +10 -36
  81. package/script/4_constants.d.ts +1 -1
  82. package/script/4_constants.js +1 -1
  83. package/script/5_client.d.ts +1 -1
  84. package/script/5_client.js +1 -1
  85. package/script/_dnt.polyfills.d.ts +6 -0
  86. package/script/client/0_filters.d.ts +60 -0
  87. package/script/client/0_filters.js +31 -0
  88. package/script/client/0_message.js +1 -1
  89. package/script/client/{3_params.d.ts → 0_params.d.ts} +30 -33
  90. package/script/client/0_types.d.ts +39 -0
  91. package/script/client/0_types.js +6 -0
  92. package/script/client/0_utilities.d.ts +1 -47
  93. package/script/client/0_utilities.js +1 -29
  94. package/script/client/1_composer.d.ts +1 -1
  95. package/script/client/1_composer.js +2 -2
  96. package/script/client/1_file_manager.d.ts +10 -0
  97. package/script/client/1_file_manager.js +245 -0
  98. package/script/client/1_update_manager.d.ts +18 -0
  99. package/script/client/1_update_manager.js +557 -0
  100. package/script/client/2_message_manager.d.ts +40 -0
  101. package/script/client/2_message_manager.js +625 -0
  102. package/script/client/3_chat_list_manager.d.ts +21 -0
  103. package/script/client/3_chat_list_manager.js +357 -0
  104. package/script/client/3_reaction_manager.d.ts +16 -0
  105. package/script/client/3_reaction_manager.js +65 -0
  106. package/script/client/4_client.d.ts +187 -60
  107. package/script/client/4_client.js +491 -1699
  108. package/script/connection/1_connection_web_socket.js +5 -5
  109. package/script/deps/raw.githubusercontent.com/MTKruto/debug/main/deps.d.ts +1 -1
  110. package/script/deps/raw.githubusercontent.com/MTKruto/debug/main/deps.js +2 -2
  111. package/script/deps/raw.githubusercontent.com/MTKruto/object-inspect/main/index.d.ts +1 -0
  112. package/script/deps/raw.githubusercontent.com/MTKruto/object-inspect/main/index.js +550 -0
  113. package/script/mod.d.ts +1 -0
  114. package/script/mod.js +1 -0
  115. package/script/storage/0_storage.d.ts +5 -3
  116. package/script/storage/0_storage.js +14 -4
  117. package/script/tl/1_tl_object.d.ts +1 -0
  118. package/script/tl/1_tl_object.js +24 -0
  119. package/script/types/0_bot_command.d.ts +1 -0
  120. package/script/types/0_chat_member_rights.d.ts +37 -0
  121. package/script/types/0_chat_photo.d.ts +4 -4
  122. package/script/types/0_file_source.d.ts +5 -0
  123. package/script/types/0_giveaway_parameters.js +2 -1
  124. package/script/types/0_id.d.ts +4 -0
  125. package/script/types/0_message_entity.d.ts +20 -20
  126. package/script/types/1__getters.d.ts +2 -2
  127. package/script/types/1_animation.d.ts +1 -1
  128. package/script/types/1_bot_command_scope.d.ts +5 -4
  129. package/script/types/1_chat_p.d.ts +5 -6
  130. package/script/types/1_document.d.ts +1 -0
  131. package/script/types/1_input_message_content.d.ts +88 -0
  132. package/script/types/1_photo.d.ts +1 -1
  133. package/script/types/1_sticker.d.ts +1 -1
  134. package/script/types/1_user.d.ts +1 -1
  135. package/script/types/1_video.d.ts +1 -1
  136. package/script/types/1_video_note.d.ts +1 -1
  137. package/script/types/2_inline_keyboard_button.d.ts +10 -10
  138. package/script/types/2_message_reaction_count.d.ts +3 -0
  139. package/script/types/2_message_reaction_count.js +19 -0
  140. package/script/types/2_message_reactions.d.ts +15 -0
  141. package/script/types/2_message_reactions.js +41 -0
  142. package/script/types/3_reply_markup.d.ts +42 -0
  143. package/script/types/3_reply_markup.js +122 -0
  144. package/script/types/4_inline_query_result.d.ts +193 -0
  145. package/script/types/{5_inline_query_result.js → 4_inline_query_result.js} +3 -3
  146. package/script/types/4_message.d.ts +36 -39
  147. package/script/types/4_message.js +6 -23
  148. package/script/types/5_callback_query.d.ts +2 -1
  149. package/script/types/5_chat.d.ts +8 -5
  150. package/script/types/6_update.d.ts +12 -2
  151. package/script/utilities/0_buffer.js +9 -6
  152. package/script/utilities/0_object.d.ts +1 -1
  153. package/script/utilities/0_object.js +1 -6
  154. package/script/utilities/1_misc.d.ts +2 -0
  155. package/script/utilities/1_misc.js +9 -1
  156. package/esm/types/0_chat_id.d.ts +0 -4
  157. package/esm/types/0_force_reply.d.ts +0 -12
  158. package/esm/types/0_force_reply.js +0 -17
  159. package/esm/types/0_input_contact_message_content.d.ts +0 -11
  160. package/esm/types/0_input_location_message_content.d.ts +0 -15
  161. package/esm/types/0_input_venue_message_content.d.ts +0 -19
  162. package/esm/types/0_reply_keyboard_remove.d.ts +0 -10
  163. package/esm/types/0_reply_keyboard_remove.js +0 -8
  164. package/esm/types/1_input_invoice_message_content.d.ts +0 -23
  165. package/esm/types/1_input_text_message_content.d.ts +0 -8
  166. package/esm/types/1_input_text_message_content.js +0 -1
  167. package/esm/types/2_input_message_content.d.ts +0 -6
  168. package/esm/types/2_input_message_content.js +0 -1
  169. package/esm/types/2_reply_keyboard_markup.d.ts +0 -12
  170. package/esm/types/2_reply_keyboard_markup.js +0 -37
  171. package/esm/types/3_inline_keyboard_markup.d.ts +0 -8
  172. package/esm/types/3_inline_keyboard_markup.js +0 -24
  173. package/esm/types/4_inline_query_result_article.d.ts +0 -15
  174. package/esm/types/4_inline_query_result_article.js +0 -1
  175. package/esm/types/4_inline_query_result_audio.d.ts +0 -17
  176. package/esm/types/4_inline_query_result_audio.js +0 -1
  177. package/esm/types/4_inline_query_result_cached_audio.d.ts +0 -14
  178. package/esm/types/4_inline_query_result_cached_audio.js +0 -1
  179. package/esm/types/4_inline_query_result_cached_document.d.ts +0 -15
  180. package/esm/types/4_inline_query_result_cached_document.js +0 -1
  181. package/esm/types/4_inline_query_result_cached_gif.d.ts +0 -15
  182. package/esm/types/4_inline_query_result_cached_gif.js +0 -1
  183. package/esm/types/4_inline_query_result_cached_mpeg4_gif.d.ts +0 -15
  184. package/esm/types/4_inline_query_result_cached_mpeg4_gif.js +0 -1
  185. package/esm/types/4_inline_query_result_cached_photo.d.ts +0 -16
  186. package/esm/types/4_inline_query_result_cached_photo.js +0 -1
  187. package/esm/types/4_inline_query_result_cached_sticker.d.ts +0 -9
  188. package/esm/types/4_inline_query_result_cached_sticker.js +0 -1
  189. package/esm/types/4_inline_query_result_cached_video.d.ts +0 -16
  190. package/esm/types/4_inline_query_result_cached_video.js +0 -1
  191. package/esm/types/4_inline_query_result_cached_voice.d.ts +0 -15
  192. package/esm/types/4_inline_query_result_cached_voice.js +0 -1
  193. package/esm/types/4_inline_query_result_contact.d.ts +0 -15
  194. package/esm/types/4_inline_query_result_contact.js +0 -1
  195. package/esm/types/4_inline_query_result_document.d.ts +0 -18
  196. package/esm/types/4_inline_query_result_document.js +0 -1
  197. package/esm/types/4_inline_query_result_game.d.ts +0 -7
  198. package/esm/types/4_inline_query_result_game.js +0 -1
  199. package/esm/types/4_inline_query_result_gif.d.ts +0 -20
  200. package/esm/types/4_inline_query_result_gif.js +0 -1
  201. package/esm/types/4_inline_query_result_location.d.ts +0 -18
  202. package/esm/types/4_inline_query_result_location.js +0 -1
  203. package/esm/types/4_inline_query_result_mpeg4_gif.d.ts +0 -20
  204. package/esm/types/4_inline_query_result_mpeg4_gif.js +0 -1
  205. package/esm/types/4_inline_query_result_photo.d.ts +0 -19
  206. package/esm/types/4_inline_query_result_photo.js +0 -1
  207. package/esm/types/4_inline_query_result_venue.d.ts +0 -19
  208. package/esm/types/4_inline_query_result_venue.js +0 -1
  209. package/esm/types/4_inline_query_result_video.d.ts +0 -21
  210. package/esm/types/4_inline_query_result_video.js +0 -1
  211. package/esm/types/4_inline_query_result_voice.d.ts +0 -16
  212. package/esm/types/4_inline_query_result_voice.js +0 -1
  213. package/esm/types/4_reply_markup.d.ts +0 -7
  214. package/esm/types/4_reply_markup.js +0 -22
  215. package/esm/types/5_inline_query_result.d.ts +0 -28
  216. package/script/types/0_chat_id.d.ts +0 -4
  217. package/script/types/0_force_reply.d.ts +0 -12
  218. package/script/types/0_force_reply.js +0 -22
  219. package/script/types/0_input_contact_message_content.d.ts +0 -11
  220. package/script/types/0_input_location_message_content.d.ts +0 -15
  221. package/script/types/0_input_venue_message_content.d.ts +0 -19
  222. package/script/types/0_reply_keyboard_remove.d.ts +0 -10
  223. package/script/types/0_reply_keyboard_remove.js +0 -13
  224. package/script/types/1_input_invoice_message_content.d.ts +0 -23
  225. package/script/types/1_input_text_message_content.d.ts +0 -8
  226. package/script/types/1_input_text_message_content.js +0 -2
  227. package/script/types/2_input_message_content.d.ts +0 -6
  228. package/script/types/2_input_message_content.js +0 -2
  229. package/script/types/2_reply_keyboard_markup.d.ts +0 -12
  230. package/script/types/2_reply_keyboard_markup.js +0 -42
  231. package/script/types/3_inline_keyboard_markup.d.ts +0 -8
  232. package/script/types/3_inline_keyboard_markup.js +0 -29
  233. package/script/types/4_inline_query_result_article.d.ts +0 -15
  234. package/script/types/4_inline_query_result_article.js +0 -2
  235. package/script/types/4_inline_query_result_audio.d.ts +0 -17
  236. package/script/types/4_inline_query_result_audio.js +0 -2
  237. package/script/types/4_inline_query_result_cached_audio.d.ts +0 -14
  238. package/script/types/4_inline_query_result_cached_audio.js +0 -2
  239. package/script/types/4_inline_query_result_cached_document.d.ts +0 -15
  240. package/script/types/4_inline_query_result_cached_document.js +0 -2
  241. package/script/types/4_inline_query_result_cached_gif.d.ts +0 -15
  242. package/script/types/4_inline_query_result_cached_gif.js +0 -2
  243. package/script/types/4_inline_query_result_cached_mpeg4_gif.d.ts +0 -15
  244. package/script/types/4_inline_query_result_cached_mpeg4_gif.js +0 -2
  245. package/script/types/4_inline_query_result_cached_photo.d.ts +0 -16
  246. package/script/types/4_inline_query_result_cached_photo.js +0 -2
  247. package/script/types/4_inline_query_result_cached_sticker.d.ts +0 -9
  248. package/script/types/4_inline_query_result_cached_sticker.js +0 -2
  249. package/script/types/4_inline_query_result_cached_video.d.ts +0 -16
  250. package/script/types/4_inline_query_result_cached_video.js +0 -2
  251. package/script/types/4_inline_query_result_cached_voice.d.ts +0 -15
  252. package/script/types/4_inline_query_result_cached_voice.js +0 -2
  253. package/script/types/4_inline_query_result_contact.d.ts +0 -15
  254. package/script/types/4_inline_query_result_contact.js +0 -2
  255. package/script/types/4_inline_query_result_document.d.ts +0 -18
  256. package/script/types/4_inline_query_result_document.js +0 -2
  257. package/script/types/4_inline_query_result_game.d.ts +0 -7
  258. package/script/types/4_inline_query_result_game.js +0 -2
  259. package/script/types/4_inline_query_result_gif.d.ts +0 -20
  260. package/script/types/4_inline_query_result_gif.js +0 -2
  261. package/script/types/4_inline_query_result_location.d.ts +0 -18
  262. package/script/types/4_inline_query_result_location.js +0 -2
  263. package/script/types/4_inline_query_result_mpeg4_gif.d.ts +0 -20
  264. package/script/types/4_inline_query_result_mpeg4_gif.js +0 -2
  265. package/script/types/4_inline_query_result_photo.d.ts +0 -19
  266. package/script/types/4_inline_query_result_photo.js +0 -2
  267. package/script/types/4_inline_query_result_venue.d.ts +0 -19
  268. package/script/types/4_inline_query_result_venue.js +0 -2
  269. package/script/types/4_inline_query_result_video.d.ts +0 -21
  270. package/script/types/4_inline_query_result_video.js +0 -2
  271. package/script/types/4_inline_query_result_voice.d.ts +0 -16
  272. package/script/types/4_inline_query_result_voice.js +0 -2
  273. package/script/types/4_reply_markup.d.ts +0 -7
  274. package/script/types/4_reply_markup.js +0 -26
  275. package/script/types/5_inline_query_result.d.ts +0 -28
  276. /package/esm/{client/3_params.js → _dnt.polyfills.js} +0 -0
  277. /package/esm/{types/0_chat_id.js → client/0_params.js} +0 -0
  278. /package/esm/types/{0_input_contact_message_content.js → 0_chat_member_rights.js} +0 -0
  279. /package/esm/types/{0_input_location_message_content.js → 0_file_source.js} +0 -0
  280. /package/esm/types/{0_input_venue_message_content.js → 0_id.js} +0 -0
  281. /package/esm/types/{1_input_invoice_message_content.js → 1_input_message_content.js} +0 -0
  282. /package/script/{client/3_params.js → _dnt.polyfills.js} +0 -0
  283. /package/script/{types/0_chat_id.js → client/0_params.js} +0 -0
  284. /package/script/types/{0_input_contact_message_content.js → 0_chat_member_rights.js} +0 -0
  285. /package/script/types/{0_input_location_message_content.js → 0_file_source.js} +0 -0
  286. /package/script/types/{0_input_venue_message_content.js → 0_id.js} +0 -0
  287. /package/script/types/{1_input_invoice_message_content.js → 1_input_message_content.js} +0 -0
@@ -0,0 +1,42 @@
1
+ import { enums } from "../2_tl.js";
2
+ import { UsernameResolver } from "./1__getters.js";
3
+ import { KeyboardButton } from "./1_keyboard_button.js";
4
+ import { InlineKeyboardButton } from "./2_inline_keyboard_button.js";
5
+ /** @unlisted */
6
+ export interface ReplyMarkupInlineKeyboard {
7
+ inlineKeyboard: InlineKeyboardButton[][];
8
+ }
9
+ /** @unlisted */
10
+ export interface ReplyMarkupKeyboard {
11
+ keyboard: KeyboardButton[][];
12
+ isPersistent?: boolean;
13
+ resizeKeyboard?: boolean;
14
+ oneTimeKeyboard?: boolean;
15
+ inputFieldPlaceholder?: string;
16
+ selective?: boolean;
17
+ }
18
+ /**
19
+ * Makes the user's client hide the current custom keyboard.
20
+ * @unlisted
21
+ */
22
+ export interface ReplyMarkupRemoveKeyboard {
23
+ /** Differentiate from other reply markup types. */
24
+ removeKeyboard: true;
25
+ /** Whether to only affect specific users. If true, only users that were mentioned will be affected along with the author of the replied message if any. */
26
+ selective?: boolean;
27
+ }
28
+ /**
29
+ * Forces the user's client to select the message as the one that is to be replied.
30
+ * @unlisted
31
+ */
32
+ export interface ReplyMarkupForceReply {
33
+ /** Differentiate from other reply markup types. */
34
+ forceReply: true;
35
+ /** A placeholder to be shown in the client's message box. */
36
+ inputFieldPlaceholder?: string;
37
+ /** Whether to only affect specific users. If true, only users that were mentioned will be affected along with the author of the replied message if any. */
38
+ selective?: boolean;
39
+ }
40
+ export type ReplyMarkup = ReplyMarkupInlineKeyboard | ReplyMarkupKeyboard | ReplyMarkupRemoveKeyboard | ReplyMarkupForceReply;
41
+ export declare function constructReplyMarkup(replyMarkup: enums.ReplyMarkup): ReplyMarkupInlineKeyboard | ReplyMarkupKeyboard | ReplyMarkupRemoveKeyboard | ReplyMarkupForceReply;
42
+ 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,117 @@
1
+ import { cleanObject, UNREACHABLE } from "../1_utilities.js";
2
+ import { types } from "../2_tl.js";
3
+ import { constructKeyboardButton, keyboardButtonToTlObject } from "./1_keyboard_button.js";
4
+ import { constructInlineKeyboardButton, inlineKeyboardButtonToTlObject } from "./2_inline_keyboard_button.js";
5
+ function constructInlineKeyboardMarkup(keyboard_) {
6
+ const rows = new Array();
7
+ for (const row_ of keyboard_.rows) {
8
+ const row = new Array();
9
+ for (const button_ of row_.buttons) {
10
+ row.push(constructInlineKeyboardButton(button_));
11
+ }
12
+ rows.push(row);
13
+ }
14
+ return { inlineKeyboard: rows };
15
+ }
16
+ async function inlineKeyboardMarkupToTlObject(keyboard, usernameResolver) {
17
+ const rows_ = new Array();
18
+ for (const row of keyboard.inlineKeyboard) {
19
+ const row_ = new Array();
20
+ for (const button of row) {
21
+ row_.push(await inlineKeyboardButtonToTlObject(button, usernameResolver));
22
+ }
23
+ rows_.push(new types.KeyboardButtonRow({ buttons: row_ }));
24
+ }
25
+ return new types.ReplyInlineMarkup({ rows: rows_ });
26
+ }
27
+ function constructReplyKeyboardMarkup(keyboard_) {
28
+ const rows = new Array();
29
+ for (const row_ of keyboard_.rows) {
30
+ const row = new Array();
31
+ for (const button_ of row_.buttons) {
32
+ row.push(constructKeyboardButton(button_));
33
+ }
34
+ rows.push(row);
35
+ }
36
+ return {
37
+ resizeKeyboard: keyboard_.resize || false,
38
+ oneTimeKeyboard: keyboard_.single_use || false,
39
+ selective: keyboard_.selective || false,
40
+ isPersistent: keyboard_.persistent || false,
41
+ keyboard: rows,
42
+ };
43
+ }
44
+ function replyKeyboardMarkupToTlObject(replyMarkup) {
45
+ const rows_ = new Array();
46
+ for (const row of replyMarkup.keyboard) {
47
+ const row_ = new Array();
48
+ for (const button of row) {
49
+ row_.push(keyboardButtonToTlObject(button));
50
+ }
51
+ rows_.push(new types.KeyboardButtonRow({ buttons: row_ }));
52
+ }
53
+ return new types.ReplyKeyboardMarkup({
54
+ resize: replyMarkup.resizeKeyboard || undefined,
55
+ single_use: replyMarkup.oneTimeKeyboard || undefined,
56
+ selective: replyMarkup.selective || undefined,
57
+ persistent: replyMarkup.isPersistent || undefined,
58
+ rows: rows_,
59
+ placeholder: replyMarkup.inputFieldPlaceholder,
60
+ });
61
+ }
62
+ function constructReplyKeyboardRemove(replyMarkup_) {
63
+ return cleanObject({ removeKeyboard: true, selective: replyMarkup_.selective });
64
+ }
65
+ function replyKeyboardRemoveToTlObject(replyMarkup) {
66
+ return new types.ReplyKeyboardHide({ selective: replyMarkup.selective || undefined });
67
+ }
68
+ function constructForceReply(replyMarkup_) {
69
+ const replyMarkup = { forceReply: true };
70
+ if (replyMarkup_.placeholder) {
71
+ replyMarkup.inputFieldPlaceholder = replyMarkup_.placeholder;
72
+ }
73
+ if (replyMarkup_.selective) {
74
+ replyMarkup.selective = true;
75
+ }
76
+ return replyMarkup;
77
+ }
78
+ function forceReplyToTlObject(replyMarkup) {
79
+ return new types.ReplyKeyboardForceReply({
80
+ selective: replyMarkup.selective || undefined,
81
+ placeholder: replyMarkup.inputFieldPlaceholder,
82
+ });
83
+ }
84
+ export function constructReplyMarkup(replyMarkup) {
85
+ if (replyMarkup instanceof types.ReplyKeyboardMarkup) {
86
+ return constructReplyKeyboardMarkup(replyMarkup);
87
+ }
88
+ else if (replyMarkup instanceof types.ReplyInlineMarkup) {
89
+ return constructInlineKeyboardMarkup(replyMarkup);
90
+ }
91
+ else if (replyMarkup instanceof types.ReplyKeyboardHide) {
92
+ return constructReplyKeyboardRemove(replyMarkup);
93
+ }
94
+ else if (replyMarkup instanceof types.ReplyKeyboardForceReply) {
95
+ return constructForceReply(replyMarkup);
96
+ }
97
+ else {
98
+ UNREACHABLE();
99
+ }
100
+ }
101
+ export async function replyMarkupToTlObject(replyMarkup, usernameResolver) {
102
+ if ("inlineKeyboard" in replyMarkup) {
103
+ return await inlineKeyboardMarkupToTlObject(replyMarkup, usernameResolver);
104
+ }
105
+ else if ("keyboard" in replyMarkup) {
106
+ return replyKeyboardMarkupToTlObject(replyMarkup);
107
+ }
108
+ else if ("removeKeyboard" in replyMarkup) {
109
+ return replyKeyboardRemoveToTlObject(replyMarkup);
110
+ }
111
+ else if ("forceReply" in replyMarkup) {
112
+ return forceReplyToTlObject(replyMarkup);
113
+ }
114
+ else {
115
+ UNREACHABLE();
116
+ }
117
+ }
@@ -0,0 +1,193 @@
1
+ import { MessageEntity } from "./0_message_entity.js";
2
+ import { ParseMode } from "./0_parse_mode.js";
3
+ import { UsernameResolver } from "./1__getters.js";
4
+ import { InputMessageContent } from "./1_input_message_content.js";
5
+ import { ReplyMarkupInlineKeyboard } from "./3_reply_markup.js";
6
+ /** @unlisted */
7
+ type InlineQueryResultType = "article" | "audio" | "document" | "gif" | "mpeg4Gif" | "photo" | "sticker" | "video" | "voice" | "game" | "location" | "venue";
8
+ /** @unlisted */
9
+ export interface _InlineQueryResultBase {
10
+ type: InlineQueryResultType;
11
+ id: string;
12
+ }
13
+ /** @unlisted */
14
+ export interface _InlineQueryResultCaptionCommon {
15
+ caption?: string;
16
+ parseMode?: ParseMode;
17
+ captionEntities?: MessageEntity[];
18
+ }
19
+ /** @unlisted */
20
+ export interface _InlineQueryResultInputMessageContentReplyMarkupCommon {
21
+ inputMessageContent?: InputMessageContent;
22
+ replyMarkup?: ReplyMarkupInlineKeyboard;
23
+ }
24
+ /** @unlisted */
25
+ export interface _InlineQueryResultThumbnailCommon {
26
+ thumbnailUrl?: string;
27
+ thumbnailWidth?: string;
28
+ thumbnailHeight?: string;
29
+ }
30
+ /** @unlisted */
31
+ export interface InlineQueryResultArticle extends _InlineQueryResultBase {
32
+ type: "article";
33
+ title: string;
34
+ inputMessageContent: InputMessageContent;
35
+ description?: string;
36
+ replyMarkup?: ReplyMarkupInlineKeyboard;
37
+ url?: string;
38
+ hideUrl?: boolean;
39
+ }
40
+ /** @unlisted */
41
+ export interface InlineQueryResultAudio extends _InlineQueryResultBase, _InlineQueryResultCaptionCommon, _InlineQueryResultInputMessageContentReplyMarkupCommon {
42
+ type: "audio";
43
+ title: string;
44
+ audioUrl: string;
45
+ performer?: string;
46
+ audioDuration?: number;
47
+ }
48
+ /** @unlisted */
49
+ export interface InlineQueryResultCachedAudio extends _InlineQueryResultBase, _InlineQueryResultCaptionCommon, _InlineQueryResultInputMessageContentReplyMarkupCommon {
50
+ type: "audio";
51
+ audioFileId: string;
52
+ }
53
+ /** @unlisted */
54
+ export interface InlineQueryResultCachedDocument extends _InlineQueryResultBase, _InlineQueryResultCaptionCommon, _InlineQueryResultInputMessageContentReplyMarkupCommon {
55
+ type: "document";
56
+ documentFileId: string;
57
+ description?: string;
58
+ }
59
+ /** @unlisted */
60
+ export interface InlineQueryResultCachedGif extends _InlineQueryResultBase, _InlineQueryResultCaptionCommon, _InlineQueryResultInputMessageContentReplyMarkupCommon {
61
+ type: "gif";
62
+ gifFileId: string;
63
+ title?: string;
64
+ }
65
+ /** @unlisted */
66
+ export interface InlineQueryResultCachedMpeg4Gif extends _InlineQueryResultBase, _InlineQueryResultCaptionCommon, _InlineQueryResultInputMessageContentReplyMarkupCommon {
67
+ type: "mpeg4Gif";
68
+ mpeg4FileId: string;
69
+ title?: string;
70
+ }
71
+ /** @unlisted */
72
+ export interface InlineQueryResultCachedPhoto extends _InlineQueryResultBase, _InlineQueryResultCaptionCommon, _InlineQueryResultInputMessageContentReplyMarkupCommon {
73
+ type: "photo";
74
+ photoFileId: string;
75
+ title?: string;
76
+ description?: string;
77
+ }
78
+ /** @unlisted */
79
+ export interface InlineQueryResultCachedSticker extends _InlineQueryResultBase, _InlineQueryResultInputMessageContentReplyMarkupCommon {
80
+ type: "sticker";
81
+ stickerFileId: string;
82
+ }
83
+ /** @unlisted */
84
+ export interface InlineQueryResultCachedVideo extends _InlineQueryResultBase, _InlineQueryResultCaptionCommon, _InlineQueryResultInputMessageContentReplyMarkupCommon {
85
+ type: "video";
86
+ title: string;
87
+ videoFileId: string;
88
+ description?: string;
89
+ }
90
+ /** @unlisted */
91
+ export interface InlineQueryResultCachedVoice extends _InlineQueryResultBase, _InlineQueryResultCaptionCommon, _InlineQueryResultInputMessageContentReplyMarkupCommon {
92
+ type: "voice";
93
+ title: string;
94
+ voiceFileId: string;
95
+ }
96
+ /** @unlisted */
97
+ export interface InlineQueryResultContact extends _InlineQueryResultBase, _InlineQueryResultCaptionCommon, _InlineQueryResultInputMessageContentReplyMarkupCommon, _InlineQueryResultThumbnailCommon {
98
+ type: "game";
99
+ phoneNumber: string;
100
+ firstName: string;
101
+ lastName?: string;
102
+ vcard?: string;
103
+ }
104
+ /** @unlisted */
105
+ export interface InlineQueryResultDocument extends _InlineQueryResultBase, _InlineQueryResultCaptionCommon, _InlineQueryResultInputMessageContentReplyMarkupCommon, _InlineQueryResultThumbnailCommon {
106
+ type: "document";
107
+ title: string;
108
+ documentUrl: string;
109
+ }
110
+ /** @unlisted */
111
+ export interface InlineQueryResultGame extends _InlineQueryResultBase {
112
+ type: "game";
113
+ gameShortName: string;
114
+ replyMarkup?: ReplyMarkupInlineKeyboard;
115
+ }
116
+ /** @unlisted */
117
+ export interface InlineQueryResultGif extends _InlineQueryResultBase, _InlineQueryResultCaptionCommon, _InlineQueryResultInputMessageContentReplyMarkupCommon {
118
+ type: "gif";
119
+ title?: string;
120
+ gifUrl: string;
121
+ gifWidth?: number;
122
+ gifHeight?: number;
123
+ gifDuration?: number;
124
+ thumbnailUrl?: string;
125
+ thumbnailMimeType?: string;
126
+ }
127
+ /** @unlisted */
128
+ export interface InlineQueryResultLocation extends _InlineQueryResultBase, _InlineQueryResultInputMessageContentReplyMarkupCommon, _InlineQueryResultThumbnailCommon {
129
+ type: "location";
130
+ title: string;
131
+ latitude: number;
132
+ longitude: number;
133
+ horizontalAccuracy?: number;
134
+ livePeriod?: number;
135
+ heading?: number;
136
+ proximityAlertRadius?: number;
137
+ }
138
+ /** @unlisted */
139
+ export interface InlineQueryResultMpeg4Gif extends _InlineQueryResultBase, _InlineQueryResultCaptionCommon, _InlineQueryResultInputMessageContentReplyMarkupCommon {
140
+ type: "mpeg4Gif";
141
+ mpeg4Url: string;
142
+ title?: string;
143
+ mpeg4Width?: number;
144
+ mpeg4Height?: number;
145
+ mpeg4Duration?: number;
146
+ thumbnailUrl?: string;
147
+ thumbnailMimeType?: string;
148
+ }
149
+ /** @unlisted */
150
+ export interface InlineQueryResultPhoto extends _InlineQueryResultBase, _InlineQueryResultInputMessageContentReplyMarkupCommon {
151
+ type: "photo";
152
+ photoUrl: string;
153
+ thumbnailUrl: string;
154
+ title?: string;
155
+ description?: string;
156
+ photoWidth?: number;
157
+ photoHeight?: number;
158
+ }
159
+ /** @unlisted */
160
+ export interface InlineQueryResultVenue extends _InlineQueryResultBase, _InlineQueryResultInputMessageContentReplyMarkupCommon, _InlineQueryResultThumbnailCommon {
161
+ type: "venue";
162
+ title: string;
163
+ latitude: number;
164
+ longitude: number;
165
+ address: string;
166
+ fourSquareId?: string;
167
+ foursquareType?: string;
168
+ }
169
+ /** @unlisted */
170
+ export interface InlineQueryResultVideo extends _InlineQueryResultBase, _InlineQueryResultCaptionCommon, _InlineQueryResultInputMessageContentReplyMarkupCommon {
171
+ type: "video";
172
+ title: string;
173
+ description?: string;
174
+ videoUrl: string;
175
+ mimeType: string;
176
+ thumbnailUrl: string;
177
+ videoWidth?: number;
178
+ videoHeight?: number;
179
+ videoDuration?: number;
180
+ }
181
+ /** @unlisted */
182
+ export interface InlineQueryResultVoice extends _InlineQueryResultBase, _InlineQueryResultCaptionCommon, _InlineQueryResultInputMessageContentReplyMarkupCommon {
183
+ type: "voice";
184
+ title: string;
185
+ voiceUrl: string;
186
+ voiceDuration?: number;
187
+ }
188
+ export type InlineQueryResult = InlineQueryResultCachedAudio | InlineQueryResultCachedDocument | InlineQueryResultCachedGif | InlineQueryResultCachedMpeg4Gif | InlineQueryResultCachedPhoto | InlineQueryResultCachedSticker | InlineQueryResultCachedVideo | InlineQueryResultCachedVoice | InlineQueryResultArticle | InlineQueryResultAudio | InlineQueryResultContact | InlineQueryResultGame | InlineQueryResultDocument | InlineQueryResultGif | InlineQueryResultLocation | InlineQueryResultMpeg4Gif | InlineQueryResultPhoto | InlineQueryResultVenue | InlineQueryResultVideo | InlineQueryResultVoice;
189
+ export declare function inlineQueryResultToTlObject(result_: InlineQueryResult, parseText: (text: string, params?: {
190
+ parseMode?: ParseMode;
191
+ entities?: MessageEntity[];
192
+ }) => readonly [string, any[] | undefined], usernameResolver: UsernameResolver): Promise<import("../tl/2_types.js").InputBotInlineResult_ | import("../tl/2_types.js").InputBotInlineResultDocument_>;
193
+ export {};
@@ -1,7 +1,7 @@
1
1
  import { UNREACHABLE } from "../1_utilities.js";
2
2
  import { types } from "../2_tl.js";
3
3
  import { FileID } from "./0__file_id.js";
4
- import { replyMarkupToTlObject } from "./4_reply_markup.js";
4
+ import { replyMarkupToTlObject } from "./3_reply_markup.js";
5
5
  // deno-lint-ignore no-explicit-any
6
6
  export async function inlineQueryResultToTlObject(result_, parseText, usernameResolver) {
7
7
  let document = null;
@@ -78,7 +78,7 @@ export async function inlineQueryResultToTlObject(result_, parseText, usernameRe
78
78
  fileId_ = result_.gifFileId;
79
79
  }
80
80
  break;
81
- case "mpeg4_gif":
81
+ case "mpeg4Gif":
82
82
  if ("mpeg4Url" in result_) {
83
83
  document = new types.InputWebDocument({
84
84
  url: result_.mpeg4Url,
@@ -2,10 +2,8 @@ import { MaybePromise } from "../1_utilities.js";
2
2
  import { enums } from "../2_tl.js";
3
3
  import { Contact } from "./0_contact.js";
4
4
  import { Dice } from "./0_dice.js";
5
- import { ForceReply } from "./0_force_reply.js";
6
5
  import { Location } from "./0_location.js";
7
6
  import { MessageEntity } from "./0_message_entity.js";
8
- import { ReplyKeyboardRemove } from "./0_reply_keyboard_remove.js";
9
7
  import { Venue } from "./0_venue.js";
10
8
  import { Voice } from "./0_voice.js";
11
9
  import { EntityGetter } from "./1__getters.js";
@@ -23,13 +21,12 @@ import { User } from "./1_user.js";
23
21
  import { VideoNote } from "./1_video_note.js";
24
22
  import { Video } from "./1_video.js";
25
23
  import { Game } from "./2_game.js";
26
- import { ReplyKeyboardMarkup } from "./2_reply_keyboard_markup.js";
27
- import { InlineKeyboardMarkup } from "./3_inline_keyboard_markup.js";
24
+ import { ReplyMarkup } from "./3_reply_markup.js";
28
25
  /**
29
26
  * Properties shared between all message types.
30
27
  * @unlisted
31
28
  */
32
- export interface MessageBase {
29
+ export interface _MessageBase {
33
30
  /** Whether the message is outgoing (sent by the current user). */
34
31
  out: boolean;
35
32
  /** The identifier of the message. */
@@ -85,13 +82,13 @@ export interface MessageBase {
85
82
  /** The number of times the message was forwarded. */
86
83
  forwards?: number;
87
84
  /** The message's reply markup. */
88
- replyMarkup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
85
+ replyMarkup?: ReplyMarkup;
89
86
  }
90
87
  /**
91
88
  * Properties shared between media message types.
92
89
  * @unlisted
93
90
  */
94
- export interface MessageMediaBase extends MessageBase {
91
+ export interface MessageMediaBase extends _MessageBase {
95
92
  caption?: string;
96
93
  captionEntities?: MessageEntity[];
97
94
  hasMediaSpoiler?: boolean;
@@ -100,7 +97,7 @@ export interface MessageMediaBase extends MessageBase {
100
97
  * A text message.
101
98
  * @unlisted
102
99
  */
103
- export interface MessageText extends MessageBase {
100
+ export interface MessageText extends _MessageBase {
104
101
  /** The text included in the message. */
105
102
  text: string;
106
103
  /** Entities of the text. */
@@ -131,7 +128,7 @@ export interface MessageVideo extends MessageMediaBase {
131
128
  * A sticker message.
132
129
  * @unlisted
133
130
  */
134
- export interface MessageSticker extends MessageBase {
131
+ export interface MessageSticker extends _MessageBase {
135
132
  /** The sticker included in the message. */
136
133
  sticker: Sticker;
137
134
  }
@@ -163,7 +160,7 @@ export interface MessageAudio extends MessageMediaBase {
163
160
  * A dice message.
164
161
  * @unlisted
165
162
  */
166
- export interface MessageDice extends MessageBase {
163
+ export interface MessageDice extends _MessageBase {
167
164
  /** The dice included in the message. */
168
165
  dice: Dice;
169
166
  }
@@ -171,7 +168,7 @@ export interface MessageDice extends MessageBase {
171
168
  * A video note message.
172
169
  * @unlisted
173
170
  */
174
- export interface MessageVideoNote extends MessageBase {
171
+ export interface MessageVideoNote extends _MessageBase {
175
172
  /** The video note included in the message. */
176
173
  videoNote: VideoNote;
177
174
  }
@@ -179,7 +176,7 @@ export interface MessageVideoNote extends MessageBase {
179
176
  * A contact message.
180
177
  * @unlisted
181
178
  */
182
- export interface MessageContact extends MessageBase {
179
+ export interface MessageContact extends _MessageBase {
183
180
  /** The contact included in the message. */
184
181
  contact: Contact;
185
182
  }
@@ -187,7 +184,7 @@ export interface MessageContact extends MessageBase {
187
184
  * A game message.
188
185
  * @unlisted
189
186
  */
190
- export interface MessageGame extends MessageBase {
187
+ export interface MessageGame extends _MessageBase {
191
188
  /** The game included in the message. */
192
189
  game: Game;
193
190
  }
@@ -195,7 +192,7 @@ export interface MessageGame extends MessageBase {
195
192
  * A poll message.
196
193
  * @unlisted
197
194
  */
198
- export interface MessagePoll extends MessageBase {
195
+ export interface MessagePoll extends _MessageBase {
199
196
  /** The poll included in the message. */
200
197
  poll: Poll;
201
198
  }
@@ -203,7 +200,7 @@ export interface MessagePoll extends MessageBase {
203
200
  * A venue message.
204
201
  * @unlisted
205
202
  */
206
- export interface MessageVenue extends MessageBase {
203
+ export interface MessageVenue extends _MessageBase {
207
204
  /** The venue included in the message. */
208
205
  venue: Venue;
209
206
  }
@@ -211,7 +208,7 @@ export interface MessageVenue extends MessageBase {
211
208
  * A location message.
212
209
  * @unlisted
213
210
  */
214
- export interface MessageLocation extends MessageBase {
211
+ export interface MessageLocation extends _MessageBase {
215
212
  /** The location included in the message. */
216
213
  location: Location;
217
214
  }
@@ -219,7 +216,7 @@ export interface MessageLocation extends MessageBase {
219
216
  * A message that is received when new members join a chat.
220
217
  * @unlisted
221
218
  */
222
- export interface MessageNewChatMembers extends MessageBase {
219
+ export interface MessageNewChatMembers extends _MessageBase {
223
220
  /** The new members of the chat. */
224
221
  newChatMembers: User[];
225
222
  }
@@ -227,7 +224,7 @@ export interface MessageNewChatMembers extends MessageBase {
227
224
  * A message that is received when a member leaves a chat.
228
225
  * @unlisted
229
226
  */
230
- export interface MessageLeftChatMember extends MessageBase {
227
+ export interface MessageLeftChatMember extends _MessageBase {
231
228
  /** The member who left the chat. */
232
229
  leftChatMember: User;
233
230
  }
@@ -235,7 +232,7 @@ export interface MessageLeftChatMember extends MessageBase {
235
232
  * A message that is received when a chat's title is changed.
236
233
  * @unlisted
237
234
  */
238
- export interface MessageNewChatTitle extends MessageBase {
235
+ export interface MessageNewChatTitle extends _MessageBase {
239
236
  /** The new title of the chat. */
240
237
  newChatTitle: string;
241
238
  }
@@ -243,7 +240,7 @@ export interface MessageNewChatTitle extends MessageBase {
243
240
  * A message that is received when a chat's photo is changed.
244
241
  * @unlisted
245
242
  */
246
- export interface MessageNewChatPhoto extends MessageBase {
243
+ export interface MessageNewChatPhoto extends _MessageBase {
247
244
  /** The new photo of the chat. */
248
245
  newChatPhoto: Photo;
249
246
  }
@@ -251,7 +248,7 @@ export interface MessageNewChatPhoto extends MessageBase {
251
248
  * A message that is received when a chat's photo is removed.
252
249
  * @unlisted
253
250
  */
254
- export interface MessageDeletedChatPhoto extends MessageBase {
251
+ export interface MessageDeletedChatPhoto extends _MessageBase {
255
252
  deletedChatPhoto: true;
256
253
  }
257
254
  /**
@@ -259,7 +256,7 @@ export interface MessageDeletedChatPhoto extends MessageBase {
259
256
  * While bots don't receive them, they are able to see them if someone replies to them.
260
257
  * @unlisted
261
258
  */
262
- export interface MessageGroupCreated extends MessageBase {
259
+ export interface MessageGroupCreated extends _MessageBase {
263
260
  groupCreated: true;
264
261
  /** The initial members of the group. */
265
262
  newChatMembers: User[];
@@ -269,7 +266,7 @@ export interface MessageGroupCreated extends MessageBase {
269
266
  * While bots don't receive them, they are able to see them if someone replies to them.
270
267
  * @unlisted
271
268
  */
272
- export interface MessageSupergroupCreated extends MessageBase {
269
+ export interface MessageSupergroupCreated extends _MessageBase {
273
270
  supergroupCreated: true;
274
271
  }
275
272
  /**
@@ -277,14 +274,14 @@ export interface MessageSupergroupCreated extends MessageBase {
277
274
  * While bots don't receive them, they are able to see them if someone replies to them.
278
275
  * @unlisted
279
276
  */
280
- export interface MessageChannelCreated extends MessageBase {
277
+ export interface MessageChannelCreated extends _MessageBase {
281
278
  channelCreated: true;
282
279
  }
283
280
  /**
284
281
  * A message that is received when a chat's auto-delete timer is changed.
285
282
  * @unlisted
286
283
  */
287
- export interface MessageAutoDeleteTimerChanged extends MessageBase {
284
+ export interface MessageAutoDeleteTimerChanged extends _MessageBase {
288
285
  /** The new auto-delete time in seconds. */
289
286
  newAutoDeleteTime: number;
290
287
  }
@@ -292,7 +289,7 @@ export interface MessageAutoDeleteTimerChanged extends MessageBase {
292
289
  * A message that is received when a supergroup is created as a result of a group migration.
293
290
  * @unlisted
294
291
  */
295
- export interface MessageChatMigratedTo extends MessageBase {
292
+ export interface MessageChatMigratedTo extends _MessageBase {
296
293
  /** The supergroup's ID. */
297
294
  chatMigratedTo: number;
298
295
  }
@@ -300,7 +297,7 @@ export interface MessageChatMigratedTo extends MessageBase {
300
297
  * A message that is received when a group is migrated to a supergroup.
301
298
  * @unlisted
302
299
  */
303
- export interface MessageChatMigratedFrom extends MessageBase {
300
+ export interface MessageChatMigratedFrom extends _MessageBase {
304
301
  /** The group's ID. */
305
302
  chatMigratedFrom: number;
306
303
  }
@@ -308,7 +305,7 @@ export interface MessageChatMigratedFrom extends MessageBase {
308
305
  * A message that is received when a message is pinned in a chat.
309
306
  * @unlisted
310
307
  */
311
- export interface MessagePinnedMessage extends MessageBase {
308
+ export interface MessagePinnedMessage extends _MessageBase {
312
309
  /** The message that was pinned. */
313
310
  pinnedMessage: Message;
314
311
  }
@@ -316,7 +313,7 @@ export interface MessagePinnedMessage extends MessageBase {
316
313
  * A message that is received when a bot account receives a shared user.
317
314
  * @unlisted
318
315
  */
319
- export interface MessageUserShared extends MessageBase {
316
+ export interface MessageUserShared extends _MessageBase {
320
317
  userShared: {
321
318
  requestId: number;
322
319
  userId: number;
@@ -326,7 +323,7 @@ export interface MessageUserShared extends MessageBase {
326
323
  * A message that is received when a bot is allowed to message a user.
327
324
  * @unlisted
328
325
  */
329
- export interface MessageWriteAccessAllowed extends MessageBase {
326
+ export interface MessageWriteAccessAllowed extends _MessageBase {
330
327
  writeAccessAllowed: {
331
328
  webAppName?: string;
332
329
  };
@@ -335,7 +332,7 @@ export interface MessageWriteAccessAllowed extends MessageBase {
335
332
  * A message that is received when a new topic is created in a forum.
336
333
  * @unlisted
337
334
  */
338
- export interface MessageForumTopicCreated extends MessageBase {
335
+ export interface MessageForumTopicCreated extends _MessageBase {
339
336
  forumTopicCreated: {
340
337
  name: string;
341
338
  iconColor: string;
@@ -346,7 +343,7 @@ export interface MessageForumTopicCreated extends MessageBase {
346
343
  * A message that is received when a topic is edited in a forum.
347
344
  * @unlisted
348
345
  */
349
- export interface MessageForumTopicEdited extends MessageBase {
346
+ export interface MessageForumTopicEdited extends _MessageBase {
350
347
  forumTopicEdited: {
351
348
  name: string;
352
349
  iconCutsomEmojiId?: string;
@@ -356,21 +353,21 @@ export interface MessageForumTopicEdited extends MessageBase {
356
353
  * A message that is received when a topic is closed in a forum.
357
354
  * @unlisted
358
355
  */
359
- export interface MessageForumTopicClosed extends MessageBase {
356
+ export interface MessageForumTopicClosed extends _MessageBase {
360
357
  forumTopicClosed: true;
361
358
  }
362
359
  /**
363
360
  * A message that is received when a topic is reopened in a forum.
364
361
  * @unlisted
365
362
  */
366
- export interface MessageForumTopicReopened extends MessageBase {
363
+ export interface MessageForumTopicReopened extends _MessageBase {
367
364
  forumTopicReopened: true;
368
365
  }
369
366
  /**
370
367
  * A message that is received when a video chat is scheduled in a chat.
371
368
  * @unlisted
372
369
  */
373
- export interface MessageVideoChatScheduled extends MessageBase {
370
+ export interface MessageVideoChatScheduled extends _MessageBase {
374
371
  videoChatScheduled: {
375
372
  startDate: Date;
376
373
  };
@@ -379,14 +376,14 @@ export interface MessageVideoChatScheduled extends MessageBase {
379
376
  * A message that is received when a video chat is started in a chat.
380
377
  * @unlisted
381
378
  */
382
- export interface MessageVideoChatStarted extends MessageBase {
379
+ export interface MessageVideoChatStarted extends _MessageBase {
383
380
  videoChatStarted: true;
384
381
  }
385
382
  /**
386
383
  * A message that is received when a video chat is ended in a chat.
387
384
  * @unlisted
388
385
  */
389
- export interface MessageVideoChatEnded extends MessageBase {
386
+ export interface MessageVideoChatEnded extends _MessageBase {
390
387
  videoChatEnded: {
391
388
  duration: number;
392
389
  };
@@ -395,14 +392,14 @@ export interface MessageVideoChatEnded extends MessageBase {
395
392
  * A message that is received when a giveaway is started in a chat.
396
393
  * @unlisted
397
394
  */
398
- export interface MessageGiveaway extends MessageBase {
395
+ export interface MessageGiveaway extends _MessageBase {
399
396
  giveaway: Giveaway;
400
397
  }
401
398
  /**
402
399
  * An unsupported message.
403
400
  * @unlisted
404
401
  */
405
- export interface MessageUnsupported extends MessageBase {
402
+ export interface MessageUnsupported extends _MessageBase {
406
403
  unsupported: true;
407
404
  }
408
405
  /** @unlisted */