@mtkruto/node 0.1.191 → 0.1.200

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 (173) hide show
  1. package/esm/1_utilities.d.ts +1 -1
  2. package/esm/1_utilities.js +1 -1
  3. package/esm/2_tl.d.ts +6 -6
  4. package/esm/2_tl.js +6 -6
  5. package/esm/3_storage.d.ts +5 -5
  6. package/esm/3_storage.js +5 -5
  7. package/esm/3_types.d.ts +6 -5
  8. package/esm/3_types.js +6 -5
  9. package/esm/4_constants.d.ts +2 -2
  10. package/esm/4_constants.js +2 -2
  11. package/esm/5_client.d.ts +1 -1
  12. package/esm/5_client.js +1 -1
  13. package/esm/client/0_params.d.ts +7 -1
  14. package/esm/client/0_types.d.ts +1 -0
  15. package/esm/client/0_utilities.d.ts +0 -3
  16. package/esm/client/0_utilities.js +0 -20
  17. package/esm/client/1_business_connection_manager.d.ts +11 -0
  18. package/esm/client/1_business_connection_manager.js +47 -0
  19. package/esm/client/1_update_manager.d.ts +8 -1
  20. package/esm/client/1_update_manager.js +88 -8
  21. package/esm/client/2_message_manager.d.ts +7 -6
  22. package/esm/client/2_message_manager.js +48 -31
  23. package/esm/client/4_client.d.ts +421 -420
  24. package/esm/client/4_client.js +565 -516
  25. package/esm/storage/0_storage.d.ts +5 -0
  26. package/esm/storage/0_storage.js +20 -0
  27. package/esm/storage/{1_storage_indexed_db.js → 2_storage_indexed_db.js} +1 -1
  28. package/esm/storage/{1_storage_local_storage.js → 2_storage_local_storage.js} +1 -1
  29. package/{script/storage/1_storage_memory.d.ts → esm/storage/2_storage_memory.d.ts} +1 -4
  30. package/esm/storage/{1_storage_memory.js → 2_storage_memory.js} +8 -28
  31. package/esm/storage/{1_storage_session_storage.js → 2_storage_session_storage.js} +1 -1
  32. package/esm/tl/2_types.d.ts +1071 -183
  33. package/esm/tl/2_types.js +2916 -464
  34. package/esm/tl/3_functions.d.ts +381 -17
  35. package/esm/tl/3_functions.js +1002 -120
  36. package/{script/tl/4_tl_writer.d.ts → esm/tl/5_tl_writer.d.ts} +1 -1
  37. package/{script/tl/4_rpc_result.d.ts → esm/tl/6_rpc_result.d.ts} +1 -1
  38. package/esm/tl/{4_rpc_result.js → 6_rpc_result.js} +1 -1
  39. package/esm/tl/{6_message.d.ts → 7_message.d.ts} +2 -2
  40. package/esm/tl/{6_message.js → 7_message.js} +3 -3
  41. package/esm/tl/{7_message_container.d.ts → 8_message_container.d.ts} +1 -1
  42. package/esm/tl/{7_message_container.js → 8_message_container.js} +3 -3
  43. package/esm/types/0_chat_photo.js +1 -1
  44. package/esm/types/0_message_entity.d.ts +1 -1
  45. package/esm/types/0_thumbnail.js +1 -1
  46. package/esm/types/1_bot_command_scope.d.ts +1 -1
  47. package/esm/types/1_photo.js +2 -2
  48. package/esm/types/1_story_privacy.d.ts +1 -1
  49. package/esm/types/2_business_connection.d.ts +11 -0
  50. package/esm/types/2_business_connection.js +12 -0
  51. package/esm/types/2_chat_member.d.ts +1 -1
  52. package/esm/types/2_chosen_inline_result.d.ts +1 -1
  53. package/esm/types/2_game.js +1 -1
  54. package/esm/types/2_inline_keyboard_button.d.ts +1 -1
  55. package/esm/types/2_inline_query.d.ts +1 -1
  56. package/esm/types/2_invite_link.d.ts +1 -1
  57. package/esm/types/2_message_reaction_count.d.ts +1 -1
  58. package/esm/types/2_message_reactions.d.ts +1 -1
  59. package/esm/types/2_story_content.js +1 -1
  60. package/{script/types/1_story_interactive_area.d.ts → esm/types/2_story_interactive_area.d.ts} +2 -2
  61. package/esm/types/{1_story_interactive_area.js → 2_story_interactive_area.js} +1 -1
  62. package/esm/types/3_chat_member_updated.d.ts +1 -1
  63. package/esm/types/3_reply_markup.d.ts +1 -1
  64. package/esm/types/3_story.d.ts +2 -2
  65. package/esm/types/3_story.js +1 -1
  66. package/esm/types/4_inline_query_result.d.ts +1 -1
  67. package/esm/types/4_inline_query_result.js +1 -1
  68. package/esm/types/4_message.d.ts +9 -3
  69. package/esm/types/4_message.js +22 -5
  70. package/esm/types/5_callback_query.d.ts +1 -1
  71. package/esm/types/5_chat.d.ts +1 -1
  72. package/esm/types/6_update.d.ts +12 -2
  73. package/package.json +1 -1
  74. package/script/1_utilities.d.ts +1 -1
  75. package/script/1_utilities.js +1 -1
  76. package/script/2_tl.d.ts +6 -6
  77. package/script/2_tl.js +6 -6
  78. package/script/3_storage.d.ts +5 -5
  79. package/script/3_storage.js +5 -5
  80. package/script/3_types.d.ts +6 -5
  81. package/script/3_types.js +6 -5
  82. package/script/4_constants.d.ts +2 -2
  83. package/script/4_constants.js +2 -2
  84. package/script/5_client.d.ts +1 -1
  85. package/script/5_client.js +1 -1
  86. package/script/client/0_params.d.ts +7 -1
  87. package/script/client/0_types.d.ts +1 -0
  88. package/script/client/0_utilities.d.ts +0 -3
  89. package/script/client/0_utilities.js +1 -23
  90. package/script/client/1_business_connection_manager.d.ts +11 -0
  91. package/script/client/1_business_connection_manager.js +51 -0
  92. package/script/client/1_update_manager.d.ts +8 -1
  93. package/script/client/1_update_manager.js +88 -8
  94. package/script/client/2_message_manager.d.ts +7 -6
  95. package/script/client/2_message_manager.js +47 -30
  96. package/script/client/4_client.d.ts +421 -420
  97. package/script/client/4_client.js +565 -516
  98. package/script/storage/0_storage.d.ts +5 -0
  99. package/script/storage/0_storage.js +20 -0
  100. package/script/storage/{1_storage_indexed_db.js → 2_storage_indexed_db.js} +7 -7
  101. package/script/storage/{1_storage_local_storage.js → 2_storage_local_storage.js} +10 -10
  102. package/{esm/storage/1_storage_memory.d.ts → script/storage/2_storage_memory.d.ts} +1 -4
  103. package/script/storage/{1_storage_memory.js → 2_storage_memory.js} +12 -32
  104. package/script/storage/{1_storage_session_storage.js → 2_storage_session_storage.js} +10 -10
  105. package/script/tl/2_types.d.ts +1071 -183
  106. package/script/tl/2_types.js +3028 -504
  107. package/script/tl/3_functions.d.ts +381 -17
  108. package/script/tl/3_functions.js +1047 -143
  109. package/{esm/tl/4_tl_writer.d.ts → script/tl/5_tl_writer.d.ts} +1 -1
  110. package/{esm/tl/4_rpc_result.d.ts → script/tl/6_rpc_result.d.ts} +1 -1
  111. package/script/tl/{4_rpc_result.js → 6_rpc_result.js} +2 -2
  112. package/script/tl/{6_message.d.ts → 7_message.d.ts} +2 -2
  113. package/script/tl/{6_message.js → 7_message.js} +8 -8
  114. package/script/tl/{7_message_container.d.ts → 8_message_container.d.ts} +1 -1
  115. package/script/tl/{7_message_container.js → 8_message_container.js} +7 -7
  116. package/script/types/0_chat_photo.js +9 -9
  117. package/script/types/0_message_entity.d.ts +1 -1
  118. package/script/types/0_thumbnail.js +6 -6
  119. package/script/types/1_bot_command_scope.d.ts +1 -1
  120. package/script/types/1_photo.js +7 -7
  121. package/script/types/1_story_privacy.d.ts +1 -1
  122. package/script/types/2_business_connection.d.ts +11 -0
  123. package/script/types/2_business_connection.js +16 -0
  124. package/script/types/2_chat_member.d.ts +1 -1
  125. package/script/types/2_chosen_inline_result.d.ts +1 -1
  126. package/script/types/2_game.js +3 -3
  127. package/script/types/2_inline_keyboard_button.d.ts +1 -1
  128. package/script/types/2_inline_query.d.ts +1 -1
  129. package/script/types/2_invite_link.d.ts +1 -1
  130. package/script/types/2_message_reaction_count.d.ts +1 -1
  131. package/script/types/2_message_reactions.d.ts +1 -1
  132. package/script/types/2_story_content.js +4 -4
  133. package/{esm/types/1_story_interactive_area.d.ts → script/types/2_story_interactive_area.d.ts} +2 -2
  134. package/script/types/{1_story_interactive_area.js → 2_story_interactive_area.js} +2 -2
  135. package/script/types/3_chat_member_updated.d.ts +1 -1
  136. package/script/types/3_reply_markup.d.ts +1 -1
  137. package/script/types/3_story.d.ts +2 -2
  138. package/script/types/3_story.js +2 -2
  139. package/script/types/4_inline_query_result.d.ts +1 -1
  140. package/script/types/4_inline_query_result.js +2 -2
  141. package/script/types/4_message.d.ts +9 -3
  142. package/script/types/4_message.js +37 -20
  143. package/script/types/5_callback_query.d.ts +1 -1
  144. package/script/types/5_chat.d.ts +1 -1
  145. package/script/types/6_update.d.ts +12 -2
  146. /package/esm/storage/{0_utilities.d.ts → 1_utilities.d.ts} +0 -0
  147. /package/esm/storage/{0_utilities.js → 1_utilities.js} +0 -0
  148. /package/esm/storage/{1_storage_indexed_db.d.ts → 2_storage_indexed_db.d.ts} +0 -0
  149. /package/esm/storage/{1_storage_local_storage.d.ts → 2_storage_local_storage.d.ts} +0 -0
  150. /package/esm/storage/{1_storage_session_storage.d.ts → 2_storage_session_storage.d.ts} +0 -0
  151. /package/esm/tl/{3_tl_reader.d.ts → 4_tl_reader.d.ts} +0 -0
  152. /package/esm/tl/{3_tl_reader.js → 4_tl_reader.js} +0 -0
  153. /package/esm/tl/{4_tl_writer.js → 5_tl_writer.js} +0 -0
  154. /package/esm/types/{0_venue.d.ts → 1_venue.d.ts} +0 -0
  155. /package/esm/types/{0_venue.js → 1_venue.js} +0 -0
  156. /package/esm/types/{0__file_id.d.ts → _file_id.d.ts} +0 -0
  157. /package/esm/types/{0__file_id.js → _file_id.js} +0 -0
  158. /package/esm/types/{1__getters.d.ts → _getters.d.ts} +0 -0
  159. /package/esm/types/{1__getters.js → _getters.js} +0 -0
  160. /package/script/storage/{0_utilities.d.ts → 1_utilities.d.ts} +0 -0
  161. /package/script/storage/{0_utilities.js → 1_utilities.js} +0 -0
  162. /package/script/storage/{1_storage_indexed_db.d.ts → 2_storage_indexed_db.d.ts} +0 -0
  163. /package/script/storage/{1_storage_local_storage.d.ts → 2_storage_local_storage.d.ts} +0 -0
  164. /package/script/storage/{1_storage_session_storage.d.ts → 2_storage_session_storage.d.ts} +0 -0
  165. /package/script/tl/{3_tl_reader.d.ts → 4_tl_reader.d.ts} +0 -0
  166. /package/script/tl/{3_tl_reader.js → 4_tl_reader.js} +0 -0
  167. /package/script/tl/{4_tl_writer.js → 5_tl_writer.js} +0 -0
  168. /package/script/types/{0_venue.d.ts → 1_venue.d.ts} +0 -0
  169. /package/script/types/{0_venue.js → 1_venue.js} +0 -0
  170. /package/script/types/{0__file_id.d.ts → _file_id.d.ts} +0 -0
  171. /package/script/types/{0__file_id.js → _file_id.js} +0 -0
  172. /package/script/types/{1__getters.d.ts → _getters.d.ts} +0 -0
  173. /package/script/types/{1__getters.js → _getters.js} +0 -0
