@mtkruto/browser 0.136.0 → 0.138.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 (343) hide show
  1. package/esm/0_deps.js +3 -3
  2. package/esm/3_errors.d.ts +2 -2
  3. package/esm/3_errors.d.ts.map +1 -1
  4. package/esm/3_errors.js +2 -2
  5. package/esm/3_types.d.ts +2 -3
  6. package/esm/3_types.d.ts.map +1 -1
  7. package/esm/3_types.js +2 -3
  8. package/esm/client/0_markdown.d.ts.map +1 -1
  9. package/esm/client/0_markdown.js +1 -3
  10. package/esm/client/0_params.d.ts +17 -11
  11. package/esm/client/0_params.d.ts.map +1 -1
  12. package/esm/client/0_storage_operations.js +1 -1
  13. package/esm/client/1_client_generic.d.ts +19 -14
  14. package/esm/client/1_client_generic.d.ts.map +1 -1
  15. package/esm/client/1_client_generic.js +1 -3
  16. package/esm/client/1_client_plain.d.ts +2 -6
  17. package/esm/client/1_client_plain.d.ts.map +1 -1
  18. package/esm/client/1_client_plain.js +1 -3
  19. package/esm/client/2_bot_info_manager.js +1 -1
  20. package/esm/client/2_business_connection_manager.js +1 -1
  21. package/esm/client/2_file_manager.d.ts.map +1 -1
  22. package/esm/client/2_file_manager.js +2 -0
  23. package/esm/client/2_payment_manager.js +1 -1
  24. package/esm/client/2_reaction_manager.js +4 -4
  25. package/esm/client/2_translations_manager.js +2 -2
  26. package/esm/client/2_update_manager.js +2 -2
  27. package/esm/client/3_account_manager.d.ts +2 -1
  28. package/esm/client/3_account_manager.d.ts.map +1 -1
  29. package/esm/client/3_account_manager.js +11 -4
  30. package/esm/client/3_filters.d.ts +94 -18
  31. package/esm/client/3_filters.d.ts.map +1 -1
  32. package/esm/client/3_message_manager.d.ts.map +1 -1
  33. package/esm/client/3_message_manager.js +18 -21
  34. package/esm/client/3_video_chat_manager.js +1 -1
  35. package/esm/client/4_callback_query_manager.js +1 -1
  36. package/esm/client/4_chat_manager.js +3 -3
  37. package/esm/client/4_context.d.ts +155 -463
  38. package/esm/client/4_context.d.ts.map +1 -1
  39. package/esm/client/4_context.js +221 -506
  40. package/esm/client/4_inline_query_manager.js +3 -3
  41. package/esm/client/4_link_preview_manager.js +1 -1
  42. package/esm/client/4_poll_manager.d.ts.map +1 -1
  43. package/esm/client/4_poll_manager.js +4 -2
  44. package/esm/client/4_story_manager.js +4 -4
  45. package/esm/client/6_client.d.ts +20 -21
  46. package/esm/client/6_client.d.ts.map +1 -1
  47. package/esm/client/6_client.js +22 -19
  48. package/esm/client/6_client_dispatcher.d.ts +19 -14
  49. package/esm/client/6_client_dispatcher.d.ts.map +1 -1
  50. package/esm/client/6_client_dispatcher.js +20 -11
  51. package/esm/connection/1_connection_socks5.js +3 -3
  52. package/esm/connection/1_connection_socks5.node.js +3 -3
  53. package/esm/session/1_session.d.ts +2 -6
  54. package/esm/session/1_session.d.ts.map +1 -1
  55. package/esm/storage/2_storage_local_storage.d.ts.map +1 -1
  56. package/esm/storage/2_storage_local_storage.js +10 -6
  57. package/esm/storage/2_storage_memory.d.ts.map +1 -1
  58. package/esm/storage/2_storage_memory.js +9 -5
  59. package/esm/storage/2_storage_session_storage.d.ts.map +1 -1
  60. package/esm/storage/2_storage_session_storage.js +10 -6
  61. package/esm/types/0_bot_token_check_result.d.ts +0 -1
  62. package/esm/types/0_bot_token_check_result.d.ts.map +1 -1
  63. package/esm/types/0_callback_query_question.d.ts +0 -3
  64. package/esm/types/0_callback_query_question.d.ts.map +1 -1
  65. package/esm/types/0_chat_action_type.d.ts +0 -13
  66. package/esm/types/0_chat_action_type.d.ts.map +1 -1
  67. package/esm/types/0_chat_administrator_rights.d.ts +4 -4
  68. package/esm/types/0_chat_administrator_rights.d.ts.map +1 -1
  69. package/esm/types/0_code_check_result.d.ts +0 -3
  70. package/esm/types/0_code_check_result.d.ts.map +1 -1
  71. package/esm/types/0_emoji_status.d.ts +0 -2
  72. package/esm/types/0_emoji_status.d.ts.map +1 -1
  73. package/esm/types/0_gift_component_rarity.d.ts +0 -5
  74. package/esm/types/0_gift_component_rarity.d.ts.map +1 -1
  75. package/esm/types/0_id.d.ts +1 -3
  76. package/esm/types/0_id.d.ts.map +1 -1
  77. package/{script/types/1_inline_query_result_button.d.ts → esm/types/0_inline_query_result_button.d.ts} +3 -4
  78. package/esm/types/0_inline_query_result_button.d.ts.map +1 -0
  79. package/esm/types/0_input_emoji_status.d.ts +0 -2
  80. package/esm/types/0_input_emoji_status.d.ts.map +1 -1
  81. package/esm/types/0_password_check_result.d.ts +0 -2
  82. package/esm/types/0_password_check_result.d.ts.map +1 -1
  83. package/esm/types/0_premium_subscription_duration.d.ts +1 -0
  84. package/esm/types/0_premium_subscription_duration.d.ts.map +1 -1
  85. package/esm/types/0_reaction.d.ts +0 -3
  86. package/esm/types/0_reaction.d.ts.map +1 -1
  87. package/esm/types/0_user_status.d.ts +3 -8
  88. package/esm/types/0_user_status.d.ts.map +1 -1
  89. package/esm/types/0_video_chat.d.ts +0 -3
  90. package/esm/types/0_video_chat.d.ts.map +1 -1
  91. package/esm/types/1_available_reactions.d.ts +0 -3
  92. package/esm/types/1_available_reactions.d.ts.map +1 -1
  93. package/esm/types/1_bot_command_scope.d.ts +1 -8
  94. package/esm/types/1_bot_command_scope.d.ts.map +1 -1
  95. package/esm/types/1_chat_p.d.ts +1 -7
  96. package/esm/types/1_chat_p.d.ts.map +1 -1
  97. package/esm/types/1_inline_keyboard_button.d.ts +25 -42
  98. package/esm/types/1_inline_keyboard_button.d.ts.map +1 -1
  99. package/esm/types/1_inline_keyboard_button.js +57 -64
  100. package/esm/types/1_input_gift.d.ts +0 -3
  101. package/esm/types/1_input_gift.d.ts.map +1 -1
  102. package/esm/types/1_input_story_content.d.ts +2 -2
  103. package/esm/types/1_input_story_content.d.ts.map +1 -1
  104. package/esm/types/1_keyboard_button.d.ts +33 -34
  105. package/esm/types/1_keyboard_button.d.ts.map +1 -1
  106. package/esm/types/1_keyboard_button.js +81 -88
  107. package/esm/types/1_order_info.d.ts +1 -1
  108. package/esm/types/2_chat.d.ts +1 -3
  109. package/esm/types/2_chat.d.ts.map +1 -1
  110. package/esm/types/2_chat_member.d.ts +6 -24
  111. package/esm/types/2_chat_member.d.ts.map +1 -1
  112. package/esm/types/2_message_entity.d.ts +0 -20
  113. package/esm/types/2_message_entity.d.ts.map +1 -1
  114. package/esm/types/{0_mini_app_button_info.js → 2_profile_photo_list.d.ts} +10 -2
  115. package/esm/types/2_profile_photo_list.d.ts.map +1 -0
  116. package/esm/types/{0_keyboard_button_poll_type.d.ts → 2_profile_photo_list.js} +6 -5
  117. package/esm/types/2_reply_markup.d.ts +5 -13
  118. package/esm/types/2_reply_markup.d.ts.map +1 -1
  119. package/esm/types/2_reply_markup.js +13 -17
  120. package/esm/types/2_star_transaction_peer.d.ts +0 -8
  121. package/esm/types/2_star_transaction_peer.d.ts.map +1 -1
  122. package/esm/types/2_story_album_icon.d.ts +0 -2
  123. package/esm/types/2_story_album_icon.d.ts.map +1 -1
  124. package/esm/types/2_story_content.d.ts +3 -4
  125. package/esm/types/2_story_content.d.ts.map +1 -1
  126. package/esm/types/2_story_content.js +3 -3
  127. package/esm/types/2_story_privacy.d.ts +8 -9
  128. package/esm/types/2_story_privacy.d.ts.map +1 -1
  129. package/esm/types/2_story_privacy.js +23 -20
  130. package/esm/types/3_checklist_item.d.ts +2 -8
  131. package/esm/types/3_checklist_item.d.ts.map +1 -1
  132. package/esm/types/3_forward_header.d.ts +0 -5
  133. package/esm/types/3_forward_header.d.ts.map +1 -1
  134. package/esm/types/3_gift_upgraded_component.d.ts +0 -4
  135. package/esm/types/3_gift_upgraded_component.d.ts.map +1 -1
  136. package/esm/types/3_inline_query.d.ts.map +1 -1
  137. package/esm/types/3_inline_query.js +3 -2
  138. package/esm/types/3_input_media.d.ts +10 -20
  139. package/esm/types/3_input_media.d.ts.map +1 -1
  140. package/esm/types/3_invite_link.d.ts +0 -2
  141. package/esm/types/3_invite_link.d.ts.map +1 -1
  142. package/esm/types/3_invite_link.js +3 -4
  143. package/esm/types/4_gift.d.ts +1 -3
  144. package/esm/types/4_gift.d.ts.map +1 -1
  145. package/esm/types/4_reply_to.d.ts +6 -14
  146. package/esm/types/4_reply_to.d.ts.map +1 -1
  147. package/esm/types/5_gift_upgraded_information.d.ts +1 -1
  148. package/esm/types/5_gift_upgraded_information.d.ts.map +1 -1
  149. package/esm/types/5_gift_upgraded_information.js +2 -2
  150. package/esm/types/5_link_preview.d.ts +2 -18
  151. package/esm/types/5_link_preview.d.ts.map +1 -1
  152. package/esm/types/6_message.d.ts +91 -180
  153. package/esm/types/6_message.d.ts.map +1 -1
  154. package/esm/types/6_message.js +105 -121
  155. package/esm/types/6_message_content.d.ts +2 -7
  156. package/esm/types/6_message_content.d.ts.map +1 -1
  157. package/esm/types/7_inline_query_result.d.ts +10 -47
  158. package/esm/types/7_inline_query_result.d.ts.map +1 -1
  159. package/esm/types/7_inline_query_result.js +219 -152
  160. package/esm/types/7_topic.js +3 -3
  161. package/esm/types/8_update.d.ts +59 -106
  162. package/esm/types/8_update.d.ts.map +1 -1
  163. package/esm/utilities/0_int.d.ts +1 -3
  164. package/esm/utilities/0_int.d.ts.map +1 -1
  165. package/esm/utilities/1_logger.js +1 -1
  166. package/package.json +1 -1
  167. package/script/0_deps.js +3 -3
  168. package/script/3_errors.d.ts +2 -2
  169. package/script/3_errors.d.ts.map +1 -1
  170. package/script/3_errors.js +4 -4
  171. package/script/3_types.d.ts +2 -3
  172. package/script/3_types.d.ts.map +1 -1
  173. package/script/3_types.js +2 -3
  174. package/script/client/0_markdown.d.ts.map +1 -1
  175. package/script/client/0_markdown.js +1 -3
  176. package/script/client/0_params.d.ts +17 -11
  177. package/script/client/0_params.d.ts.map +1 -1
  178. package/script/client/0_storage_operations.js +1 -1
  179. package/script/client/1_client_generic.d.ts +19 -14
  180. package/script/client/1_client_generic.d.ts.map +1 -1
  181. package/script/client/1_client_generic.js +1 -3
  182. package/script/client/1_client_plain.d.ts +2 -6
  183. package/script/client/1_client_plain.d.ts.map +1 -1
  184. package/script/client/1_client_plain.js +1 -3
  185. package/script/client/2_bot_info_manager.js +1 -1
  186. package/script/client/2_business_connection_manager.js +1 -1
  187. package/script/client/2_file_manager.d.ts.map +1 -1
  188. package/script/client/2_file_manager.js +2 -0
  189. package/script/client/2_payment_manager.js +1 -1
  190. package/script/client/2_reaction_manager.js +4 -4
  191. package/script/client/2_translations_manager.js +2 -2
  192. package/script/client/2_update_manager.js +2 -2
  193. package/script/client/3_account_manager.d.ts +2 -1
  194. package/script/client/3_account_manager.d.ts.map +1 -1
  195. package/script/client/3_account_manager.js +9 -2
  196. package/script/client/3_filters.d.ts +94 -18
  197. package/script/client/3_filters.d.ts.map +1 -1
  198. package/script/client/3_message_manager.d.ts.map +1 -1
  199. package/script/client/3_message_manager.js +17 -20
  200. package/script/client/3_video_chat_manager.js +1 -1
  201. package/script/client/4_callback_query_manager.js +1 -1
  202. package/script/client/4_chat_manager.js +3 -3
  203. package/script/client/4_context.d.ts +155 -463
  204. package/script/client/4_context.d.ts.map +1 -1
  205. package/script/client/4_context.js +221 -506
  206. package/script/client/4_inline_query_manager.js +3 -3
  207. package/script/client/4_link_preview_manager.js +1 -1
  208. package/script/client/4_poll_manager.d.ts.map +1 -1
  209. package/script/client/4_poll_manager.js +4 -2
  210. package/script/client/4_story_manager.js +4 -4
  211. package/script/client/6_client.d.ts +20 -21
  212. package/script/client/6_client.d.ts.map +1 -1
  213. package/script/client/6_client.js +22 -19
  214. package/script/client/6_client_dispatcher.d.ts +19 -14
  215. package/script/client/6_client_dispatcher.d.ts.map +1 -1
  216. package/script/client/6_client_dispatcher.js +20 -11
  217. package/script/connection/1_connection_socks5.js +3 -3
  218. package/script/connection/1_connection_socks5.node.js +3 -3
  219. package/script/session/1_session.d.ts +2 -6
  220. package/script/session/1_session.d.ts.map +1 -1
  221. package/script/storage/2_storage_local_storage.d.ts.map +1 -1
  222. package/script/storage/2_storage_local_storage.js +10 -6
  223. package/script/storage/2_storage_memory.d.ts.map +1 -1
  224. package/script/storage/2_storage_memory.js +9 -5
  225. package/script/storage/2_storage_session_storage.d.ts.map +1 -1
  226. package/script/storage/2_storage_session_storage.js +10 -6
  227. package/script/types/0_bot_token_check_result.d.ts +0 -1
  228. package/script/types/0_bot_token_check_result.d.ts.map +1 -1
  229. package/script/types/0_callback_query_question.d.ts +0 -3
  230. package/script/types/0_callback_query_question.d.ts.map +1 -1
  231. package/script/types/0_chat_action_type.d.ts +0 -13
  232. package/script/types/0_chat_action_type.d.ts.map +1 -1
  233. package/script/types/0_chat_administrator_rights.d.ts +4 -4
  234. package/script/types/0_chat_administrator_rights.d.ts.map +1 -1
  235. package/script/types/0_code_check_result.d.ts +0 -3
  236. package/script/types/0_code_check_result.d.ts.map +1 -1
  237. package/script/types/0_emoji_status.d.ts +0 -2
  238. package/script/types/0_emoji_status.d.ts.map +1 -1
  239. package/script/types/0_gift_component_rarity.d.ts +0 -5
  240. package/script/types/0_gift_component_rarity.d.ts.map +1 -1
  241. package/script/types/0_id.d.ts +1 -3
  242. package/script/types/0_id.d.ts.map +1 -1
  243. package/{esm/types/1_inline_query_result_button.d.ts → script/types/0_inline_query_result_button.d.ts} +3 -4
  244. package/script/types/0_inline_query_result_button.d.ts.map +1 -0
  245. package/script/types/0_input_emoji_status.d.ts +0 -2
  246. package/script/types/0_input_emoji_status.d.ts.map +1 -1
  247. package/script/types/0_password_check_result.d.ts +0 -2
  248. package/script/types/0_password_check_result.d.ts.map +1 -1
  249. package/script/types/0_premium_subscription_duration.d.ts +1 -0
  250. package/script/types/0_premium_subscription_duration.d.ts.map +1 -1
  251. package/script/types/0_reaction.d.ts +0 -3
  252. package/script/types/0_reaction.d.ts.map +1 -1
  253. package/script/types/0_user_status.d.ts +3 -8
  254. package/script/types/0_user_status.d.ts.map +1 -1
  255. package/script/types/0_video_chat.d.ts +0 -3
  256. package/script/types/0_video_chat.d.ts.map +1 -1
  257. package/script/types/1_available_reactions.d.ts +0 -3
  258. package/script/types/1_available_reactions.d.ts.map +1 -1
  259. package/script/types/1_bot_command_scope.d.ts +1 -8
  260. package/script/types/1_bot_command_scope.d.ts.map +1 -1
  261. package/script/types/1_chat_p.d.ts +1 -7
  262. package/script/types/1_chat_p.d.ts.map +1 -1
  263. package/script/types/1_inline_keyboard_button.d.ts +25 -42
  264. package/script/types/1_inline_keyboard_button.d.ts.map +1 -1
  265. package/script/types/1_inline_keyboard_button.js +57 -64
  266. package/script/types/1_input_gift.d.ts +0 -3
  267. package/script/types/1_input_gift.d.ts.map +1 -1
  268. package/script/types/1_input_story_content.d.ts +2 -2
  269. package/script/types/1_input_story_content.d.ts.map +1 -1
  270. package/script/types/1_keyboard_button.d.ts +33 -34
  271. package/script/types/1_keyboard_button.d.ts.map +1 -1
  272. package/script/types/1_keyboard_button.js +81 -88
  273. package/script/types/1_order_info.d.ts +1 -1
  274. package/script/types/2_chat.d.ts +1 -3
  275. package/script/types/2_chat.d.ts.map +1 -1
  276. package/script/types/2_chat_member.d.ts +6 -24
  277. package/script/types/2_chat_member.d.ts.map +1 -1
  278. package/script/types/2_message_entity.d.ts +0 -20
  279. package/script/types/2_message_entity.d.ts.map +1 -1
  280. package/script/types/{0_keyboard_button_poll_type.d.ts → 2_profile_photo_list.d.ts} +10 -5
  281. package/script/types/2_profile_photo_list.d.ts.map +1 -0
  282. package/script/types/{0_mini_app_button_info.js → 2_profile_photo_list.js} +7 -3
  283. package/script/types/2_reply_markup.d.ts +5 -13
  284. package/script/types/2_reply_markup.d.ts.map +1 -1
  285. package/script/types/2_reply_markup.js +13 -17
  286. package/script/types/2_star_transaction_peer.d.ts +0 -8
  287. package/script/types/2_star_transaction_peer.d.ts.map +1 -1
  288. package/script/types/2_story_album_icon.d.ts +0 -2
  289. package/script/types/2_story_album_icon.d.ts.map +1 -1
  290. package/script/types/2_story_content.d.ts +3 -4
  291. package/script/types/2_story_content.d.ts.map +1 -1
  292. package/script/types/2_story_content.js +3 -3
  293. package/script/types/2_story_privacy.d.ts +8 -9
  294. package/script/types/2_story_privacy.d.ts.map +1 -1
  295. package/script/types/2_story_privacy.js +23 -20
  296. package/script/types/3_checklist_item.d.ts +2 -8
  297. package/script/types/3_checklist_item.d.ts.map +1 -1
  298. package/script/types/3_forward_header.d.ts +0 -5
  299. package/script/types/3_forward_header.d.ts.map +1 -1
  300. package/script/types/3_gift_upgraded_component.d.ts +0 -4
  301. package/script/types/3_gift_upgraded_component.d.ts.map +1 -1
  302. package/script/types/3_inline_query.d.ts.map +1 -1
  303. package/script/types/3_inline_query.js +3 -2
  304. package/script/types/3_input_media.d.ts +10 -20
  305. package/script/types/3_input_media.d.ts.map +1 -1
  306. package/script/types/3_invite_link.d.ts +0 -2
  307. package/script/types/3_invite_link.d.ts.map +1 -1
  308. package/script/types/3_invite_link.js +3 -4
  309. package/script/types/4_gift.d.ts +1 -3
  310. package/script/types/4_gift.d.ts.map +1 -1
  311. package/script/types/4_reply_to.d.ts +6 -14
  312. package/script/types/4_reply_to.d.ts.map +1 -1
  313. package/script/types/5_gift_upgraded_information.d.ts +1 -1
  314. package/script/types/5_gift_upgraded_information.d.ts.map +1 -1
  315. package/script/types/5_gift_upgraded_information.js +2 -2
  316. package/script/types/5_link_preview.d.ts +2 -18
  317. package/script/types/5_link_preview.d.ts.map +1 -1
  318. package/script/types/6_message.d.ts +91 -180
  319. package/script/types/6_message.d.ts.map +1 -1
  320. package/script/types/6_message.js +106 -122
  321. package/script/types/6_message_content.d.ts +2 -7
  322. package/script/types/6_message_content.d.ts.map +1 -1
  323. package/script/types/7_inline_query_result.d.ts +10 -47
  324. package/script/types/7_inline_query_result.d.ts.map +1 -1
  325. package/script/types/7_inline_query_result.js +219 -152
  326. package/script/types/7_topic.js +3 -3
  327. package/script/types/8_update.d.ts +59 -106
  328. package/script/types/8_update.d.ts.map +1 -1
  329. package/script/utilities/0_int.d.ts +1 -3
  330. package/script/utilities/0_int.d.ts.map +1 -1
  331. package/script/utilities/1_logger.js +1 -1
  332. package/esm/types/0_keyboard_button_poll_type.d.ts.map +0 -1
  333. package/esm/types/0_mini_app_button_info.d.ts +0 -26
  334. package/esm/types/0_mini_app_button_info.d.ts.map +0 -1
  335. package/esm/types/1_inline_query_result_button.d.ts.map +0 -1
  336. package/esm/types/1_inline_query_result_button.js +0 -20
  337. package/script/types/0_keyboard_button_poll_type.d.ts.map +0 -1
  338. package/script/types/0_mini_app_button_info.d.ts +0 -26
  339. package/script/types/0_mini_app_button_info.d.ts.map +0 -1
  340. package/script/types/1_inline_query_result_button.d.ts.map +0 -1
  341. package/script/types/1_inline_query_result_button.js +0 -21
  342. /package/esm/types/{0_keyboard_button_poll_type.js → 0_inline_query_result_button.js} +0 -0
  343. /package/script/types/{0_keyboard_button_poll_type.js → 0_inline_query_result_button.js} +0 -0