@@ -2,9 +2,9 @@ import { MaybePromise } from "../1_utilities.js";
2
2
  import { enums, functions, types } from "../2_tl.js";
3
3
  import { Storage } from "../3_storage.js";
4
4
  import { DC } from "../3_transport.js";
5
- import { BotCommand, Chat, ChatAction, ChatMember, ChatP, FileSource, ID, InactiveChat, InlineQueryResult, InputStoryContent, InviteLink, Message, MessageAnimation, MessageAudio, MessageContact, MessageDice, MessageDocument, MessageLocation, MessagePhoto, MessagePoll, MessageSticker, MessageText, MessageVenue, MessageVideo, MessageVideoNote, MessageVoice, NetworkStatistics, ParseMode, Poll, Reaction, Sticker, Story, Update, User } from "../3_types.js";
5
+ import { BotCommand, BusinessConnection, Chat, ChatAction, ChatMember, ChatP, FileSource, ID, InactiveChat, InlineQueryResult, InputStoryContent, InviteLink, Message, MessageAnimation, MessageAudio, MessageContact, MessageDice, MessageDocument, MessageLocation, MessagePhoto, MessagePoll, MessageSticker, MessageText, MessageVenue, MessageVideo, MessageVideoNote, MessageVoice, NetworkStatistics, ParseMode, Poll, Reaction, Sticker, Story, Update, User } from "../3_types.js";
6
6
  import { Migrate } from "../4_errors.js";
7
- import { AddReactionParams, AnswerCallbackQueryParams, AnswerInlineQueryParams, AuthorizeUserParams, BanChatMemberParams, CreateInviteLinkParams, CreateStoryParams, DeleteMessageParams, DeleteMessagesParams, DownloadParams, EditMessageLiveLocationParams, EditMessageParams, EditMessageReplyMarkupParams, ForwardMessagesParams, GetChatsParams, GetCreatedInviteLinksParams, GetHistoryParams, GetMyCommandsParams, PinMessageParams, ReplyParams, SearchMessagesParams, SendAnimationParams, SendAudioParams, SendContactParams, SendDiceParams, SendDocumentParams, SendLocationParams, SendMessageParams, SendPhotoParams, SendPollParams, SendStickerParams, SendVenueParams, SendVideoNoteParams, SendVideoParams, SendVoiceParams, SetChatMemberRightsParams, SetChatPhotoParams, SetMyCommandsParams, SetReactionsParams, StopPollParams, UploadParams } from "./0_params.js";
7
+ import { AddReactionParams, AnswerCallbackQueryParams, AnswerInlineQueryParams, AuthorizeUserParams, BanChatMemberParams, CreateInviteLinkParams, CreateStoryParams, DeleteMessageParams, DeleteMessagesParams, DownloadParams, EditMessageLiveLocationParams, EditMessageParams, EditMessageReplyMarkupParams, ForwardMessagesParams, GetChatsParams, GetCreatedInviteLinksParams, GetHistoryParams, GetMyCommandsParams, PinMessageParams, ReplyParams, SearchMessagesParams, SendAnimationParams, SendAudioParams, SendContactParams, SendDiceParams, SendDocumentParams, SendLocationParams, SendMessageParams, SendPhotoParams, SendPollParams, SendStickerParams, SendVenueParams, SendVideoNoteParams, SendVideoParams, SendVoiceParams, SetChatMemberRightsParams, SetChatPhotoParams, SetMyCommandsParams, SetReactionsParams, StopPollParams } from "./0_params.js";
8
8
  import { Api } from "./0_types.js";
9
9
  import { ClientPlainParams } from "./1_client_plain.js";
10
10
  import { Composer as Composer_, NextFunction } from "./1_composer.js";
@@ -21,34 +21,35 @@ export interface Context {
21
21
  from?: User;
22
22
  /** Resolves to `msg?.senderChat`. */
23
23
  senderChat?: ChatP;
24
+ toJSON: () => Update;
24
25
  /** Context-aware alias for `client.sendMessage()`. */
25
- reply: (text: string, params?: Omit<SendMessageParams, "replyToMessageId"> & ReplyParams) => Promise<MessageText>;
26
+ reply: (text: string, params?: Omit<SendMessageParams, "replyToMessageId" | "businessConnectionId"> & ReplyParams) => Promise<MessageText>;
26
27
  /** Context-aware alias for `client.sendPoll()`. */
27
- replyPoll: (question: string, options: [string, string, ...string[]], params?: Omit<SendPollParams, "replyToMessageId"> & ReplyParams) => Promise<MessagePoll>;
28
+ replyPoll: (question: string, options: [string, string, ...string[]], params?: Omit<SendPollParams, "replyToMessageId" | "businessConnectionId"> & ReplyParams) => Promise<MessagePoll>;
28
29
  /** Context-aware alias for `client.sendPhoto()`. */
29
- replyPhoto: (photo: FileSource, params?: Omit<SendPhotoParams, "replyToMessageId"> & ReplyParams) => Promise<MessagePhoto>;
30
+ replyPhoto: (photo: FileSource, params?: Omit<SendPhotoParams, "replyToMessageId" | "businessConnectionId"> & ReplyParams) => Promise<MessagePhoto>;
30
31
  /** Context-aware alias for `client.sendDocument()`. */
31
- replyDocument: (document: FileSource, params?: Omit<SendDocumentParams, "replyToMessageId"> & ReplyParams) => Promise<MessageDocument>;
32
+ replyDocument: (document: FileSource, params?: Omit<SendDocumentParams, "replyToMessageId" | "businessConnectionId"> & ReplyParams) => Promise<MessageDocument>;
32
33
  /** Context-aware alias for `client.sendSticker()`. */
33
- replySticker: (sticker: FileSource, params?: Omit<SendStickerParams, "replyToMessageId"> & ReplyParams) => Promise<MessageSticker>;
34
+ replySticker: (sticker: FileSource, params?: Omit<SendStickerParams, "replyToMessageId" | "businessConnectionId"> & ReplyParams) => Promise<MessageSticker>;
34
35
  /** Context-aware alias for `client.sendLocation()`. */
35
- replyLocation: (latitude: number, longitude: number, params?: Omit<SendLocationParams, "replyToMessageId"> & ReplyParams) => Promise<MessageLocation>;
36
+ replyLocation: (latitude: number, longitude: number, params?: Omit<SendLocationParams, "replyToMessageId" | "businessConnectionId"> & ReplyParams) => Promise<MessageLocation>;
36
37
  /** Context-aware alias for `client.sendDice()`. */
37
- replyDice: (params?: Omit<SendDiceParams, "replyToMessageId"> & ReplyParams) => Promise<MessageDice>;
38
+ replyDice: (params?: Omit<SendDiceParams, "replyToMessageId" | "businessConnectionId"> & ReplyParams) => Promise<MessageDice>;
38
39
  /** Context-aware alias for `client.sendVenue()`. */
39
- replyVenue: (latitude: number, longitude: number, title: string, address: string, params?: Omit<SendVenueParams, "replyToMessageId"> & ReplyParams) => Promise<MessageVenue>;
40
+ replyVenue: (latitude: number, longitude: number, title: string, address: string, params?: Omit<SendVenueParams, "replyToMessageId" | "businessConnectionId"> & ReplyParams) => Promise<MessageVenue>;
40
41
  /** Context-aware alias for `client.sendContact()`. */
41
- replyContact: (firstName: string, number: string, params?: Omit<SendContactParams, "replyToMessageId"> & ReplyParams) => Promise<MessageContact>;
42
+ replyContact: (firstName: string, number: string, params?: Omit<SendContactParams, "replyToMessageId" | "businessConnectionId"> & ReplyParams) => Promise<MessageContact>;
42
43
  /** Context-aware alias for `client.sendVideo()`. */
43
- replyVideo: (video: FileSource, params?: Omit<SendVideoParams, "replyToMessageId"> & ReplyParams) => Promise<MessageVideo>;
44
+ replyVideo: (video: FileSource, params?: Omit<SendVideoParams, "replyToMessageId" | "businessConnectionId"> & ReplyParams) => Promise<MessageVideo>;
44
45
  /** Context-aware alias for `client.sendAnimation()`. */
45
- replyAnimation: (animation: FileSource, params?: Omit<SendAnimationParams, "replyToMessageId"> & ReplyParams) => Promise<MessageAnimation>;
46
+ replyAnimation: (animation: FileSource, params?: Omit<SendAnimationParams, "replyToMessageId" | "businessConnectionId"> & ReplyParams) => Promise<MessageAnimation>;
46
47
  /** Context-aware alias for `client.sendVoice()`. */
47
- replyVoice: (voice: FileSource, params?: Omit<SendVoiceParams, "replyToMessageId"> & ReplyParams) => Promise<MessageVoice>;
48
+ replyVoice: (voice: FileSource, params?: Omit<SendVoiceParams, "replyToMessageId" | "businessConnectionId"> & ReplyParams) => Promise<MessageVoice>;
48
49
  /** Context-aware alias for `client.sendAudio()`. */
49
- replyAudio: (audio: FileSource, params?: Omit<SendAudioParams, "replyToMessageId"> & ReplyParams) => Promise<MessageAudio>;
50
+ replyAudio: (audio: FileSource, params?: Omit<SendAudioParams, "replyToMessageId" | "businessConnectionId"> & ReplyParams) => Promise<MessageAudio>;
50
51
  /** Context-aware alias for `client.sendPoll()`. */
51
- replyVideoNote: (videoNote: FileSource, params?: Omit<SendVideoNoteParams, "replyToMessageId"> & ReplyParams) => Promise<MessageVideoNote>;
52
+ replyVideoNote: (videoNote: FileSource, params?: Omit<SendVideoNoteParams, "replyToMessageId" | "businessConnectionId"> & ReplyParams) => Promise<MessageVideoNote>;
52
53
  /** Context-aware alias for `client.deleteMessage()`. */
53
54
  delete: () => Promise<void>;
54
55
  /** Context-aware alias for `client.forwardMessage()`. */
@@ -147,7 +148,8 @@ export interface Context {
147
148
  setChatStickerSet: (setName: string) => Promise<void>;
148
149
  /** Context-aware alias for `client.deleteChatStickerSet()`. */
149
150
  deleteChatStickerSet: () => Promise<void>;
150
- toJSON: () => Update;
151
+ /** Context-aware alias for `client.getBusinessConnection()`. */
152
+ getBusinessConnection: () => Promise<BusinessConnection>;
151
153
  }
152
154
  export declare class Composer<C extends Context = Context> extends Composer_<C> {
153
155
  }
@@ -294,6 +296,51 @@ export declare class Client<C extends Context = Context> extends Composer<C> {
294
296
  private [getEntity];
295
297
  private [getEntity];
296
298
  private [getEntity];
299
+ /**
300
+ * Get information on the currently authorized user.
301
+ *
302
+ * @method ac
303
+ */
304
+ getMe(): Promise<User>;
305
+ /**
306
+ * Show a username in the current account, a bot account, a supergroup, or a channel's profile. User-only.
307
+ *
308
+ * @method ac
309
+ * @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
310
+ * @param username The username to show.
311
+ */
312
+ showUsername(id: ID, username: string): Promise<void>;
313
+ /**
314
+ * Hide a username from the current account, a bot account, a supergroup, or a channel's profile. User-only.
315
+ *
316
+ * @method ac
317
+ * @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
318
+ * @param username The username to hide.
319
+ */
320
+ hideUsername(id: ID, username: string): Promise<void>;
321
+ /**
322
+ * Reorder the usernames of the current account, a bot account, a supergroup, or a channel's profile. User-only.
323
+ *
324
+ * @method ac
325
+ * @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
326
+ * @param order The new order to use.
327
+ * @returns Whether the order was changed.
328
+ */
329
+ reorderUsernames(id: ID, order: string[]): Promise<boolean>;
330
+ /**
331
+ * Hide all usernames from the a supergroup or a channel's profile. User-only.
332
+ *
333
+ * @method ac
334
+ * @param id A supergroup ID or a channel ID.
335
+ */
336
+ hideUsernames(id: ID): Promise<boolean>;
337
+ /**
338
+ * Get a business connection. Bot-only.
339
+ *
340
+ * @method ac
341
+ * @param id The identifier of the business connection.
342
+ */
343
+ getBusinessConnection(id: string): Promise<BusinessConnection>;
297
344
  /**
298
345
  * Send a text message.
299
346
  *
@@ -303,6 +350,128 @@ export declare class Client<C extends Context = Context> extends Composer<C> {
303
350
  * @returns The sent text message.
304
351
  */
305
352
  sendMessage(chatId: ID, text: string, params?: SendMessageParams): Promise<MessageText>;
353
+ /**
354
+ * Send a photo.
355
+ *
356
+ * @method ms
357
+ * @param chatId The chat to send the photo to.
358
+ * @param photo The photo to send.
359
+ * @returns The sent photo.
360
+ */
361
+ sendPhoto(chatId: ID, photo: FileSource, params?: SendPhotoParams): Promise<MessagePhoto>;
362
+ /**
363
+ * Send a document.
364
+ *
365
+ * @method ms
366
+ * @param chatId The chat to send the document to.
367
+ * @param document The document to send.
368
+ * @returns The sent document.
369
+ */
370
+ sendDocument(chatId: ID, document: FileSource, params?: SendDocumentParams): Promise<MessageDocument>;
371
+ /**
372
+ * Send a sticker.
373
+ *
374
+ * @method ms
375
+ * @param chatId The chat to send the sticker to.
376
+ * @param document The sticker to send.
377
+ * @returns The sent sticker.
378
+ */
379
+ sendSticker(chatId: ID, sticker: FileSource, params?: SendStickerParams): Promise<MessageSticker>;
380
+ /**
381
+ * Send a video.
382
+ *
383
+ * @method ms
384
+ * @param chatId The chat to send the video to.
385
+ * @param video The video to send.
386
+ * @returns The sent video.
387
+ */
388
+ sendVideo(chatId: ID, video: FileSource, params?: SendVideoParams): Promise<MessageVideo>;
389
+ /**
390
+ * Send an animation.
391
+ *
392
+ * @method ms
393
+ * @param chatId The chat to send the animation to.
394
+ * @param animation The animation to send.
395
+ * @returns The sent animation.
396
+ */
397
+ sendAnimation(chatId: ID, animation: FileSource, params?: SendAnimationParams): Promise<MessageAnimation>;
398
+ /**
399
+ * Send a voice message.
400
+ *
401
+ * @method ms
402
+ * @param chatId The chat to send the voice message to.
403
+ * @param voice The voice to send.
404
+ * @returns The sent voice message.
405
+ */
406
+ sendVoice(chatId: ID, voice: FileSource, params?: SendVoiceParams): Promise<MessageVoice>;
407
+ /**
408
+ * Send an audio file.
409
+ *
410
+ * @method ms
411
+ * @param chatId The chat to send the audio file to.
412
+ * @param audio The audio to send.
413
+ * @returns The sent audio filr.
414
+ */
415
+ sendAudio(chatId: ID, audio: FileSource, params?: SendAudioParams): Promise<MessageAudio>;
416
+ /**
417
+ * Send a video note.
418
+ *
419
+ * @method ms
420
+ * @param chatId The chat to send the video note to.
421
+ * @param videoNote The video note to send.
422
+ * @returns The sent video note.
423
+ */
424
+ sendVideoNote(chatId: ID, videoNote: FileSource, params?: SendVideoNoteParams): Promise<MessageVideoNote>;
425
+ /**
426
+ * Send a location.
427
+ *
428
+ * @method ms
429
+ * @param chatId The chat to send the location to.
430
+ * @param latitude The location's latitude.
431
+ * @param longitude The location's longitude.
432
+ * @returns The sent location.
433
+ */
434
+ sendLocation(chatId: ID, latitude: number, longitude: number, params?: SendLocationParams): Promise<MessageLocation>;
435
+ /**
436
+ * Send a contact.
437
+ *
438
+ * @method ms
439
+ * @param chatId The chat to send the contact to.
440
+ * @param firstName The contact's first name.
441
+ * @param number The contact's phone number.
442
+ * @returns The sent contact.
443
+ */
444
+ sendContact(chatId: ID, firstName: string, number: string, params?: SendContactParams): Promise<MessageContact>;
445
+ /**
446
+ * Send a dice.
447
+ *
448
+ * @method ms
449
+ * @param chatId The chat to send the dice to.
450
+ * @returns The sent dice.
451
+ */
452
+ sendDice(chatId: ID, params?: SendDiceParams): Promise<MessageDice>;
453
+ /**
454
+ * Send a venue.
455
+ *
456
+ * @method ms
457
+ * @param chatId The chat to send the venue to.
458
+ * @param latitude The latitude of the venue.
459
+ * @param longitude The longitude of the venue.
460
+ * @param title The title of the venue.
461
+ * @param address The written address of the venue.
462
+ * @returns The sent venue.
463
+ */
464
+ sendVenue(chatId: ID, latitude: number, longitude: number, title: string, address: string, params?: SendVenueParams): Promise<MessageVenue>;
465
+ /**
466
+ * Send a poll.
467
+ *
468
+ * @method ms
469
+ * @param chatId The chat to send the poll to.
470
+ * @param question The poll's question.
471
+ * @param options The poll's options.
472
+ * @returns The sent poll.
473
+ */
474
+ sendPoll(chatId: ID, question: string, options: [string, string, ...string[]], params?: SendPollParams): Promise<MessagePoll>;
306
475
  /**
307
476
  * Edit a message's text.
308
477
  *
@@ -383,18 +552,52 @@ export declare class Client<C extends Context = Context> extends Composer<C> {
383
552
  */
384
553
  getMessage(chatId: ID, messageId: number): Promise<Message | null>;
385
554
  /**
386
- * Download a file.
555
+ * Delete multiple messages.
387
556
  *
388
- * @method fs
389
- * @param fileId The identifier of the file to download.
390
- * @example ```ts
391
- * for await (const chunk of client.download(fileId, { chunkSize: 256 * 1024 })) {
392
- * await outFile.write(chunk);
393
- * }
394
- * ```
395
- * @returns A generator yielding the contents of the file.
557
+ * @method ms
558
+ * @param chatId The identifier of the chat that contains the messages.
559
+ * @param messageIds The identifiers of the messages to delete.
396
560
  */
397
- download(fileId: string, params?: DownloadParams): AsyncGenerator<Uint8Array, void, unknown>;
561
+ deleteMessages(chatId: ID, messageIds: number[], params?: DeleteMessagesParams): Promise<void>;
562
+ /**
563
+ * Delete a single message.
564
+ *
565
+ * @method ms
566
+ * @param chatId The identifier of the chat that contains the message.
567
+ * @param messageId The identifier of the message to delete.
568
+ */
569
+ deleteMessage(chatId: ID, messageId: number, params?: DeleteMessageParams): Promise<void>;
570
+ /**
571
+ * Delete all messages sent by a specific member of a chat. User-only.
572
+ *
573
+ * @method ms
574
+ * @param chatId The identifier of the chat. Must be a supergroup.
575
+ * @param memberId The identifier of the member.
576
+ */
577
+ deleteChatMemberMessages(chatId: ID, memberId: ID): Promise<void>;
578
+ /**
579
+ * Pin a message in a chat.
580
+ *
581
+ * @method ms
582
+ * @param chatId The identifier of the chat that contains the message.
583
+ * @param messageId The message's identifier.
584
+ */
585
+ pinMessage(chatId: ID, messageId: number, params?: PinMessageParams): Promise<void>;
586
+ /**
587
+ * Unpin a pinned message.
588
+ *
589
+ * @method ms
590
+ * @param chatId The identifier of the chat that contains the message.
591
+ * @param messageId The message's identifier.
592
+ */
593
+ unpinMessage(chatId: ID, messageId: number): Promise<void>;
594
+ /**
595
+ * Unpin all pinned messages.
596
+ *
597
+ * @method ms
598
+ * @param chatId The identifier of the chat.
599
+ */
600
+ unpinMessages(chatId: ID): Promise<void>;
398
601
  /**
399
602
  * Forward multiple messages.
400
603
  *
@@ -415,29 +618,6 @@ export declare class Client<C extends Context = Context> extends Composer<C> {
415
618
  * @returns The forwarded message.
416
619
  */
417
620
  forwardMessage(from: ID, to: ID, messageId: number, params?: ForwardMessagesParams): Promise<Message>;
418
- /**
419
- * Get information on the currently authorized user.
420
- *
421
- * @method ac
422
- */
423
- getMe(): Promise<User>;
424
- /**
425
- * Answer a callback query. Bot-only.
426
- *
427
- * @method cq
428
- * @param id ID of the callback query to answer.
429
- */
430
- answerCallbackQuery(id: string, params?: AnswerCallbackQueryParams): Promise<void>;
431
- /**
432
- * Send a poll.
433
- *
434
- * @method ms
435
- * @param chatId The chat to send the poll to.
436
- * @param question The poll's question.
437
- * @param options The poll's options.
438
- * @returns The sent poll.
439
- */
440
- sendPoll(chatId: ID, question: string, options: [string, string, ...string[]], params?: SendPollParams): Promise<MessagePoll>;
441
621
  /**
442
622
  * Stop a poll.
443
623
  *
@@ -459,258 +639,281 @@ export declare class Client<C extends Context = Context> extends Composer<C> {
459
639
  messageThreadId?: number;
460
640
  }): Promise<void>;
461
641
  /**
462
- * Upload a file.
642
+ * Search the messages of a chat. User-only.
463
643
  *
464
- * @method fs
465
- * @param contents The contents of the file.
466
- * @returns The uploaded file.
644
+ * @method ms
645
+ * @param chatId The identifier of the chat to search the messages in.
646
+ * @param query The message search query.
467
647
  */
468
- upload(contents: Uint8Array, params?: UploadParams): Promise<any>;
648
+ searchMessages(chatId: ID, query: string, params?: SearchMessagesParams): Promise<Message[]>;
469
649
  /**
470
- * Set the bot's commands in the given scope and/or language. Bot-only.
650
+ * Download a file.
471
651
  *
472
- * @method bs
473
- * @param commands The commands to set.
474
- */
475
- setMyCommands(commands: BotCommand[], params?: SetMyCommandsParams): Promise<void>;
476
- /**
477
- * Get the bot's commands in the given scope and/or language. Bot-only.
652
+ * @method fs
653
+ * @param fileId The identifier of the file to download.
654
+ * @example ```ts
655
+ * for await (const chunk of client.download(fileId, { chunkSize: 256 * 1024 })) {
656
+ * await outFile.write(chunk);
657
+ * }
658
+ * ```
659
+ * @returns A generator yielding the contents of the file.
660
+ */
661
+ download(fileId: string, params?: DownloadParams): AsyncGenerator<Uint8Array, void, unknown>;
662
+ /**
663
+ * Get custom emoji documents for download.
478
664
  *
479
- * @method bs
480
- * @returns The current bot's commands in the specified language.
665
+ * @method fs
666
+ * @param id Identifier of one or more of custom emojis.
667
+ * @returns The custom emoji documents.
481
668
  */
482
- getMyCommands(params?: GetMyCommandsParams): Promise<BotCommand[]>;
669
+ getCustomEmojiStickers(id: string | string[]): Promise<Sticker[]>;
483
670
  /**
484
- * Answer an inline query. Bot-only.
671
+ * Get chats from a chat list. User-only.
485
672
  *
486
- * @method iq
487
- * @param id The ID of the inline query to answer.
488
- * @param results The results to answer with.
673
+ * @method ch
489
674
  */
490
- answerInlineQuery(id: string, results: InlineQueryResult[], params?: AnswerInlineQueryParams): Promise<void>;
675
+ getChats(params?: GetChatsParams): Promise<Chat[]>;
491
676
  /**
492
- * Set the bot's description in the given language. Bot-only.
677
+ * Get a chat.
493
678
  *
494
- * @method bs
679
+ * @method ch
495
680
  */
496
- setMyDescription(params?: {
497
- description?: string;
498
- languageCode?: string;
499
- }): Promise<void>;
681
+ getChat(chatId: ID): Promise<Chat>;
500
682
  /**
501
- * Set the bot's name in the given language. Bot-only.
683
+ * Get chat history. User-only.
502
684
  *
503
- * @method bs
685
+ * @method ch
686
+ * @param chatId The identifier of the chat to get its history.
504
687
  */
505
- setMyName(params?: {
506
- name?: string;
507
- languageCode?: string;
508
- }): Promise<void>;
688
+ getHistory(chatId: ID, params?: GetHistoryParams): Promise<Message[]>;
509
689
  /**
510
- * Set the bot's short description in the given language. Bot-only.
690
+ * Set a chat's available reactions. User-only.
511
691
  *
512
- * @method bs
692
+ * @method ch
693
+ * @param chatId The identifier of the chat.
694
+ * @param availableReactions The new available reactions.
513
695
  */
514
- setMyShortDescription(params?: {
515
- shortDescription?: string;
516
- languageCode?: string;
517
- }): Promise<void>;
696
+ setAvailableReactions(chatId: ID, availableReactions: "none" | "all" | Reaction[]): Promise<void>;
518
697
  /**
519
- * Get the bot's description in the given language. Bot-only.
698
+ * Set a chat's photo.
520
699
  *
521
- * @method bs
522
- * @returns The current bot's description in the specified language.
700
+ * @method ch
701
+ * @param chatId The identifier of the chat.
702
+ * @param photo A photo to set as the chat's photo.
523
703
  */
524
- getMyDescription(params?: {
525
- languageCode?: string;
526
- }): Promise<string>;
704
+ setChatPhoto(chatId: number, photo: FileSource, params?: SetChatPhotoParams): Promise<void>;
527
705
  /**
528
- * Get the bot's name in the given language. Bot-only.
706
+ * Delete a chat's photo.
529
707
  *
530
- * @method bs
531
- * @returns The current bot's name in the specified language.
708
+ * @method ch
709
+ * @param chatId The identifier of the chat.
532
710
  */
533
- getMyName(params?: {
534
- languageCode?: string;
535
- }): Promise<string>;
711
+ deleteChatPhoto(chatId: number): Promise<void>;
536
712
  /**
537
- * Get the bot's short description in the given language. Bot-only.
713
+ * Ban a member from a chat.
538
714
  *
539
- * @method bs
540
- * @returns The current bot's short description in the specified language.
715
+ * @method ch
716
+ * @param chatId The identifier of the chat.
717
+ * @param memberId The identifier of the member.
541
718
  */
542
- getMyShortDescription(params?: {
543
- languageCode?: string;
544
- }): Promise<string>;
719
+ banChatMember(chatId: ID, memberId: ID, params?: BanChatMemberParams): Promise<void>;
545
720
  /**
546
- * Delete multiple messages.
721
+ * Unban a member from a chat.
547
722
  *
548
- * @method ms
549
- * @param chatId The identifier of the chat that contains the messages.
550
- * @param messageIds The identifiers of the messages to delete.
723
+ * @method ch
724
+ * @param chatId The identifier of the chat. Must be a supergroup.
725
+ * @param memberId The identifier of the member.
551
726
  */
552
- deleteMessages(chatId: ID, messageIds: number[], params?: DeleteMessagesParams): Promise<void>;
727
+ unbanChatMember(chatId: ID, memberId: ID): Promise<void>;
553
728
  /**
554
- * Delete a single message.
729
+ * Kick a member from a chat. Same as a banChatMember call followed by unbanChatMember.
555
730
  *
556
- * @method ms
557
- * @param chatId The identifier of the chat that contains the message.
558
- * @param messageId The identifier of the message to delete.
731
+ * @method ch
732
+ * @param chatId The identifier of the chat. Must be a supergroup.
733
+ * @param memberId The identifier of the member.
559
734
  */
560
- deleteMessage(chatId: ID, messageId: number, params?: DeleteMessageParams): Promise<void>;
735
+ kickChatMember(chatId: ID, memberId: ID): Promise<void>;
561
736
  /**
562
- * Send a photo.
737
+ * Set the rights of a chat member.
563
738
  *
564
- * @method ms
565
- * @param chatId The chat to send the photo to.
566
- * @param photo The photo to send.
567
- * @returns The sent photo.
739
+ * @method ch
740
+ * @param chatId The identifier of the chat. Must be a supergroup.
741
+ * @param memberId The identifier of a member.
568
742
  */
569
- sendPhoto(chatId: ID, photo: FileSource, params?: SendPhotoParams): Promise<MessagePhoto>;
743
+ setChatMemberRights(chatId: ID, memberId: ID, params?: SetChatMemberRightsParams): Promise<void>;
570
744
  /**
571
- * Send a document.
745
+ * Get the administrators of a chat.
572
746
  *
573
- * @method ms
574
- * @param chatId The chat to send the document to.
575
- * @param document The document to send.
576
- * @returns The sent document.
747
+ * @method ch
748
+ * @param chatId The identifier of the chat.
749
+ * @returns The chat's administrators.
577
750
  */
578
- sendDocument(chatId: ID, document: FileSource, params?: SendDocumentParams): Promise<MessageDocument>;
751
+ getChatAdministrators(chatId: ID): Promise<ChatMember[]>;
579
752
  /**
580
- * Send a sticker.
753
+ * Enable join requests in a chat. User-only.
581
754
  *
582
- * @method ms
583
- * @param chatId The chat to send the sticker to.
584
- * @param document The sticker to send.
585
- * @returns The sent sticker.
755
+ * @method ch
756
+ * @param chatId The identifier of the chat. Must be a channel or a supergroup.
586
757
  */
587
- sendSticker(chatId: ID, sticker: FileSource, params?: SendStickerParams): Promise<MessageSticker>;
758
+ enableJoinRequests(chatId: ID): Promise<void>;
588
759
  /**
589
- * Send a video.
760
+ * Disable join requests in a chat. User-only.
590
761
  *
591
- * @method ms
592
- * @param chatId The chat to send the video to.
593
- * @param video The video to send.
594
- * @returns The sent video.
762
+ * @method ch
763
+ * @param chatId The identifier of the chat. Must be a channel or a supergroup.
595
764
  */
596
- sendVideo(chatId: ID, video: FileSource, params?: SendVideoParams): Promise<MessageVideo>;
765
+ disableJoinRequests(chatId: ID): Promise<void>;
597
766
  /**
598
- * Send an animation.
767
+ * Get inactive chats. User-only.
599
768
  *
600
- * @method ms
601
- * @param chatId The chat to send the animation to.
602
- * @param animation The animation to send.
603
- * @returns The sent animation.
769
+ * @method ch
770
+ * @retuns A list of inactive chats the current user is member of.
604
771
  */
605
- sendAnimation(chatId: ID, animation: FileSource, params?: SendAnimationParams): Promise<MessageAnimation>;
772
+ getInactiveChats(): Promise<InactiveChat[]>;
606
773
  /**
607
- * Send a voice message.
774
+ * Get the invite links created for a chat. User-only.
608
775
  *
609
- * @method ms
610
- * @param chatId The chat to send the voice message to.
611
- * @param voice The voice to send.
612
- * @returns The sent voice message.
776
+ * @method ch
777
+ * @param chatId The identifier of the chat.
778
+ * @returns The invite links created for the chat. This might be a subset of the results if they were less than `limit`. The parameters `afterDate` and `afterInviteLink` can be used for pagination.
613
779
  */
614
- sendVoice(chatId: ID, voice: FileSource, params?: SendVoiceParams): Promise<MessageVoice>;
780
+ getCreatedInviteLinks(chatId: ID, params?: GetCreatedInviteLinksParams): Promise<InviteLink[]>;
615
781
  /**
616
- * Send an audio file.
782
+ * Join a chat. User-only.
617
783
  *
618
- * @method ms
619
- * @param chatId The chat to send the audio file to.
620
- * @param audio The audio to send.
621
- * @returns The sent audio filr.
784
+ * @method ch
785
+ * @param chatId The identifier of the chat to join.
622
786
  */
623
- sendAudio(chatId: ID, audio: FileSource, params?: SendAudioParams): Promise<MessageAudio>;
787
+ joinChat(chatId: ID): Promise<void>;
624
788
  /**
625
- * Send a video note.
789
+ * Leave a chat.
626
790
  *
627
- * @method ms
628
- * @param chatId The chat to send the video note to.
629
- * @param videoNote The video note to send.
630
- * @returns The sent video note.
791
+ * @method ch
792
+ * @param chatId The identifier of the chat to leave.
631
793
  */
632
- sendVideoNote(chatId: ID, videoNote: FileSource, params?: SendVideoNoteParams): Promise<MessageVideoNote>;
794
+ leaveChat(chatId: ID): Promise<void>;
633
795
  /**
634
- * Send a location.
796
+ * Get information on a user's chat membership.
635
797
  *
636
- * @method ms
637
- * @param chatId The chat to send the location to.
638
- * @param latitude The location's latitude.
639
- * @param longitude The location's longitude.
640
- * @returns The sent location.
798
+ * @method ch
799
+ * @param chatId The identifier of a chat that includes the user.
800
+ * @param userId The identifier of the user.
641
801
  */
642
- sendLocation(chatId: ID, latitude: number, longitude: number, params?: SendLocationParams): Promise<MessageLocation>;
802
+ getChatMember(chatId: ID, userId: ID): Promise<ChatMember>;
643
803
  /**
644
- * Send a contact.
804
+ * Set a chat's sticker set.
645
805
  *
646
- * @method ms
647
- * @param chatId The chat to send the contact to.
648
- * @param firstName The contact's first name.
649
- * @param number The contact's phone number.
650
- * @returns The sent contact.
806
+ * @method ch
807
+ * @param chatId The identifier of the chat. Must be a supergroup.
808
+ * @param setName The name of the set.
651
809
  */
652
- sendContact(chatId: ID, firstName: string, number: string, params?: SendContactParams): Promise<MessageContact>;
810
+ setChatStickerSet(chatId: ID, setName: string): Promise<void>;
653
811
  /**
654
- * Send a dice.
812
+ * Delete a chat's sticker set.
655
813
  *
656
- * @method ms
657
- * @param chatId The chat to send the dice to.
658
- * @returns The sent dice.
814
+ * @method ch
815
+ * @param chatId The identifier of the chat. Must be a supergroup.
659
816
  */
660
- sendDice(chatId: ID, params?: SendDiceParams): Promise<MessageDice>;
817
+ deleteChatStickerSet(chatId: ID): Promise<void>;
661
818
  /**
662
- * Send a venue.
819
+ * Set the number of boosts required to circument a chat's default restrictions. User-only.
663
820
  *
664
- * @method ms
665
- * @param chatId The chat to send the venue to.
666
- * @param latitude The latitude of the venue.
667
- * @param longitude The longitude of the venue.
668
- * @param title The title of the venue.
669
- * @param address The written address of the venue.
670
- * @returns The sent venue.
821
+ * @method ch
822
+ * @param chatId The identifier of the chat.
823
+ * @param boosts The number of boosts required to circumvent its restrictions.
671
824
  */
672
- sendVenue(chatId: ID, latitude: number, longitude: number, title: string, address: string, params?: SendVenueParams): Promise<MessageVenue>;
825
+ setBoostsRequiredToCircumventRestrictions(chatId: ID, boosts: number): Promise<void>;
673
826
  /**
674
- * Get network statistics. This might not always be available.
827
+ * Create an invite link.
675
828
  *
676
- * @method mc
829
+ * @method ch
830
+ * @param chatId The identifier of the chat to create the invite link for.
831
+ * @returns The newly created invite link.
677
832
  */
678
- getNetworkStatistics(): Promise<NetworkStatistics>;
833
+ createInviteLink(chatId: ID, params?: CreateInviteLinkParams): Promise<InviteLink>;
834
+ /**
835
+ * Answer a callback query. Bot-only.
836
+ *
837
+ * @method cq
838
+ * @param id ID of the callback query to answer.
839
+ */
840
+ answerCallbackQuery(id: string, params?: AnswerCallbackQueryParams): Promise<void>;
841
+ /**
842
+ * Answer an inline query. Bot-only.
843
+ *
844
+ * @method iq
845
+ * @param id The ID of the inline query to answer.
846
+ * @param results The results to answer with.
847
+ */
848
+ answerInlineQuery(id: string, results: InlineQueryResult[], params?: AnswerInlineQueryParams): Promise<void>;
849
+ /**
850
+ * Set the bot's description in the given language. Bot-only.
851
+ *
852
+ * @method bs
853
+ */
854
+ setMyDescription(params?: {
855
+ description?: string;
856
+ languageCode?: string;
857
+ }): Promise<void>;
858
+ /**
859
+ * Set the bot's name in the given language. Bot-only.
860
+ *
861
+ * @method bs
862
+ */
863
+ setMyName(params?: {
864
+ name?: string;
865
+ languageCode?: string;
866
+ }): Promise<void>;
867
+ /**
868
+ * Set the bot's short description in the given language. Bot-only.
869
+ *
870
+ * @method bs
871
+ */
872
+ setMyShortDescription(params?: {
873
+ shortDescription?: string;
874
+ languageCode?: string;
875
+ }): Promise<void>;
679
876
  /**
680
- * Get chats from a chat list. User-only.
877
+ * Get the bot's description in the given language. Bot-only.
681
878
  *
682
- * @method ch
879
+ * @method bs
880
+ * @returns The current bot's description in the specified language.
683
881
  */
684
- getChats(params?: GetChatsParams): Promise<Chat[]>;
882
+ getMyDescription(params?: {
883
+ languageCode?: string;
884
+ }): Promise<string>;
685
885
  /**
686
- * Get a chat.
886
+ * Get the bot's name in the given language. Bot-only.
687
887
  *
688
- * @method ch
888
+ * @method bs
889
+ * @returns The current bot's name in the specified language.
689
890
  */
690
- getChat(chatId: ID): Promise<Chat>;
891
+ getMyName(params?: {
892
+ languageCode?: string;
893
+ }): Promise<string>;
691
894
  /**
692
- * Get chat history. User-only.
895
+ * Get the bot's short description in the given language. Bot-only.
693
896
  *
694
- * @method ch
695
- * @param chatId The identifier of the chat to get its history.
897
+ * @method bs
898
+ * @returns The current bot's short description in the specified language.
696
899
  */
697
- getHistory(chatId: ID, params?: GetHistoryParams): Promise<Message[]>;
900
+ getMyShortDescription(params?: {
901
+ languageCode?: string;
902
+ }): Promise<string>;
698
903
  /**
699
- * Get custom emoji documents for download.
904
+ * Set the bot's commands in the given scope and/or language. Bot-only.
700
905
  *
701
- * @method fs
702
- * @param id Identifier of one or more of custom emojis.
703
- * @returns The custom emoji documents.
906
+ * @method bs
907
+ * @param commands The commands to set.
704
908
  */
705
- getCustomEmojiStickers(id: string | string[]): Promise<Sticker[]>;
909
+ setMyCommands(commands: BotCommand[], params?: SetMyCommandsParams): Promise<void>;
706
910
  /**
707
- * Set a chat's available reactions. User-only.
911
+ * Get the bot's commands in the given scope and/or language. Bot-only.
708
912
  *
709
- * @method ch
710
- * @param chatId The identifier of the chat.
711
- * @param availableReactions The new available reactions.
913
+ * @method bs
914
+ * @returns The current bot's commands in the specified language.
712
915
  */
713
- setAvailableReactions(chatId: ID, availableReactions: "none" | "all" | Reaction[]): Promise<void>;
916
+ getMyCommands(params?: GetMyCommandsParams): Promise<BotCommand[]>;
714
917
  /**
715
918
  * Change reactions made to a message.
716
919
  *
@@ -738,92 +941,6 @@ export declare class Client<C extends Context = Context> extends Composer<C> {
738
941
  * @param reaction The reaction to remove.
739
942
  */
740
943
  removeReaction(chatId: number, messageId: number, reaction: Reaction): Promise<void>;
741
- /**
742
- * Set a chat's photo.
743
- *
744
- * @method ch
745
- * @param chatId The identifier of the chat.
746
- * @param photo A photo to set as the chat's photo.
747
- */
748
- setChatPhoto(chatId: number, photo: FileSource, params?: SetChatPhotoParams): Promise<void>;
749
- /**
750
- * Delete a chat's photo.
751
- *
752
- * @method ch
753
- * @param chatId The identifier of the chat.
754
- */
755
- deleteChatPhoto(chatId: number): Promise<void>;
756
- /**
757
- * Delete all messages sent by a specific member of a chat. User-only.
758
- *
759
- * @method ms
760
- * @param chatId The identifier of the chat. Must be a supergroup.
761
- * @param memberId The identifier of the member.
762
- */
763
- deleteChatMemberMessages(chatId: ID, memberId: ID): Promise<void>;
764
- /**
765
- * Pin a message in a chat.
766
- *
767
- * @method ms
768
- * @param chatId The identifier of the chat that contains the message.
769
- * @param messageId The message's identifier.
770
- */
771
- pinMessage(chatId: ID, messageId: number, params?: PinMessageParams): Promise<void>;
772
- /**
773
- * Unpin a pinned message.
774
- *
775
- * @method ms
776
- * @param chatId The identifier of the chat that contains the message.
777
- * @param messageId The message's identifier.
778
- */
779
- unpinMessage(chatId: ID, messageId: number): Promise<void>;
780
- /**
781
- * Unpin all pinned messages.
782
- *
783
- * @method ms
784
- * @param chatId The identifier of the chat.
785
- */
786
- unpinMessages(chatId: ID): Promise<void>;
787
- /**
788
- * Ban a member from a chat.
789
- *
790
- * @method ch
791
- * @param chatId The identifier of the chat.
792
- * @param memberId The identifier of the member.
793
- */
794
- banChatMember(chatId: ID, memberId: ID, params?: BanChatMemberParams): Promise<void>;
795
- /**
796
- * Unban a member from a chat.
797
- *
798
- * @method ch
799
- * @param chatId The identifier of the chat. Must be a supergroup.
800
- * @param memberId The identifier of the member.
801
- */
802
- unbanChatMember(chatId: ID, memberId: ID): Promise<void>;
803
- /**
804
- * Kick a member from a chat. Same as a banChatMember call followed by unbanChatMember.
805
- *
806
- * @method ch
807
- * @param chatId The identifier of the chat. Must be a supergroup.
808
- * @param memberId The identifier of the member.
809
- */
810
- kickChatMember(chatId: ID, memberId: ID): Promise<void>;
811
- /**
812
- * Set the rights of a chat member.
813
- *
814
- * @method ch
815
- * @param chatId The identifier of the chat. Must be a supergroup.
816
- * @param memberId The identifier of a member.
817
- */
818
- setChatMemberRights(chatId: ID, memberId: ID, params?: SetChatMemberRightsParams): Promise<void>;
819
- /**
820
- * Get the administrators of a chat.
821
- *
822
- * @method ch
823
- * @param chatId The identifier of the chat.
824
- * @returns The chat's administrators.
825
- */
826
- getChatAdministrators(chatId: ID): Promise<ChatMember[]>;
827
944
  /**
828
945
  * Create a story. User-only.
829
946
  *
@@ -898,104 +1015,11 @@ export declare class Client<C extends Context = Context> extends Composer<C> {
898
1015
  */
899
1016
  removeStoryFromHighlights(chatId: ID, storyId: number): Promise<void>;
900
1017
  /**
901
- * Enable join requests in a chat. User-only.
902
- *
903
- * @method ch
904
- * @param chatId The identifier of the chat. Must be a channel or a supergroup.
905
- */
906
- enableJoinRequests(chatId: ID): Promise<void>;
907
- /**
908
- * Disable join requests in a chat. User-only.
909
- *
910
- * @method ch
911
- * @param chatId The identifier of the chat. Must be a channel or a supergroup.
912
- */
913
- disableJoinRequests(chatId: ID): Promise<void>;
914
- /**
915
- * Show a username in the current account, a bot account, sa upergroup, or a channel's profile. User-only.
916
- *
917
- * @method ac
918
- * @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
919
- * @param username The username to show.
920
- */
921
- showUsername(id: ID, username: string): Promise<void>;
922
- /**
923
- * Hide a username from the current account, a bot account, a supergroup, or a channel's profile. User-only.
924
- *
925
- * @method ac
926
- * @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
927
- * @param username The username to hide.
928
- */
929
- hideUsername(id: ID, username: string): Promise<void>;
930
- /**
931
- * Reorder the usernames of the current account, a bot account, a supergroup, or a channel's profile. User-only.
932
- *
933
- * @method ac
934
- * @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
935
- * @param order The new order to use.
936
- * @returns Whether the order was changed.
937
- */
938
- reorderUsernames(id: ID, order: string[]): Promise<boolean>;
939
- /**
940
- * Hide all usernames from the a supergroup or a channel's profile. User-only.
941
- *
942
- * @method ac
943
- * @param id A supergroup ID or a channel ID.
944
- */
945
- hideUsernames(id: ID): Promise<boolean>;
946
- /**
947
- * Get inactive chats. User-only.
948
- *
949
- * @method ch
950
- * @retuns A list of inactive chats the current user is member of.
951
- */
952
- getInactiveChats(): Promise<InactiveChat[]>;
953
- /**
954
- * Search the messages of a chat. User-only.
955
- *
956
- * @method ms
957
- * @param chatId The identifier of the chat to search the messages in.
958
- * @param query The message search query.
959
- */
960
- searchMessages(chatId: ID, query: string, params?: SearchMessagesParams): Promise<Message[]>;
961
- /**
962
- * Set the number of boosts required to circument a chat's default restrictions. User-only.
963
- *
964
- * @method ch
965
- * @param chatId The identifier of the chat.
966
- * @param boosts The number of boosts required to circumvent its restrictions.
967
- */
968
- setBoostsRequiredToCircumventRestrictions(chatId: ID, boosts: number): Promise<void>;
969
- /**
970
- * Create an invite link.
971
- *
972
- * @method ch
973
- * @param chatId The identifier of the chat to create the invite link for.
974
- * @returns The newly created invite link.
975
- */
976
- createInviteLink(chatId: ID, params?: CreateInviteLinkParams): Promise<InviteLink>;
977
- /**
978
- * Get the invite links created for a chat. User-only.
979
- *
980
- * @method ch
981
- * @param chatId The identifier of the chat.
982
- * @returns The invite links created for the chat. This might be a subset of the results if they were less than `limit`. The parameters `afterDate` and `afterInviteLink` can be used for pagination.
983
- */
984
- getCreatedInviteLinks(chatId: ID, params?: GetCreatedInviteLinksParams): Promise<InviteLink[]>;
985
- /**
986
- * Join a chat. User-only.
987
- *
988
- * @method ch
989
- * @param chatId The identifier of the chat to join.
990
- */
991
- joinChat(chatId: ID): Promise<void>;
992
- /**
993
- * Leave a chat.
1018
+ * Get network statistics. This might not always be available.
994
1019
  *
995
- * @method ch
996
- * @param chatId The identifier of the chat to leave.
1020
+ * @method mc
997
1021
  */
998
- leaveChat(chatId: ID): Promise<void>;
1022
+ getNetworkStatistics(): Promise<NetworkStatistics>;
999
1023
  /**
1000
1024
  * Block a user. User-only.
1001
1025
  *
@@ -1010,28 +1034,5 @@ export declare class Client<C extends Context = Context> extends Composer<C> {
1010
1034
  * @param userId The identifier of the user to unblock.
1011
1035
  */
1012
1036
  unblockUser(userId: ID): Promise<void>;
1013
- /**
1014
- * Get information on a user's chat membership.
1015
- *
1016
- * @method ch
1017
- * @param chatId The identifier of a chat that includes the user.
1018
- * @param userId The identifier of the user.
1019
- */
1020
- getChatMember(chatId: ID, userId: ID): Promise<ChatMember>;
1021
- /**
1022
- * Set a chat's sticker set.
1023
- *
1024
- * @method ch
1025
- * @param chatId The identifier of the chat. Must be a supergroup.
1026
- * @param setName The name of the set.
1027
- */
1028
- setChatStickerSet(chatId: ID, setName: string): Promise<void>;
1029
- /**
1030
- * Delete a chat's sticker set.
1031
- *
1032
- * @method ch
1033
- * @param chatId The identifier of the chat. Must be a supergroup.
1034
- */
1035
- deleteChatStickerSet(chatId: ID): Promise<void>;
1036
1037
  }
1037
1038
  export {};