@@ -21,7 +21,6 @@ import { Api } from "../2_tl.js";
21
21
  import type { UsernameResolver } from "./_getters.js";
22
22
  import { type ButtonStyle } from "./0_button_style.js";
23
23
  import type { LoginUrl } from "./0_login_url.js";
24
- import { type MiniAppButtonInfo } from "./0_mini_app_button_info.js";
25
24
  /** @unlisted */
26
25
  export interface _InlineKeyboardButtonBase {
27
26
  /** The text of the button. */
@@ -33,10 +32,8 @@ export interface _InlineKeyboardButtonBase {
33
32
  * @unlisted
34
33
  */
35
34
  export interface InlineKeyboardButtonURL extends _InlineKeyboardButtonBase {
36
- /**
37
- * The URL to open.
38
- * @discriminator
39
- */
35
+ /** The URL to open. */
36
+ type: "url";
40
37
  url: string;
41
38
  }
42
39
  /**
@@ -44,10 +41,8 @@ export interface InlineKeyboardButtonURL extends _InlineKeyboardButtonBase {
44
41
  * @unlisted
45
42
  */
46
43
  export interface InlineKeyboardButtonCallback extends _InlineKeyboardButtonBase {
47
- /**
48
- * The callback data to send back.
49
- * @discriminator
50
- */
44
+ type: "callbackData";
45
+ /** The callback data to send back. */
51
46
  callbackData: string;
52
47
  }
53
48
  /**
@@ -56,21 +51,17 @@ export interface InlineKeyboardButtonCallback extends _InlineKeyboardButtonBase
56
51
  */
57
52
  /** @unlisted */
58
53
  export interface InlineKeyboardButtonMiniApp extends _InlineKeyboardButtonBase {
59
- /**
60
- * The mini app to launch.
61
- * @discriminator
62
- */
63
- miniApp: MiniAppButtonInfo;
54
+ type: "miniApp";
55
+ /** An HTTPS URL of the mini app to be opened with additional data. */
56
+ url: string;
64
57
  }
65
58
  /**
66
59
  * An inline keyboard button that, when pressed, logs the user into the specified URL.
67
60
  * @unlisted
68
61
  */
69
62
  export interface InlineKeyboardButtonLogin extends _InlineKeyboardButtonBase {
70
- /**
71
- * The URL to log into.
72
- * @discriminator
73
- */
63
+ type: "loginUrl";
64
+ /** The URL to log into. */
74
65
  loginUrl: LoginUrl;
75
66
  }
76
67
  /**
@@ -78,60 +69,52 @@ export interface InlineKeyboardButtonLogin extends _InlineKeyboardButtonBase {
78
69
  * @unlisted
79
70
  */
80
71
  export interface InlineKeyboardButtonSwitchInline extends _InlineKeyboardButtonBase {
81
- /**
82
- * The query to type into the user's message box once switched to inline.
83
- * @discriminator
84
- */
85
- switchInlineQuery: string;
72
+ type: "switchInlineQuery";
73
+ /** The query to type into the user's message box once switched to inline. */
74
+ inlineQuery: string;
86
75
  }
87
76
  /**
88
77
  * An inline keyboard button that, when pressed, switches to inline mode in the current chat.
89
78
  * @unlisted
90
79
  */
91
80
  export interface InlineKeyboardButtonSwitchInlineCurrent extends _InlineKeyboardButtonBase {
92
- /**
93
- * The query to type into the user's message box once switched to inline.
94
- * @discriminator
95
- */
96
- switchInlineQueryCurrentChat: string;
81
+ type: "switchInlineQueryCurrentChat";
82
+ /** The query to type into the user's message box once switched to inline. */
83
+ inlineQuery: string;
97
84
  }
98
85
  /**
99
86
  * An inline keyboard button that, when pressed, switches to inline mode in a chat chosen by the user from a limited subset of chats.
100
87
  * @unlisted
101
88
  */
102
89
  export interface InlineKeyboardButtonSwitchInlineChosen extends _InlineKeyboardButtonBase {
103
- /** @discriminator */
104
- switchInlineQueryChosenChats: {
105
- query: string;
106
- allowUsers?: boolean;
107
- allowBots?: boolean;
108
- allowGroups?: boolean;
109
- allowChannels?: boolean;
110
- };
90
+ type: "switchInlineQueryChosenChats";
91
+ inlineQuery: string;
92
+ isUser?: boolean;
93
+ isBot?: boolean;
94
+ isGroup?: boolean;
95
+ isChannel?: boolean;
111
96
  }
112
97
  /**
113
98
  * An inline keyboard button that, when pressed, launches the bot's game.
114
99
  * @unlisted
115
100
  */
116
101
  export interface InlineKeyboardButtonGame extends _InlineKeyboardButtonBase {
117
- /** @discriminator */
118
- callbackGame: Record<never, never>;
102
+ type: "callbackGame";
119
103
  }
120
104
  /**
121
105
  * An inline keyboard that, when pressed, initiates a payment.
122
106
  * @unlisted
123
107
  */
124
108
  export interface InlineKeyboardButtonPay extends _InlineKeyboardButtonBase {
125
- /** @discriminator */
126
- pay: boolean;
109
+ type: "pay";
127
110
  }
128
111
  /**
129
112
  * An inline keyboard that, when pressed, copies the text inside its `copy` field.
130
113
  * @unlisted
131
114
  */
132
115
  export interface InlineKeyboardButtonCopy extends _InlineKeyboardButtonBase {
133
- /** @discriminator */
134
- copy: string;
116
+ type: "copy";
117
+ textToCopy: string;
135
118
  }
136
119
  /** A button of an inline keyboard. */
137
120
  export type InlineKeyboardButton = InlineKeyboardButtonURL | InlineKeyboardButtonCallback | InlineKeyboardButtonMiniApp | InlineKeyboardButtonLogin | InlineKeyboardButtonSwitchInline | InlineKeyboardButtonSwitchInlineCurrent | InlineKeyboardButtonSwitchInlineChosen | InlineKeyboardButtonGame | InlineKeyboardButtonPay | InlineKeyboardButtonCopy;
@@ -1 +1 @@
1
- {"version":3,"file":"1_inline_keyboard_button.d.ts","sourceRoot":"","sources":["../../src/types/1_inline_keyboard_button.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,KAAK,WAAW,EAA+C,MAAM,qBAAqB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AAyB;IACzE,qBAAqB;IACrB,YAAY,EAAE,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;CACpC;AAED;;;GAGG;AACH,MAAM,WAAW,uBAAwB,SAAQ,yBAAyB;IACxE,qBAAqB;IACrB,GAAG,EAAE,OAAO,CAAC;CACd;AAED;;;GAGG;AACH,MAAM,WAAW,wBAAyB,SAAQ,yBAAyB;IACzE,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,sCAAsC;AACtC,MAAM,MAAM,oBAAoB,GAC5B,uBAAuB,GACvB,4BAA4B,GAC5B,2BAA2B,GAC3B,yBAAyB,GACzB,gCAAgC,GAChC,uCAAuC,GACvC,sCAAsC,GACtC,wBAAwB,GACxB,uBAAuB,GACvB,wBAAwB,CAAC;AAE7B,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,GAAG,CAAC,cAAc,GAAG,oBAAoB,CAiC/F;AAED,wBAAsB,8BAA8B,CAAC,MAAM,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAgDlJ"}
1
+ {"version":3,"file":"1_inline_keyboard_button.d.ts","sourceRoot":"","sources":["../../src/types/1_inline_keyboard_button.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,KAAK,WAAW,EAA+C,MAAM,qBAAqB,CAAC;AACpG,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEjD,gBAAgB;AAChB,MAAM,WAAW,yBAAyB;IACxC,8BAA8B;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,WAAW,uBAAwB,SAAQ,yBAAyB;I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;;GAGG;AACH,MAAM,WAAW,wBAAyB,SAAQ,yBAAyB;IACzE,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,sCAAsC;AACtC,MAAM,MAAM,oBAAoB,GAC5B,uBAAuB,GACvB,4BAA4B,GAC5B,2BAA2B,GAC3B,yBAAyB,GACzB,gCAAgC,GAChC,uCAAuC,GACvC,sCAAsC,GACtC,wBAAwB,GACxB,uBAAuB,GACvB,wBAAwB,CAAC;AAE7B,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,GAAG,CAAC,cAAc,GAAG,oBAAoB,CAkC/F;AAED,wBAAsB,8BAA8B,CAAC,MAAM,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAqDlJ"}
@@ -22,44 +22,44 @@ import { InputError } from "../0_errors.js";
22
22
  import { cleanObject, decodeText, encodeText } from "../1_utilities.js";
23
23
  import { Api } from "../2_tl.js";
24
24
  import { buttonStyleToTlObject, constructButtonStyle } from "./0_button_style.js";
25
- import { constructMiniAppButtonInfo } from "./0_mini_app_button_info.js";
26
25
  export function constructInlineKeyboardButton(button_) {
26
+ const text = button_.text;
27
27
  const style = constructButtonStyle(button_.style);
28
28
  if (Api.is("keyboardButtonUrl", button_)) {
29
- return cleanObject({ text: button_.text, url: button_.url, style });
29
+ return cleanObject({ type: "url", text, style, url: button_.url });
30
30
  }
31
31
  else if (Api.is("keyboardButtonCallback", button_)) {
32
- return cleanObject({ text: button_.text, callbackData: decodeText(button_.data), style });
32
+ return cleanObject({ type: "callbackData", text, style, callbackData: decodeText(button_.data) });
33
33
  }
34
34
  else if (Api.is("keyboardButtonWebView", button_) || Api.is("keyboardButtonSimpleWebView", button_)) {
35
- return cleanObject({ text: button_.text, miniApp: constructMiniAppButtonInfo(button_.url), style });
35
+ return cleanObject({ type: "miniApp", text, style, url: button_.url });
36
36
  }
37
37
  else if (Api.is("keyboardButtonUrlAuth", button_)) {
38
- return cleanObject({ text: button_.text, loginUrl: { url: button_.url, forwardText: button_.fwd_text }, style });
38
+ return cleanObject({ type: "loginUrl", text, style, loginUrl: { url: button_.url, forwardText: button_.fwd_text } });
39
39
  }
40
40
  else if (Api.is("keyboardButtonSwitchInline", button_)) {
41
41
  if (button_.same_peer) {
42
- return cleanObject({ text: button_.text, switchInlineQueryCurrentChat: button_.query, style });
42
+ return cleanObject({ type: "switchInlineQueryCurrentChat", text, style, inlineQuery: button_.query });
43
43
  }
44
44
  else if (button_.peer_types && button_.peer_types.length) {
45
45
  const allowUsers = button_.peer_types.some((v) => v._ === "inlineQueryPeerTypeBotPM") || undefined;
46
46
  const allowBots = button_.peer_types.some((v) => v._ === "inlineQueryPeerTypeSameBotPM" || v._ === "inlineQueryPeerTypeBotPM") || undefined;
47
47
  const allowGroups = button_.peer_types.some((v) => v._ === "inlineQueryPeerTypeChat" || v._ === "inlineQueryPeerTypeMegagroup") || undefined;
48
48
  const allowChannels = button_.peer_types.some((v) => v._ === "inlineQueryPeerTypeBroadcast") || undefined;
49
- return cleanObject({ text: button_.text, switchInlineQueryChosenChats: { query: button_.query, allowUsers, allowBots, allowGroups, allowChannels }, style });
49
+ return cleanObject({ type: "switchInlineQueryChosenChats", text, style, inlineQuery: button_.query, allowUsers, allowBots, allowGroups, allowChannels });
50
50
  }
51
51
  else {
52
- return cleanObject({ text: button_.text, switchInlineQuery: button_.query, style });
52
+ return cleanObject({ type: "switchInlineQuery", text, style, inlineQuery: button_.query });
53
53
  }
54
54
  }
55
55
  else if (Api.is("keyboardButtonBuy", button_)) {
56
- return cleanObject({ text: button_.text, pay: true, style });
56
+ return cleanObject({ type: "pay", text, style });
57
57
  }
58
58
  else if (Api.is("keyboardButtonGame", button_)) {
59
- return cleanObject({ text: button_.text, callbackGame: {}, style });
59
+ return cleanObject({ type: "callbackGame", text, style });
60
60
  }
61
61
  else if (Api.is("keyboardButtonCopy", button_)) {
62
- return cleanObject({ text: button_.text, copy: button_.copy_text, style });
62
+ return cleanObject({ type: "copy", text, style, textToCopy: button_.copy_text });
63
63
  }
64
64
  else if (Api.is("keyboardButtonRequestPeer", button_)) {
65
65
  unreachable();
@@ -70,59 +70,52 @@ export function constructInlineKeyboardButton(button_) {
70
70
  }
71
71
  export async function inlineKeyboardButtonToTlObject(button, usernameResolver) {
72
72
  const style = buttonStyleToTlObject(button.style);
73
- if ("url" in button) {
74
- return { _: "keyboardButtonUrl", text: button.text, url: button.url, style };
75
- }
76
- else if ("callbackData" in button) {
77
- return { _: "keyboardButtonCallback", text: button.text, data: encodeText(button.callbackData), style };
78
- }
79
- else if ("miniApp" in button) {
80
- return { _: "keyboardButtonWebView", text: button.text, url: button.miniApp.url, style };
81
- }
82
- else if ("loginUrl" in button) {
83
- return {
84
- _: "inputKeyboardButtonUrlAuth",
85
- text: button.text,
86
- url: button.loginUrl.url,
87
- fwd_text: button.loginUrl.forwardText,
88
- bot: button.loginUrl.botUsername ? await usernameResolver(button.loginUrl.botUsername) : { _: "inputUserSelf" },
89
- request_write_access: button.loginUrl.requestWriteAccess || undefined,
90
- style,
91
- };
92
- }
93
- else if ("switchInlineQuery" in button) {
94
- return { _: "keyboardButtonSwitchInline", text: button.text, query: button.switchInlineQuery, style };
95
- }
96
- else if ("switchInlineQueryCurrentChat" in button) {
97
- return { _: "keyboardButtonSwitchInline", text: button.text, query: button.switchInlineQueryCurrentChat, same_peer: true, style };
98
- }
99
- else if ("switchInlineQueryChosenChats" in button) {
100
- const peerTypes = new Array();
101
- const { allowUsers, allowBots, allowGroups, allowChannels } = button.switchInlineQueryChosenChats;
102
- if (!allowUsers && !allowBots && !allowGroups && !allowChannels) {
103
- throw new InputError("switchInlineQueryChosenChats: At least one chat type must be allowed.");
104
- }
105
- if (allowUsers) {
106
- peerTypes.push({ _: "inlineQueryPeerTypeBotPM" });
107
- }
108
- if (allowBots) {
109
- peerTypes.push({ _: "inlineQueryPeerTypeSameBotPM" }, { _: "inlineQueryPeerTypeBotPM" });
73
+ switch (button.type) {
74
+ case "url":
75
+ return { _: "keyboardButtonUrl", text: button.text, url: button.url, style };
76
+ case "callbackData":
77
+ return { _: "keyboardButtonCallback", text: button.text, data: encodeText(button.callbackData), style };
78
+ case "miniApp":
79
+ return { _: "keyboardButtonWebView", text: button.text, url: button.url, style };
80
+ case "loginUrl":
81
+ return {
82
+ _: "inputKeyboardButtonUrlAuth",
83
+ text: button.text,
84
+ url: button.loginUrl.url,
85
+ fwd_text: button.loginUrl.forwardText,
86
+ bot: button.loginUrl.botUsername ? await usernameResolver(button.loginUrl.botUsername) : { _: "inputUserSelf" },
87
+ request_write_access: button.loginUrl.requestWriteAccess || undefined,
88
+ style,
89
+ };
90
+ case "switchInlineQuery":
91
+ return { _: "keyboardButtonSwitchInline", text: button.text, query: button.inlineQuery, style };
92
+ case "switchInlineQueryCurrentChat":
93
+ return { _: "keyboardButtonSwitchInline", text: button.text, query: button.inlineQuery, same_peer: true, style };
94
+ case "switchInlineQueryChosenChats": {
95
+ const peerTypes = new Array();
96
+ const { isUser, isBot, isGroup, isChannel } = button;
97
+ if (!isUser && !isBot && !isGroup && !isChannel) {
98
+ throw new InputError("switchInlineQueryChosenChats: At least one chat type must be allowed.");
99
+ }
100
+ if (isUser) {
101
+ peerTypes.push({ _: "inlineQueryPeerTypeBotPM" });
102
+ }
103
+ if (isBot) {
104
+ peerTypes.push({ _: "inlineQueryPeerTypeSameBotPM" }, { _: "inlineQueryPeerTypeBotPM" });
105
+ }
106
+ if (isGroup) {
107
+ peerTypes.push({ _: "inlineQueryPeerTypeChat" }, { _: "inlineQueryPeerTypeMegagroup" });
108
+ }
109
+ if (isChannel) {
110
+ peerTypes.push({ _: "inlineQueryPeerTypeBroadcast" });
111
+ }
112
+ return { _: "keyboardButtonSwitchInline", text: button.text, query: button.inlineQuery, peer_types: peerTypes, style };
110
113
  }
111
- if (allowGroups) {
112
- peerTypes.push({ _: "inlineQueryPeerTypeChat" }, { _: "inlineQueryPeerTypeMegagroup" });
113
- }
114
- if (allowChannels) {
115
- peerTypes.push({ _: "inlineQueryPeerTypeBroadcast" });
116
- }
117
- return { _: "keyboardButtonSwitchInline", text: button.text, query: button.switchInlineQueryChosenChats.query, peer_types: peerTypes, style };
118
- }
119
- else if ("pay" in button) {
120
- return { _: "keyboardButtonBuy", text: button.text, style };
121
- }
122
- else if ("copy" in button) {
123
- return { _: "keyboardButtonCopy", text: button.text, copy_text: button.copy, style };
124
- }
125
- else {
126
- unreachable();
114
+ case "callbackGame":
115
+ return { _: "keyboardButtonGame", text: button.text, style };
116
+ case "pay":
117
+ return { _: "keyboardButtonBuy", text: button.text, style };
118
+ case "copy":
119
+ return { _: "keyboardButtonCopy", text: button.text, copy_text: button.textToCopy, style };
127
120
  }
128
121
  }
@@ -25,7 +25,6 @@ import type { ID } from "./0_id.js";
25
25
  * @unlisted
26
26
  */
27
27
  export interface InputGiftSlug {
28
- /** @discriminator */
29
28
  type: "slug";
30
29
  slug: string;
31
30
  }
@@ -34,7 +33,6 @@ export interface InputGiftSlug {
34
33
  * @unlisted
35
34
  */
36
35
  export interface InputGiftChat {
37
- /** @discriminator */
38
36
  type: "chat";
39
37
  chatId: ID;
40
38
  id: string;
@@ -44,7 +42,6 @@ export interface InputGiftChat {
44
42
  * @unlisted
45
43
  */
46
44
  export interface InputGiftUser {
47
- /** @discriminator */
48
45
  type: "user";
49
46
  messageId: number;
50
47
  }
@@ -1 +1 @@
1
- {"version":3,"file":"1_input_gift.d.ts","sourceRoot":"","sources":["../../src/types/1_input_gift.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AAEpC;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,qBAAqB;IACrB,IAAI,EAA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mB,CAAC,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,eAAe,GAAG,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAW9H"}
@@ -20,13 +20,13 @@
20
20
  import type { FileSource } from "./0_file_source.js";
21
21
  /** @unlisted */
22
22
  export interface InputStoryContentPhoto {
23
- /** @discriminator */
23
+ type: "photo";
24
24
  photo: FileSource;
25
25
  attachedStickerFileIds?: string[];
26
26
  }
27
27
  /** @unlisted */
28
28
  export interface InputStoryContentVideo {
29
- /** @discriminator */
29
+ type: "video";
30
30
  video: FileSource;
31
31
  attachedStickerFileIds?: string[];
32
32
  duration: number;
@@ -1 +1 @@
1
- {"version":3,"file":"1_input_story_content.d.ts","sourceRoot":"","sources":["../../src/types/1_input_story_content.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,gBAAgB;AAChB,MAAM,WAAW,sBAAsB;IACrC,qBAAqB;IACrB,KAAK,EAAE,UAAU,CAAC;IAClB,sBAAsB,CAAC,EAAE,MAAM,EAAE,CAAC;CACnC;AAED,gBAAgB;AAChB,MAAM,WAAW,sBAAsB;IACrC,qBAAqB;IACrB,KAAK,EAAE,UAAU,CAAC;IAClB,sBAAsB,CAAC,EAAE,MAAM,EAAE,CAAC;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,iDAAiD;AACjD,MAAM,MAAM,iBAAiB,GAAG,sBAAsB,GAAG,sBAAsB,CAAC"}
1
+ {"version":3,"file":"1_input_story_content.d.ts","sourceRoot":"","sources":["../../src/types/1_input_story_content.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,gBAAgB;AAChB,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,UAAU,CAAC;IAClB,sBAAsB,CAAC,EAAE,MAAM,EAAE,CAAC;CACnC;AAED,gBAAgB;AAChB,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,UAAU,CAAC;IAClB,sBAAsB,CAAC,EAAE,MAAM,EAAE,CAAC;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,iDAAiD;AACjD,MAAM,MAAM,iBAAiB,GAAG,sBAAsB,GAAG,sBAAsB,CAAC"}
@@ -20,56 +20,55 @@
20
20
  import { Api } from "../2_tl.js";
21
21
  import { type ButtonStyle } from "./0_button_style.js";
22
22
  import { type ChatAdministratorRights } from "./0_chat_administrator_rights.js";
23
- import type { KeyboardButtonPollType } from "./0_keyboard_button_poll_type.js";
24
- import type { MiniAppButtonInfo } from "./0_mini_app_button_info.js";
23
+ /** @unlisted */
24
+ export interface _KeyboardButtonBase {
25
+ text: string;
26
+ style?: ButtonStyle;
27
+ }
25
28
  /** @unlisted */
26
29
  export interface KeyboardButtonText {
27
- /** @discriminator */
30
+ type: "text";
28
31
  text: string;
29
32
  style?: ButtonStyle;
30
33
  }
31
34
  /** @unlisted */
32
- export interface KeyboardButtonRequestUser extends KeyboardButtonText {
33
- /** @discriminator */
34
- requestUser: {
35
- requestId: number;
36
- isBot?: boolean;
37
- isPremium?: boolean;
38
- };
35
+ export interface KeyboardButtonRequestUser extends _KeyboardButtonBase {
36
+ type: "requestUser";
37
+ requestId: number;
38
+ isBot?: boolean;
39
+ isPremium?: boolean;
39
40
  }
40
41
  /** @unlisted */
41
- export interface KeyboardButtonRequestChat extends KeyboardButtonText {
42
- /** @discriminator */
43
- requestChat: {
44
- requestId: number;
45
- isChannel: boolean;
46
- isForum?: boolean;
47
- hasUsername?: boolean;
48
- isOwner?: boolean;
49
- userAdministratorRights?: ChatAdministratorRights;
50
- botAdministratorRights?: ChatAdministratorRights;
51
- isBotMember?: boolean;
52
- };
42
+ export interface KeyboardButtonRequestChat extends _KeyboardButtonBase {
43
+ type: "requestChat";
44
+ requestId: number;
45
+ isChannel: boolean;
46
+ isForum?: boolean;
47
+ hasUsername?: boolean;
48
+ isOwner?: boolean;
49
+ userAdministratorRights?: ChatAdministratorRights;
50
+ botAdministratorRights?: ChatAdministratorRights;
51
+ isBotMember?: boolean;
53
52
  }
54
53
  /** @unlisted */
55
- export interface KeyboardButtonRequestContact extends KeyboardButtonText {
56
- /** @discriminator */
57
- requestContact: true;
54
+ export interface KeyboardButtonRequestContact extends _KeyboardButtonBase {
55
+ type: "requestContact";
58
56
  }
59
57
  /** @unlisted */
60
- export interface KeyboardButtonRequestLocation extends KeyboardButtonText {
61
- /** @discriminator */
62
- requestLocation: true;
58
+ export interface KeyboardButtonRequestLocation extends _KeyboardButtonBase {
59
+ type: "requestLocation";
63
60
  }
64
61
  /** @unlisted */
65
- export interface KeyboardButtonRequestPoll extends KeyboardButtonText {
66
- /** @discriminator */
67
- requestPoll: KeyboardButtonPollType;
62
+ export interface KeyboardButtonRequestPoll extends _KeyboardButtonBase {
63
+ type: "requestPoll";
64
+ /** If a type is not specified, the user will be allowed to choose either type. */
65
+ pollType?: "regular" | "quiz";
68
66
  }
69
67
  /** @unlisted */
70
- export interface KeyboardButtonMiniApp extends KeyboardButtonText {
71
- /** @discriminator */
72
- miniApp: MiniAppButtonInfo;
68
+ export interface KeyboardButtonMiniApp extends _KeyboardButtonBase {
69
+ type: "miniApp";
70
+ /** An HTTPS URL of the mini app to be opened with additional data. */
71
+ url: string;
73
72
  }
74
73
  /** A button of a custom keyboard. */
75
74
  export type KeyboardButton = KeyboardButtonText | KeyboardButtonRequestUser | KeyboardButtonRequestChat | KeyboardButtonRequestContact | KeyboardButtonRequestLocation | KeyboardButtonRequestPoll | KeyboardButtonMiniApp;
@@ -1 +1 @@
1
- {"version":3,"file":"1_keyboard_button.d.ts","sourceRoot":"","sources":["../../src/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