@mtkruto/node 0.190.0 → 0.192.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 (133) hide show
  1. package/esm/3_types.d.ts +6 -2
  2. package/esm/3_types.d.ts.map +1 -1
  3. package/esm/3_types.js +6 -2
  4. package/esm/client/0_params.d.ts +10 -0
  5. package/esm/client/0_params.d.ts.map +1 -1
  6. package/esm/client/1_client_generic.d.ts +1168 -1075
  7. package/esm/client/1_client_generic.d.ts.map +1 -1
  8. package/esm/client/3_account_manager.d.ts +4 -0
  9. package/esm/client/3_account_manager.d.ts.map +1 -1
  10. package/esm/client/3_account_manager.js +20 -1
  11. package/esm/client/3_message_manager.d.ts +2 -1
  12. package/esm/client/3_message_manager.d.ts.map +1 -1
  13. package/esm/client/3_message_manager.js +7 -0
  14. package/esm/client/3_secret_chat_manager.d.ts +4 -1
  15. package/esm/client/3_secret_chat_manager.d.ts.map +1 -1
  16. package/esm/client/3_secret_chat_manager.js +31 -0
  17. package/esm/client/4_context.d.ts +12 -2
  18. package/esm/client/4_context.d.ts.map +1 -1
  19. package/esm/client/4_context.js +25 -0
  20. package/esm/client/4_forum_manager.d.ts +4 -1
  21. package/esm/client/4_forum_manager.d.ts.map +1 -1
  22. package/esm/client/4_forum_manager.js +33 -1
  23. package/esm/client/6_client.d.ts +1166 -1075
  24. package/esm/client/6_client.d.ts.map +1 -1
  25. package/esm/client/6_client.js +1528 -1413
  26. package/esm/client/6_client_dispatcher.d.ts +1168 -1075
  27. package/esm/client/6_client_dispatcher.d.ts.map +1 -1
  28. package/esm/client/6_client_dispatcher.js +1502 -1391
  29. package/esm/types/0_report_reason.d.ts +1 -0
  30. package/esm/types/0_report_reason.d.ts.map +1 -1
  31. package/esm/types/0_secret_chat_action_type.d.ts +69 -0
  32. package/esm/types/0_secret_chat_action_type.d.ts.map +1 -0
  33. package/esm/types/0_secret_chat_action_type.js +46 -0
  34. package/esm/types/0_story_report_option.d.ts +3 -0
  35. package/esm/types/0_story_report_option.d.ts.map +1 -1
  36. package/esm/types/1_chat_p.d.ts +1 -5
  37. package/esm/types/1_chat_p.d.ts.map +1 -1
  38. package/esm/types/1_story_report_result.d.ts +17 -3
  39. package/esm/types/1_story_report_result.d.ts.map +1 -1
  40. package/esm/types/2_secret_message.d.ts +1 -0
  41. package/esm/types/2_secret_message.d.ts.map +1 -1
  42. package/esm/types/3_bot_access_settings.d.ts +3 -0
  43. package/esm/types/3_bot_access_settings.d.ts.map +1 -1
  44. package/esm/types/3_connected_website.d.ts +45 -0
  45. package/esm/types/3_connected_website.d.ts.map +1 -0
  46. package/esm/types/3_connected_website.js +39 -0
  47. package/esm/types/3_poll_voter_list.d.ts +2 -1
  48. package/esm/types/3_poll_voter_list.d.ts.map +1 -1
  49. package/esm/types/3_text_to_translate.d.ts +3 -0
  50. package/esm/types/3_text_to_translate.d.ts.map +1 -1
  51. package/esm/types/3_translated_text.d.ts +3 -0
  52. package/esm/types/3_translated_text.d.ts.map +1 -1
  53. package/esm/types/9_message.d.ts +8 -1
  54. package/esm/types/9_message.d.ts.map +1 -1
  55. package/esm/types/9_message.js +3 -0
  56. package/esm/types/A_topic.d.ts +20 -3
  57. package/esm/types/A_topic.d.ts.map +1 -1
  58. package/esm/types/A_topic.js +37 -0
  59. package/esm/types/B_topic_list_item.d.ts +7 -0
  60. package/esm/types/B_topic_list_item.d.ts.map +1 -0
  61. package/esm/types/B_topic_list_item.js +1 -0
  62. package/esm/types/B_update.d.ts +16 -1
  63. package/esm/types/B_update.d.ts.map +1 -1
  64. package/esm/types/C_topic_list.d.ts +14 -0
  65. package/esm/types/C_topic_list.d.ts.map +1 -0
  66. package/esm/types/C_topic_list.js +9 -0
  67. package/package.json +1 -1
  68. package/script/3_types.d.ts +6 -2
  69. package/script/3_types.d.ts.map +1 -1
  70. package/script/3_types.js +6 -2
  71. package/script/client/0_params.d.ts +10 -0
  72. package/script/client/0_params.d.ts.map +1 -1
  73. package/script/client/1_client_generic.d.ts +1168 -1075
  74. package/script/client/1_client_generic.d.ts.map +1 -1
  75. package/script/client/3_account_manager.d.ts +4 -0
  76. package/script/client/3_account_manager.d.ts.map +1 -1
  77. package/script/client/3_account_manager.js +19 -0
  78. package/script/client/3_message_manager.d.ts +2 -1
  79. package/script/client/3_message_manager.d.ts.map +1 -1
  80. package/script/client/3_message_manager.js +7 -0
  81. package/script/client/3_secret_chat_manager.d.ts +4 -1
  82. package/script/client/3_secret_chat_manager.d.ts.map +1 -1
  83. package/script/client/3_secret_chat_manager.js +31 -0
  84. package/script/client/4_context.d.ts +12 -2
  85. package/script/client/4_context.d.ts.map +1 -1
  86. package/script/client/4_context.js +25 -0
  87. package/script/client/4_forum_manager.d.ts +4 -1
  88. package/script/client/4_forum_manager.d.ts.map +1 -1
  89. package/script/client/4_forum_manager.js +32 -0
  90. package/script/client/6_client.d.ts +1166 -1075
  91. package/script/client/6_client.d.ts.map +1 -1
  92. package/script/client/6_client.js +1528 -1413
  93. package/script/client/6_client_dispatcher.d.ts +1168 -1075
  94. package/script/client/6_client_dispatcher.d.ts.map +1 -1
  95. package/script/client/6_client_dispatcher.js +1502 -1391
  96. package/script/types/0_report_reason.d.ts +1 -0
  97. package/script/types/0_report_reason.d.ts.map +1 -1
  98. package/script/types/0_secret_chat_action_type.d.ts +69 -0
  99. package/script/types/0_secret_chat_action_type.d.ts.map +1 -0
  100. package/script/types/0_secret_chat_action_type.js +49 -0
  101. package/script/types/0_story_report_option.d.ts +3 -0
  102. package/script/types/0_story_report_option.d.ts.map +1 -1
  103. package/script/types/1_chat_p.d.ts +1 -5
  104. package/script/types/1_chat_p.d.ts.map +1 -1
  105. package/script/types/1_story_report_result.d.ts +17 -3
  106. package/script/types/1_story_report_result.d.ts.map +1 -1
  107. package/script/types/2_secret_message.d.ts +1 -0
  108. package/script/types/2_secret_message.d.ts.map +1 -1
  109. package/script/types/3_bot_access_settings.d.ts +3 -0
  110. package/script/types/3_bot_access_settings.d.ts.map +1 -1
  111. package/script/types/3_connected_website.d.ts +45 -0
  112. package/script/types/3_connected_website.d.ts.map +1 -0
  113. package/script/types/3_connected_website.js +42 -0
  114. package/script/types/3_poll_voter_list.d.ts +2 -1
  115. package/script/types/3_poll_voter_list.d.ts.map +1 -1
  116. package/script/types/3_text_to_translate.d.ts +3 -0
  117. package/script/types/3_text_to_translate.d.ts.map +1 -1
  118. package/script/types/3_translated_text.d.ts +3 -0
  119. package/script/types/3_translated_text.d.ts.map +1 -1
  120. package/script/types/9_message.d.ts +8 -1
  121. package/script/types/9_message.d.ts.map +1 -1
  122. package/script/types/9_message.js +3 -0
  123. package/script/types/A_topic.d.ts +20 -3
  124. package/script/types/A_topic.d.ts.map +1 -1
  125. package/script/types/A_topic.js +38 -0
  126. package/script/types/B_topic_list_item.d.ts +7 -0
  127. package/script/types/B_topic_list_item.d.ts.map +1 -0
  128. package/script/types/B_topic_list_item.js +2 -0
  129. package/script/types/B_update.d.ts +16 -1
  130. package/script/types/B_update.d.ts.map +1 -1
  131. package/script/types/C_topic_list.d.ts +14 -0
  132. package/script/types/C_topic_list.d.ts.map +1 -0
  133. package/script/types/C_topic_list.js +12 -0
@@ -18,8 +18,8 @@
18
18
  * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
19
  */
20
20
  import type { Api, Mtproto } from "../2_tl.js";
21
- import type { AlbumStoryList, Animation, AppSupport, AuthorizationSession, AvailableReactions, Birthday, BlockedUserList, BotAccessSettings, BotCommand, BotTokenCheckResult, BusinessConnection, CallbackQueryAnswer, CallbackQueryQuestion, Chat, ChatActionType, ChatListItem, ChatMember, ChatP, ChatPChannel, ChatPGroup, ChatPPrivate, ChatPSupergroup, ChatSettings, ClaimedGifts, CodeCheckResult, Country, FailedInvitation, FileSource, Gift, GiftCollection, ID, InactiveChat, InlineQueryAnswer, InlineQueryResult, InputChecklistItem, InputEmojiStatus, InputGift, InputMedia, InputPollOption, InputRichText, InputSticker, InputStoryContent, InviteLink, JoinRequest, LeftChannelList, LinkPreview, LiveStreamChannel, Message, MessageAnimation, MessageAudio, MessageChecklist, MessageContact, MessageCounters, MessageDice, MessageDocument, MessageInvoice, MessageList, MessageLivePhoto, MessageLocation, MessagePhoto, MessagePoll, MessageReactionList, MessageRichText, MessageSticker, MessageText, MessageVenue, MessageVideo, MessageVideoNote, MessageViewer, MessageVoice, MiniAppInfo, NetworkStatistics, PasswordCheckResult, Poll, PollVoterList, PremiumSubscriptionDuration, PriceTag, ProfilePhotoList, Reaction, ReportReason, RichText, SavedChats, SecretChat, SlowModeDuration, StarAmount, StarTransactionList, Sticker, StickerSet, Story, StoryAlbum, StoryReportResult, SummarizedText, TextToTranslate, Timezone, Topic, TranslatedText, Translation, User, VideoChat, VideoChatActive, VideoChatScheduled, VoiceTranscription } from "../3_types.js";
22
- import type { AddBotToAttachmentsMenuParams, AddChatMemberParams, AddContactParams, AddReactionParams, AddStickerToStickerSetParams, AnswerCallbackQueryParams, AnswerInlineQueryParams, AnswerPreCheckoutQueryParams, ApproveJoinRequestsParams, BanChatMemberParams, CheckUsernameParams, CreateChannelParams, CreateGroupParams, CreateInviteLinkParams, CreateStickerSetParams, CreateStoryParams, CreateSupergroupParams, CreateTopicParams, DeclineJoinRequestsParams, DeleteAccountParams, DeleteMessageParams, DeleteMessagesParams, DownloadLiveStreamSegmentParams, DownloadParams, EditInlineMessageCaptionParams, EditInlineMessageMediaParams, EditInlineMessageRichTextParams, EditInlineMessageTextParams, EditMessageCaptionParams, EditMessageLiveLocationParams, EditMessageMediaParams, EditMessageReplyMarkupParams, EditMessageRichTextParams, EditMessageTextParams, EditTopicParams, EnableSignaturesParams, EndSecretChatParams, EndTakeoutSessionParams, ForwardMessagesParams, GetBlockedUsersParams, GetChatMembersParams, GetChatsParams, GetClaimedGiftsParams, GetCommonChatsParams, GetCreatedInviteLinksParams, GetHistoryParams, GetJoinRequestsParams, GetLeftChannelsParams, GetLinkPreviewParams, GetMessageReactionsParams, GetMyCommandsParams, GetPollVotersParams, GetProfilePhotosParams, GetSavedChatsParams, GetSavedMessagesParams, GetStarTransactionsParams, GetTranslationsParams, GiftPremiumSubscriptionParams, InvokeParams, JoinVideoChatParams, MarkAllMentionsAsReadParams, OpenChatParams, OpenMiniAppParams, PinMessageParams, PromoteChatMemberParams, RemoveProfilePhotoParams, ReplaceStickerInStickerSetParams, ReportChatParams, ReportStoryParams, ResolveUsernameParams, ScheduleVideoChatParams, SearchMessagesParams, SendAnimationParams, SendAudioParams, SendChecklistParams, SendContactParams, SendDiceParams, SendDocumentParams, SendGiftParams, SendInlineQueryParams, SendInvoiceParams, SendLivePhotoParams, SendLocationParams, SendMediaGroupParams, SendMessageDraftParams, SendMessageParams, SendPhotoParams, SendPollParams, SendRichTextDraftParams, SendRichTextParams, SendSecretAnimationParams, SendSecretAudioParams, SendSecretContactParams, SendSecretDocumentParams, SendSecretLocationParams, SendSecretMessageParams, SendSecretPhotoParams, SendSecretStickerParams, SendSecretVenueParams, SendSecretVideoNoteParams, SendSecretVideoParams, SendSecretVoiceParams, SendStickerParams, SendVenueParams, SendVideoNoteParams, SendVideoParams, SendVoiceParams, SetBirthdayParams, SetChatMemberRightsParams, SetChatMemberTagParams, SetChatPhotoParams, SetContactNoteParams, SetEmojiStatusParams, SetLocationParams, SetManagedBotAccessSettingsParams, SetMyCommandsParams, SetNameColorParams, SetPersonalChannelParams, SetProfileColorParams, SetReactionsParams, SetWorkingHoursParams, SignInParams, StartBotParams, StartTakeoutSessionParams, StartVideoChatParams, StopPollParams, SummarizeTextParams, TranslateTextParams, UnpinMessageParams, UnpinMessagesParams, UpdateChecklistParams, UpdateProfileParams, UpdateProfilePhotoParams, UpdateProfileVideoParams } from "./0_params.js";
21
+ import type { AlbumStoryList, Animation, AppSupport, AuthorizationSession, AvailableReactions, Birthday, BlockedUserList, BotAccessSettings, BotCommand, BotTokenCheckResult, BusinessConnection, CallbackQueryAnswer, CallbackQueryQuestion, Chat, ChatActionType, ChatListItem, ChatMember, ChatP, ChatPChannel, ChatPGroup, ChatPPrivate, ChatPSupergroup, ChatSettings, ClaimedGifts, CodeCheckResult, ConnectedWebsite, Country, FailedInvitation, FileSource, Gift, GiftCollection, ID, InactiveChat, InlineQueryAnswer, InlineQueryResult, InputChecklistItem, InputEmojiStatus, InputGift, InputMedia, InputPollOption, InputRichText, InputSticker, InputStoryContent, InviteLink, JoinRequest, LeftChannelList, LinkPreview, LiveStreamChannel, Message, MessageAnimation, MessageAudio, MessageChecklist, MessageContact, MessageCounters, MessageDice, MessageDocument, MessageInvoice, MessageList, MessageLivePhoto, MessageLocation, MessagePhoto, MessagePoll, MessageReactionList, MessageRichText, MessageSticker, MessageText, MessageVenue, MessageVideo, MessageVideoNote, MessageViewer, MessageVoice, MiniAppInfo, NetworkStatistics, PasswordCheckResult, Poll, PollVoterList, PremiumSubscriptionDuration, PriceTag, ProfilePhotoList, Reaction, ReportReason, RichText, SavedChats, SecretChat, SlowModeDuration, StarAmount, StarTransactionList, Sticker, StickerSet, Story, StoryAlbum, StoryReportResult, SummarizedText, TextToTranslate, Timezone, Topic, TopicList, TopicListItem, TranslatedText, Translation, User, VideoChat, VideoChatActive, VideoChatScheduled, VoiceTranscription } from "../3_types.js";
22
+ import type { AddBotToAttachmentsMenuParams, AddChatMemberParams, AddContactParams, AddReactionParams, AddStickerToStickerSetParams, AnswerCallbackQueryParams, AnswerInlineQueryParams, AnswerPreCheckoutQueryParams, ApproveJoinRequestsParams, BanChatMemberParams, CheckUsernameParams, CreateChannelParams, CreateGroupParams, CreateInviteLinkParams, CreateStickerSetParams, CreateStoryParams, CreateSupergroupParams, CreateTopicParams, DeclineJoinRequestsParams, DeleteAccountParams, DeleteMessageParams, DeleteMessagesParams, DownloadLiveStreamSegmentParams, DownloadParams, EditInlineMessageCaptionParams, EditInlineMessageMediaParams, EditInlineMessageRichTextParams, EditInlineMessageTextParams, EditMessageCaptionParams, EditMessageLiveLocationParams, EditMessageMediaParams, EditMessageReplyMarkupParams, EditMessageRichTextParams, EditMessageTextParams, EditTopicParams, EnableSignaturesParams, EndSecretChatParams, EndTakeoutSessionParams, ForwardMessagesParams, GetBlockedUsersParams, GetChatMembersParams, GetChatsParams, GetClaimedGiftsParams, GetCommonChatsParams, GetCreatedInviteLinksParams, GetHistoryParams, GetJoinRequestsParams, GetLeftChannelsParams, GetLinkPreviewParams, GetMessageReactionsParams, GetMyCommandsParams, GetPollVotersParams, GetProfilePhotosParams, GetSavedChatsParams, GetSavedMessagesParams, GetStarTransactionsParams, GetTopicsParams, GetTranslationsParams, GiftPremiumSubscriptionParams, InvokeParams, JoinVideoChatParams, MarkAllMentionsAsReadParams, OpenChatParams, OpenMiniAppParams, PinMessageParams, PromoteChatMemberParams, RemoveProfilePhotoParams, ReplaceStickerInStickerSetParams, ReportChatParams, ReportStoryParams, ResolveUsernameParams, ScheduleVideoChatParams, SearchMessagesParams, SendAnimationParams, SendAudioParams, SendChecklistParams, SendContactParams, SendDiceParams, SendDocumentParams, SendGiftParams, SendInlineQueryParams, SendInvoiceParams, SendLivePhotoParams, SendLocationParams, SendMediaGroupParams, SendMessageDraftParams, SendMessageParams, SendPhotoParams, SendPollParams, SendRichTextDraftParams, SendRichTextParams, SendSecretAnimationParams, SendSecretAudioParams, SendSecretContactParams, SendSecretDocumentParams, SendSecretLocationParams, SendSecretMessageParams, SendSecretPhotoParams, SendSecretStickerParams, SendSecretVenueParams, SendSecretVideoNoteParams, SendSecretVideoParams, SendSecretVoiceParams, SendStickerParams, SendVenueParams, SendVideoNoteParams, SendVideoParams, SendVoiceParams, SetBirthdayParams, SetChatMemberRightsParams, SetChatMemberTagParams, SetChatPhotoParams, SetContactNoteParams, SetEmojiStatusParams, SetLocationParams, SetManagedBotAccessSettingsParams, SetMyCommandsParams, SetNameColorParams, SetPersonalChannelParams, SetProfileColorParams, SetReactionsParams, SetWorkingHoursParams, SignInParams, StartBotParams, StartTakeoutSessionParams, StartVideoChatParams, StopPollParams, SummarizeTextParams, TranslateTextParams, UnpinMessageParams, UnpinMessagesParams, UpdateChecklistParams, UpdateProfileParams, UpdateProfilePhotoParams, UpdateProfileVideoParams } from "./0_params.js";
23
23
  /** A generic MTKruto client. */
24
24
  export declare abstract class ClientGeneric {
25
25
  abstract connect(): Promise<void>;
@@ -93,661 +93,622 @@ export declare abstract class ClientGeneric {
93
93
  */
94
94
  abstract getInputUser(id: ID): Promise<Api.inputUserSelf | Api.inputUser | Api.inputUserFromMessage>;
95
95
  /**
96
- * Get information on the currently authorized user.
96
+ * Add a bot to the attachments menu. User-only.
97
97
  *
98
98
  * @method ac
99
- * @returns Information on the currently authorized user.
99
+ * @param botId The identifier of the bot to add to the attachments menu.
100
100
  */
101
- abstract getMe(): Promise<User>;
101
+ abstract addBotToAttachmentsMenu(botId: ID, params?: AddBotToAttachmentsMenuParams): Promise<void>;
102
102
  /**
103
- * Show a username in the current account, a bot account, a supergroup, or a channel's profile. User-only.
103
+ * Block a user. User-only.
104
104
  *
105
105
  * @method ac
106
- * @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
107
- * @param username The username to show.
106
+ * @param userId The identifier of the user to block.
108
107
  */
109
- abstract showUsername(id: ID, username: string): Promise<void>;
108
+ abstract blockUser(userId: ID): Promise<void>;
110
109
  /**
111
- * Hide a username from the current account, a bot account, a supergroup, or a channel's profile. User-only.
110
+ * Check the availability of a username. User-only.
112
111
  *
113
112
  * @method ac
114
- * @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
115
- * @param username The username to hide.
113
+ * @param username The username to check.
114
+ * @returns Whether the username is available.
116
115
  */
117
- abstract hideUsername(id: ID, username: string): Promise<void>;
116
+ abstract checkUsername(username: string, params?: CheckUsernameParams): Promise<boolean>;
118
117
  /**
119
- * Reorder the usernames of the current account, a bot account, a supergroup, or a channel's profile. User-only.
118
+ * Delete the current account. User-only.
120
119
  *
121
120
  * @method ac
122
- * @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
123
- * @param order The new order to use.
124
- * @returns Whether the order was changed.
121
+ * @param reason The reason of the deletion.
125
122
  */
126
- abstract reorderUsernames(id: ID, order: string[]): Promise<boolean>;
123
+ abstract deleteAccount(reason: string, params?: DeleteAccountParams): Promise<void>;
127
124
  /**
128
- * Hide all usernames from a supergroup or a channel's profile. User-only.
125
+ * Disable sponsored messages on the current user. User-only.
129
126
  *
130
127
  * @method ac
131
- * @param id A supergroup ID or a channel ID.
132
- * @returns Whether any username was hidden.
133
128
  */
134
- abstract hideUsernames(id: ID): Promise<boolean>;
129
+ abstract disableSponsoredMessages(): Promise<void>;
135
130
  /**
136
- * Check the availability of a username. User-only.
131
+ * Disconnect a connected website. User-only.
137
132
  *
138
133
  * @method ac
139
- * @param username The username to check.
140
- * @returns Whether the username is available.
134
+ * @param id The identifier of a connected website.
141
135
  */
142
- abstract checkUsername(username: string, params?: CheckUsernameParams): Promise<boolean>;
136
+ abstract disconnectConnectedWebsite(id: string): Promise<void>;
143
137
  /**
144
- * Set the username of the current account. User-only.
138
+ * Disconnect all connected websites. User-only.
145
139
  *
146
140
  * @method ac
147
- * @param username The username to set.
148
141
  */
149
- abstract setUsername(username: string): Promise<void>;
142
+ abstract disconnectConnectedWebsites(): Promise<void>;
150
143
  /**
151
- * Remove the current account's username. User-only.
144
+ * Enable sponsored messages on the current user. User-only.
152
145
  *
153
146
  * @method ac
154
147
  */
155
- abstract removeUsername(): Promise<void>;
148
+ abstract enableSponsoredMessages(): Promise<void>;
156
149
  /**
157
- * Get a business connection. Bot-only.
150
+ * Get the current account's TTL. User-only.
158
151
  *
159
152
  * @method ac
160
- * @param id The identifier of the business connection.
161
- * @cache
153
+ * @returns The current account's TTL in days.
162
154
  */
163
- abstract getBusinessConnection(id: string): Promise<BusinessConnection>;
155
+ abstract getAccountTtl(): Promise<number>;
164
156
  /**
165
- * Set the current account's online status. User-only.
157
+ * Get app support. User-only.
166
158
  *
167
159
  * @method ac
168
- * @param isOnline The new online status.
169
160
  */
170
- abstract setIsOnline(isOnline: boolean): Promise<void>;
161
+ abstract getAppSupport(): Promise<AppSupport>;
171
162
  /**
172
- * Set the current account's emoji status. User-only.
163
+ * Get app support name. User-only.
173
164
  *
174
165
  * @method ac
175
- * @param emojiStatus The emoji or gift to set as the new emoji status.
176
166
  */
177
- abstract setEmojiStatus(emojiStatus: InputEmojiStatus, params?: SetEmojiStatusParams): Promise<void>;
167
+ abstract getAppSupportName(): Promise<string>;
178
168
  /**
179
- * Remove the current account's emoji status. User-only.
169
+ * Get the authorization sessions. User-only.
180
170
  *
181
171
  * @method ac
182
172
  */
183
- abstract removeEmojiStatus(): Promise<void>;
173
+ abstract getAuthorizationSessions(): Promise<AuthorizationSession[]>;
184
174
  /**
185
- * Set the emoji status of a channel. User-only.
175
+ * Get blocked users. User-only.
186
176
  *
187
177
  * @method ac
188
- * @param chatId The identifier of a channel.
189
- * @param emojiStatus The emoji or gift to set as the new emoji status.
190
178
  */
191
- abstract setChannelEmojiStatus(chatId: ID, emojiStatus: InputEmojiStatus, params?: SetEmojiStatusParams): Promise<void>;
179
+ abstract getBlockedUsers(params?: GetBlockedUsersParams): Promise<BlockedUserList>;
192
180
  /**
193
- * Remove the emoji status of a channel. User-only.
181
+ * Get a business connection. Bot-only.
194
182
  *
195
183
  * @method ac
196
- * @param chatId The identifier of a channel.
184
+ * @param id The identifier of the business connection.
185
+ * @cache
197
186
  */
198
- abstract removeChannelEmojiStatus(chatId: ID): Promise<void>;
187
+ abstract getBusinessConnection(id: string): Promise<BusinessConnection>;
199
188
  /**
200
- * Set the emoji status of a bot's user. Bot-only.
189
+ * Get connected websites. User-only.
201
190
  *
202
191
  * @method ac
203
- * @param userId The identifier of a user of the bot.
204
- * @param emojiStatus The emoji or gift to set as the new emoji status.
205
192
  */
206
- abstract setUserEmojiStatus(userId: ID, emojiStatus: InputEmojiStatus, params?: SetEmojiStatusParams): Promise<void>;
193
+ abstract getConnectedWebsites(): Promise<ConnectedWebsite[]>;
207
194
  /**
208
- * Remove the emoji status of a bot's user. Bot-only.
195
+ * Get countries. User-only.
209
196
  *
210
197
  * @method ac
211
- * @param userId The identifier of a user of the bot.
212
198
  */
213
- abstract removeUserEmojiStatus(userId: ID): Promise<void>;
199
+ abstract getCountries(languageCode: string): Promise<Country[]>;
214
200
  /**
215
- * Update the profile of the current user. At least one parameter must be specified. User-only.
201
+ * Get the country code for the current user based on its IP address. User-only.
216
202
  *
217
203
  * @method ac
218
204
  */
219
- abstract updateProfile(params?: UpdateProfileParams): Promise<void>;
205
+ abstract getCountryCode(): Promise<string>;
220
206
  /**
221
- * Update the profile photo of the current user or a bot managed by the current user.
207
+ * Get information on the currently authorized user.
222
208
  *
223
209
  * @method ac
224
- * @param photo The photo to set as profile photo.
210
+ * @returns Information on the currently authorized user.
225
211
  */
226
- abstract updateProfilePhoto(photo: FileSource, params?: UpdateProfilePhotoParams): Promise<void>;
212
+ abstract getMe(): Promise<User>;
227
213
  /**
228
- * Update the profile video of the current user or a bot managed by the current user.
214
+ * Get owned bots. User-only.
229
215
  *
230
216
  * @method ac
231
- * @param video The video to set as profile video.
232
217
  */
233
- abstract updateProfileVideo(video: FileSource, params?: UpdateProfileVideoParams): Promise<void>;
218
+ abstract getOwnedBots(): Promise<User[]>;
234
219
  /**
235
- * Remove the profile video of the current user or a bot managed by the current user.
220
+ * Get the profile photos of a user.
236
221
  *
237
222
  * @method ac
223
+ * @param userId The identifier of a user.
238
224
  */
239
- abstract removeProfilePhoto(params?: RemoveProfilePhotoParams): Promise<void>;
225
+ abstract getProfilePhotos(userId: ID, params?: GetProfilePhotosParams): Promise<ProfilePhotoList>;
240
226
  /**
241
- * Set the birthday of the current user. User-only.
227
+ * Get timezones. User-only.
242
228
  *
243
229
  * @method ac
244
230
  */
245
- abstract setBirthday(params?: SetBirthdayParams): Promise<void>;
231
+ abstract getTimezones(): Promise<Timezone[]>;
246
232
  /**
247
- * Set the personal channel of the current user. User-only.
233
+ * Hide a username from the current account, a bot account, a supergroup, or a channel's profile. User-only.
248
234
  *
249
235
  * @method ac
236
+ * @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
237
+ * @param username The username to hide.
250
238
  */
251
- abstract setPersonalChannel(params?: SetPersonalChannelParams): Promise<void>;
239
+ abstract hideUsername(id: ID, username: string): Promise<void>;
252
240
  /**
253
- * Set the name color of the current user. User-only.
241
+ * Hide all usernames from a supergroup or a channel's profile. User-only.
254
242
  *
255
243
  * @method ac
256
- * @param color The identifier of the color to set.
244
+ * @param id A supergroup ID or a channel ID.
245
+ * @returns Whether any username was hidden.
257
246
  */
258
- abstract setNameColor(color: number, params?: SetNameColorParams): Promise<void>;
247
+ abstract hideUsernames(id: ID): Promise<boolean>;
259
248
  /**
260
- * Set the profile color of the current user. User-only.
249
+ * Pause the business bot in a chat. User-only.
261
250
  *
262
251
  * @method ac
263
- * @param color The identifier of the color to set.
252
+ * @param chatId The identifier of a chat.
264
253
  */
265
- abstract setProfileColor(color: number, params?: SetProfileColorParams): Promise<void>;
254
+ abstract pauseBusinessBotConnection(chatId: ID): Promise<void>;
266
255
  /**
267
- * Set the location of the current user. User-only.
256
+ * Remove an authorization session. User-only.
268
257
  *
269
258
  * @method ac
259
+ * @param id The identifier of the authorization session to remove.
270
260
  */
271
- abstract setLocation(params?: SetLocationParams): Promise<void>;
261
+ abstract removeAuthorizationSession(id: string): Promise<void>;
272
262
  /**
273
- * Set the working hours of the current user. User-only.
263
+ * Remove all authorization sessions except for the current one. User-only.
274
264
  *
275
265
  * @method ac
276
266
  */
277
- abstract setWorkingHours(params?: SetWorkingHoursParams): Promise<void>;
267
+ abstract removeAuthorizationSessions(): Promise<void>;
278
268
  /**
279
- * Enable sponsored messages on the current user. User-only.
269
+ * Remove a bot from the attachments menu. User-only.
280
270
  *
281
271
  * @method ac
272
+ * @param botId The identifier of the bot to remove from the attachments menu.
282
273
  */
283
- abstract enableSponsoredMessages(): Promise<void>;
274
+ abstract removeBotFromAttachmentsMenu(botId: ID): Promise<void>;
284
275
  /**
285
- * Disable sponsored messages on the current user. User-only.
276
+ * Remove the emoji status of a channel. User-only.
286
277
  *
287
278
  * @method ac
279
+ * @param chatId The identifier of a channel.
288
280
  */
289
- abstract disableSponsoredMessages(): Promise<void>;
281
+ abstract removeChannelEmojiStatus(chatId: ID): Promise<void>;
290
282
  /**
291
- * Pause the business bot in a chat. User-only.
283
+ * Remove the current account's emoji status. User-only.
292
284
  *
293
285
  * @method ac
294
- * @param chatId The identifier of a chat.
295
286
  */
296
- abstract pauseBusinessBotConnection(chatId: ID): Promise<void>;
287
+ abstract removeEmojiStatus(): Promise<void>;
297
288
  /**
298
- * Resume the business bot in a chat. User-only.
289
+ * Remove the profile video of the current user or a bot managed by the current user.
299
290
  *
300
291
  * @method ac
301
- * @param chatId The identifier of a chat.
302
292
  */
303
- abstract resumeBusinessBotConnection(chatId: ID): Promise<void>;
293
+ abstract removeProfilePhoto(params?: RemoveProfilePhotoParams): Promise<void>;
304
294
  /**
305
- * Resolve a username.
295
+ * Remove the emoji status of a bot's user. Bot-only.
306
296
  *
307
297
  * @method ac
308
- * @param username The username to resolve.
298
+ * @param userId The identifier of a user of the bot.
309
299
  */
310
- abstract resolveUsername(username: string, params?: ResolveUsernameParams): Promise<ChatP>;
300
+ abstract removeUserEmojiStatus(userId: ID): Promise<void>;
311
301
  /**
312
- * Resolve a phone number. User-only.
302
+ * Remove the current account's username. User-only.
313
303
  *
314
304
  * @method ac
315
- * @param phoneNumber The phone number to resolve.
316
305
  */
317
- abstract resolvePhoneNumber(phoneNumber: string): Promise<User>;
306
+ abstract removeUsername(): Promise<void>;
318
307
  /**
319
- * Set the list of close friends. User-only.
308
+ * Reorder the usernames of the current account, a bot account, a supergroup, or a channel's profile. User-only.
320
309
  *
321
310
  * @method ac
322
- * @param userIds The identifiers of users to set as close friends.
311
+ * @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
312
+ * @param order The new order to use.
313
+ * @returns Whether the order was changed.
323
314
  */
324
- abstract setCloseFriends(userIds: ID[]): Promise<void>;
315
+ abstract reorderUsernames(id: ID, order: string[]): Promise<boolean>;
325
316
  /**
326
- * Suggest a birthday. User-only.
317
+ * Resolve a phone number. User-only.
327
318
  *
328
319
  * @method ac
329
- * @param userId The identifier of the user to suggest a birthday for.
330
- * @param birthday The birthday to suggest.
320
+ * @param phoneNumber The phone number to resolve.
331
321
  */
332
- abstract suggestBirthday(userId: ID, birthday: Birthday): Promise<void>;
322
+ abstract resolvePhoneNumber(phoneNumber: string): Promise<User>;
333
323
  /**
334
- * Block a user. User-only.
324
+ * Resolve a username.
335
325
  *
336
326
  * @method ac
337
- * @param userId The identifier of the user to block.
327
+ * @param username The username to resolve.
338
328
  */
339
- abstract blockUser(userId: ID): Promise<void>;
329
+ abstract resolveUsername(username: string, params?: ResolveUsernameParams): Promise<ChatP>;
340
330
  /**
341
- * Unblock a user. User-only.
331
+ * Resume the business bot in a chat. User-only.
342
332
  *
343
333
  * @method ac
344
- * @param userId The identifier of the user to unblock.
334
+ * @param chatId The identifier of a chat.
345
335
  */
346
- abstract unblockUser(userId: ID): Promise<void>;
336
+ abstract resumeBusinessBotConnection(chatId: ID): Promise<void>;
347
337
  /**
348
- * Get blocked users. User-only.
338
+ * Set the current account's TTL. User-only.
349
339
  *
350
340
  * @method ac
341
+ * @param dayCount The current account's TTL in days.
351
342
  */
352
- abstract getBlockedUsers(params?: GetBlockedUsersParams): Promise<BlockedUserList>;
343
+ abstract setAccountTtl(dayCount: number): Promise<void>;
353
344
  /**
354
- * Add a bot to the attachments menu. User-only.
345
+ * Set the birthday of the current user. User-only.
355
346
  *
356
347
  * @method ac
357
- * @param botId The identifier of the bot to add to the attachments menu.
358
348
  */
359
- abstract addBotToAttachmentsMenu(botId: ID, params?: AddBotToAttachmentsMenuParams): Promise<void>;
349
+ abstract setBirthday(params?: SetBirthdayParams): Promise<void>;
360
350
  /**
361
- * Remove a bot from the attachments menu. User-only.
351
+ * Set the emoji status of a channel. User-only.
362
352
  *
363
353
  * @method ac
364
- * @param botId The identifier of the bot to remove from the attachments menu.
354
+ * @param chatId The identifier of a channel.
355
+ * @param emojiStatus The emoji or gift to set as the new emoji status.
365
356
  */
366
- abstract removeBotFromAttachmentsMenu(botId: ID): Promise<void>;
357
+ abstract setChannelEmojiStatus(chatId: ID, emojiStatus: InputEmojiStatus, params?: SetEmojiStatusParams): Promise<void>;
367
358
  /**
368
- * Get app support. User-only.
359
+ * Set the list of close friends. User-only.
369
360
  *
370
361
  * @method ac
362
+ * @param userIds The identifiers of users to set as close friends.
371
363
  */
372
- abstract getAppSupport(): Promise<AppSupport>;
364
+ abstract setCloseFriends(userIds: ID[]): Promise<void>;
373
365
  /**
374
- * Get app support name. User-only.
366
+ * Set the current account's emoji status. User-only.
375
367
  *
376
368
  * @method ac
369
+ * @param emojiStatus The emoji or gift to set as the new emoji status.
377
370
  */
378
- abstract getAppSupportName(): Promise<string>;
371
+ abstract setEmojiStatus(emojiStatus: InputEmojiStatus, params?: SetEmojiStatusParams): Promise<void>;
379
372
  /**
380
- * Get owned bots. User-only.
373
+ * Set the current account's online status. User-only.
381
374
  *
382
375
  * @method ac
376
+ * @param isOnline The new online status.
383
377
  */
384
- abstract getOwnedBots(): Promise<User[]>;
378
+ abstract setIsOnline(isOnline: boolean): Promise<void>;
385
379
  /**
386
- * Get timezones. User-only.
380
+ * Set the location of the current user. User-only.
387
381
  *
388
382
  * @method ac
389
383
  */
390
- abstract getTimezones(): Promise<Timezone[]>;
384
+ abstract setLocation(params?: SetLocationParams): Promise<void>;
391
385
  /**
392
- * Get countries. User-only.
386
+ * Set the name color of the current user. User-only.
393
387
  *
394
388
  * @method ac
389
+ * @param color The identifier of the color to set.
395
390
  */
396
- abstract getCountries(languageCode: string): Promise<Country[]>;
391
+ abstract setNameColor(color: number, params?: SetNameColorParams): Promise<void>;
397
392
  /**
398
- * Get the profile photos of a user.
393
+ * Set the personal channel of the current user. User-only.
399
394
  *
400
395
  * @method ac
401
- * @param userId The identifier of a user.
402
396
  */
403
- abstract getProfilePhotos(userId: ID, params?: GetProfilePhotosParams): Promise<ProfilePhotoList>;
397
+ abstract setPersonalChannel(params?: SetPersonalChannelParams): Promise<void>;
404
398
  /**
405
- * Delete the current account. User-only.
399
+ * Set the profile color of the current user. User-only.
406
400
  *
407
401
  * @method ac
408
- * @param reason The reason of the deletion.
402
+ * @param color The identifier of the color to set.
409
403
  */
410
- abstract deleteAccount(reason: string, params?: DeleteAccountParams): Promise<void>;
404
+ abstract setProfileColor(color: number, params?: SetProfileColorParams): Promise<void>;
411
405
  /**
412
- * Get the authorization sessions. User-only.
406
+ * Set the emoji status of a bot's user. Bot-only.
413
407
  *
414
408
  * @method ac
409
+ * @param userId The identifier of a user of the bot.
410
+ * @param emojiStatus The emoji or gift to set as the new emoji status.
415
411
  */
416
- abstract getAuthorizationSessions(): Promise<AuthorizationSession[]>;
412
+ abstract setUserEmojiStatus(userId: ID, emojiStatus: InputEmojiStatus, params?: SetEmojiStatusParams): Promise<void>;
417
413
  /**
418
- * Remove an authorization session. User-only.
414
+ * Set the username of the current account. User-only.
419
415
  *
420
416
  * @method ac
421
- * @param id The identifier of the authorization session to remove.
417
+ * @param username The username to set.
422
418
  */
423
- abstract removeAuthorizationSession(id: string): Promise<void>;
419
+ abstract setUsername(username: string): Promise<void>;
424
420
  /**
425
- * Remove all authorization sessions except for the current one. User-only.
421
+ * Set the working hours of the current user. User-only.
426
422
  *
427
423
  * @method ac
428
424
  */
429
- abstract removeAuthorizationSessions(): Promise<void>;
425
+ abstract setWorkingHours(params?: SetWorkingHoursParams): Promise<void>;
430
426
  /**
431
- * Get the current account's TTL. User-only.
427
+ * Show a username in the current account, a bot account, a supergroup, or a channel's profile. User-only.
432
428
  *
433
429
  * @method ac
434
- * @returns The current account's TTL in days.
430
+ * @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
431
+ * @param username The username to show.
435
432
  */
436
- abstract getAccountTtl(): Promise<number>;
433
+ abstract showUsername(id: ID, username: string): Promise<void>;
437
434
  /**
438
- * Set the current account's TTL. User-only.
435
+ * Suggest a birthday. User-only.
439
436
  *
440
437
  * @method ac
441
- * @param dayCount The current account's TTL in days.
438
+ * @param userId The identifier of the user to suggest a birthday for.
439
+ * @param birthday The birthday to suggest.
442
440
  */
443
- abstract setAccountTtl(dayCount: number): Promise<void>;
441
+ abstract suggestBirthday(userId: ID, birthday: Birthday): Promise<void>;
444
442
  /**
445
- * Send a text message.
443
+ * Unblock a user. User-only.
446
444
  *
447
- * @method ms
448
- * @param chatId The identifier of a chat to send the message to.
449
- * @param text The message's text.
450
- * @returns The sent text message.
445
+ * @method ac
446
+ * @param userId The identifier of the user to unblock.
451
447
  */
452
- abstract sendMessage(chatId: ID, text: string, params?: SendMessageParams): Promise<MessageText>;
448
+ abstract unblockUser(userId: ID): Promise<void>;
453
449
  /**
454
- * Send a rich text message.
450
+ * Update the profile of the current user. At least one parameter must be specified. User-only.
455
451
  *
456
- * @method ms
457
- * @param chatId The identifier of a chat to send the message to.
458
- * @param richText The message's rich text.
459
- * @returns The sent rich text message.
452
+ * @method ac
460
453
  */
461
- abstract sendRichText(chatId: ID, richText: InputRichText, params?: SendRichTextParams): Promise<MessageRichText>;
454
+ abstract updateProfile(params?: UpdateProfileParams): Promise<void>;
462
455
  /**
463
- * Stream a drafted text message. Bot-only.
456
+ * Update the profile photo of the current user or a bot managed by the current user.
464
457
  *
465
- * @method ms
466
- * @param chatId The identifier of a chat to send the message to.
467
- * @param draftId The identifier of the draft.
468
- * @param text The message's text.
458
+ * @method ac
459
+ * @param photo The photo to set as profile photo.
469
460
  */
470
- abstract sendMessageDraft(chatId: ID, draftId: number, text: string, params?: SendMessageDraftParams): Promise<void>;
461
+ abstract updateProfilePhoto(photo: FileSource, params?: UpdateProfilePhotoParams): Promise<void>;
471
462
  /**
472
- * Stream a drafted rich text message. Bot-only.
463
+ * Update the profile video of the current user or a bot managed by the current user.
473
464
  *
474
- * @method ms
475
- * @param chatId The identifier of a chat to send the message to.
476
- * @param draftId The identifier of the draft.
477
- * @param richText The message's rich text.
465
+ * @method ac
466
+ * @param video The video to set as profile video.
478
467
  */
479
- abstract sendRichTextDraft(chatId: ID, draftId: number, richText: InputRichText, params?: SendRichTextDraftParams): Promise<void>;
468
+ abstract updateProfileVideo(video: FileSource, params?: UpdateProfileVideoParams): Promise<void>;
480
469
  /**
481
- * Send a photo.
470
+ * Add a sticker to favorites. User-only.
482
471
  *
483
472
  * @method ms
484
- * @param chatId The identifier of a chat to send the photo to.
485
- * @param photo The photo to send.
486
- * @returns The sent photo.
473
+ * @param fileId The file identifier of the sticker.
487
474
  */
488
- abstract sendPhoto(chatId: ID, photo: FileSource, params?: SendPhotoParams): Promise<MessagePhoto>;
475
+ abstract addStickerToFavorites(fileId: string): Promise<void>;
489
476
  /**
490
- * Send a live photo.
477
+ * Add a sticker to recents. User-only.
491
478
  *
492
479
  * @method ms
493
- * @param chatId The identifier of a chat to send the photo to.
494
- * @param photo The photo to send.
495
- * @param video The video version of the photo.
496
- * @returns The sent live photo.
480
+ * @param fileId The file identifier of the sticker.
497
481
  */
498
- abstract sendLivePhoto(chatId: ID, photo: FileSource, video: FileSource, params?: SendLivePhotoParams): Promise<MessageLivePhoto>;
482
+ abstract addStickerToRecents(fileId: string): Promise<void>;
499
483
  /**
500
- * Send a document.
484
+ * Clear all message drafts. User-only.
501
485
  *
502
486
  * @method ms
503
- * @param chatId The identifier of a chat to send the document to.
504
- * @param document The document to send.
505
- * @returns The sent document.
506
487
  */
507
- abstract sendDocument(chatId: ID, document: FileSource, params?: SendDocumentParams): Promise<MessageDocument>;
488
+ abstract clearDrafts(): Promise<void>;
508
489
  /**
509
- * Send a sticker.
490
+ * Clear recent stickers. User-only.
510
491
  *
511
492
  * @method ms
512
- * @param chatId The identifier of a chat to send the sticker to.
513
- * @param sticker The sticker to send.
514
- * @returns The sent sticker.
515
493
  */
516
- abstract sendSticker(chatId: ID, sticker: FileSource, params?: SendStickerParams): Promise<MessageSticker>;
494
+ abstract clearRecentStickers(): Promise<void>;
517
495
  /**
518
- * Send a video.
496
+ * Delete all messages sent by a specific member of a chat. User-only.
519
497
  *
520
498
  * @method ms
521
- * @param chatId The identifier of a chat to send the video to.
522
- * @param video The video to send.
523
- * @returns The sent video.
499
+ * @param chatId The identifier of a chat. Must be a supergroup.
500
+ * @param memberId The identifier of the member.
524
501
  */
525
- abstract sendVideo(chatId: ID, video: FileSource, params?: SendVideoParams): Promise<MessageVideo>;
502
+ abstract deleteChatMemberMessages(chatId: ID, memberId: ID): Promise<void>;
526
503
  /**
527
- * Send an animation.
504
+ * Delete a single message.
528
505
  *
529
506
  * @method ms
530
- * @param chatId The identifier of a chat to send the animation to.
531
- * @param animation The animation to send.
532
- * @returns The sent animation.
507
+ * @param chatId The identifier of the chat which the message belongs to.
508
+ * @param messageId The identifier of the message to delete.
533
509
  */
534
- abstract sendAnimation(chatId: ID, animation: FileSource, params?: SendAnimationParams): Promise<MessageAnimation>;
510
+ abstract deleteMessage(chatId: ID, messageId: number, params?: DeleteMessageParams): Promise<void>;
535
511
  /**
536
- * Send a voice message.
512
+ * Delete multiple messages.
537
513
  *
538
514
  * @method ms
539
- * @param chatId The identifier of a chat to send the voice message to.
540
- * @param voice The voice to send.
541
- * @returns The sent voice message.
515
+ * @param chatId The identifier of the chat which the message belongs to.
516
+ * @param messageIds The identifiers of the messages to delete.
542
517
  */
543
- abstract sendVoice(chatId: ID, voice: FileSource, params?: SendVoiceParams): Promise<MessageVoice>;
518
+ abstract deleteMessages(chatId: ID, messageIds: number[], params?: DeleteMessagesParams): Promise<void>;
544
519
  /**
545
- * Send an audio file.
520
+ * Delete a scheduled message.
546
521
  *
547
522
  * @method ms
548
- * @param chatId The identifier of a chat to send the audio file to.
549
- * @param audio The audio to send.
550
- * @returns The sent audio file.
523
+ * @param chatId The identifier of a chat.
524
+ * @param messageId The identifier of the scheduled message to delete.
551
525
  */
552
- abstract sendAudio(chatId: ID, audio: FileSource, params?: SendAudioParams): Promise<MessageAudio>;
526
+ abstract deleteScheduledMessage(chatId: ID, messageId: number): Promise<void>;
553
527
  /**
554
- * Send a media group.
528
+ * Delete multiple scheduled messages.
555
529
  *
556
530
  * @method ms
557
- * @param chatId The identifier of a chat to send the media group to.
558
- * @param media The media to include in the media group. Animations are not allowed. All of them must be of the same media type, but an exception is that photos and videos can be mixed.
559
- * @returns The sent messages.
531
+ * @param chatId The identifier of a chat.
532
+ * @param messageIds The identifiers of the scheduled messages to delete.
560
533
  */
561
- abstract sendMediaGroup(chatId: ID, media: InputMedia[], params?: SendMediaGroupParams): Promise<Message[]>;
534
+ abstract deleteScheduledMessages(chatId: ID, messageIds: number[]): Promise<void>;
562
535
  /**
563
- * Send a video note.
536
+ * Edit an inline message's caption. Bot-only.
564
537
  *
565
538
  * @method ms
566
- * @param chatId The identifier of a chat to send the video note to.
567
- * @param videoNote The video note to send.
568
- * @returns The sent video note.
539
+ * @param inlineMessageId The identifier of the inline message.
569
540
  */
570
- abstract sendVideoNote(chatId: ID, videoNote: FileSource, params?: SendVideoNoteParams): Promise<MessageVideoNote>;
541
+ abstract editInlineMessageCaption(inlineMessageId: string, params?: EditInlineMessageCaptionParams): Promise<void>;
571
542
  /**
572
- * Send a location.
543
+ * Edit an inline message's live location. Bot-only.
573
544
  *
574
545
  * @method ms
575
- * @param chatId The identifier of a chat to send the location to.
576
- * @param latitude The location's latitude.
577
- * @param longitude The location's longitude.
578
- * @returns The sent location.
546
+ * @param inlineMessageId The identifier of the inline message.
547
+ * @param latitude The new latitude.
548
+ * @param longitude The new longitude.
549
+ * @returns The edited location message.
579
550
  */
580
- abstract sendLocation(chatId: ID, latitude: number, longitude: number, params?: SendLocationParams): Promise<MessageLocation>;
551
+ abstract editInlineMessageLiveLocation(inlineMessageId: string, latitude: number, longitude: number, params?: EditMessageLiveLocationParams): Promise<void>;
581
552
  /**
582
- * Send a contact.
553
+ * Edit an inline message's media.
583
554
  *
584
555
  * @method ms
585
- * @param chatId The identifier of a chat to send the contact to.
586
- * @param firstName The contact's first name.
587
- * @param phoneNumber The contact's phone number.
588
- * @returns The sent contact.
556
+ * @param inlineMessageId The identifier of the inline message.
557
+ * @param media The new media of the message.
589
558
  */
590
- abstract sendContact(chatId: ID, firstName: string, phoneNumber: string, params?: SendContactParams): Promise<MessageContact>;
559
+ abstract editInlineMessageMedia(inlineMessageId: string, media: InputMedia, params?: EditInlineMessageMediaParams): Promise<void>;
591
560
  /**
592
- * Send a dice.
561
+ * Edit an inline message's reply markup. Bot-only.
593
562
  *
594
563
  * @method ms
595
- * @param chatId The identifier of a chat to send the dice to.
596
- * @returns The sent dice.
564
+ * @param inlineMessageId The identifier of the inline message.
597
565
  */
598
- abstract sendDice(chatId: ID, params?: SendDiceParams): Promise<MessageDice>;
566
+ abstract editInlineMessageReplyMarkup(inlineMessageId: string, params?: EditMessageReplyMarkupParams): Promise<void>;
599
567
  /**
600
- * Send a venue.
568
+ * Edit an inline message's rich text. Bot-only.
601
569
  *
602
570
  * @method ms
603
- * @param chatId The identifier of a chat to send the venue to.
604
- * @param latitude The latitude of the venue.
605
- * @param longitude The longitude of the venue.
606
- * @param title The title of the venue.
607
- * @param address The written address of the venue.
608
- * @returns The sent venue.
571
+ * @param inlineMessageId The identifier of the inline message.
572
+ * @param richText The new rich text of the message.
609
573
  */
610
- abstract sendVenue(chatId: ID, latitude: number, longitude: number, title: string, address: string, params?: SendVenueParams): Promise<MessageVenue>;
574
+ abstract editInlineMessageRichText(inlineMessageId: string, richText: InputRichText, params?: EditInlineMessageRichTextParams): Promise<void>;
611
575
  /**
612
- * Send a poll.
576
+ * Edit an inline message's text. Bot-only.
613
577
  *
614
578
  * @method ms
615
- * @param chatId The identifier of a chat to send the poll to.
616
- * @param question The poll's question.
617
- * @param options The poll's options.
618
- * @returns The sent poll.
579
+ * @param inlineMessageId The identifier of the inline message.
580
+ * @param text The new text of the message.
619
581
  */
620
- abstract sendPoll(chatId: ID, question: string, options: InputPollOption[], params?: SendPollParams): Promise<MessagePoll>;
582
+ abstract editInlineMessageText(inlineMessageId: string, text: string, params?: EditInlineMessageTextParams): Promise<void>;
621
583
  /**
622
- * Send a checklist.
584
+ * Edit a message's caption.
623
585
  *
624
586
  * @method ms
625
- * @param chatId The identifier of a chat to send the checklist to.
626
- * @param title The checklist's title.
627
- * @param items The checklist's items.
628
- * @returns The sent checklist.
587
+ * @param chatId The identifier of the chat which the message belongs to.
588
+ * @param messageId The identifier of the message.
589
+ * @returns The edited message.
629
590
  */
630
- abstract sendChecklist(chatId: ID, title: string, items: InputChecklistItem[], params?: SendChecklistParams): Promise<MessageChecklist>;
591
+ abstract editMessageCaption(chatId: ID, messageId: number, params?: EditMessageCaptionParams): Promise<Message>;
631
592
  /**
632
- * Send an invoice. Bot-only.
593
+ * Edit a message's live location.
633
594
  *
634
595
  * @method ms
635
- * @param chatId The identifier of a chat to send the invoice to.
636
- * @param title The invoice's title.
637
- * @param description The invoice's description.
638
- * @param payload The invoice's payload.
639
- * @param currency The invoice's currency.
640
- * @param prices The invoice's price tags.
641
- * @returns The sent invoice.
596
+ * @param chatId The identifier of the chat which the message belongs to.
597
+ * @param messageId The identifier of the message.
598
+ * @param latitude The new latitude.
599
+ * @param longitude The new longitude.
600
+ * @returns The edited location message.
642
601
  */
643
- abstract sendInvoice(chatId: ID, title: string, description: string, payload: string, currency: string, prices: PriceTag[], params?: SendInvoiceParams): Promise<MessageInvoice>;
602
+ abstract editMessageLiveLocation(chatId: ID, messageId: number, latitude: number, longitude: number, params?: EditMessageLiveLocationParams): Promise<MessageLocation>;
644
603
  /**
645
- * Edit a message's text.
604
+ * Edit a message's media.
646
605
  *
647
606
  * @method ms
648
607
  * @param chatId The identifier of the chat which the message belongs to.
649
608
  * @param messageId The identifier of the message.
650
- * @param text The new text of the message.
651
- * @returns The edited text message.
609
+ * @param media The new media of the message.
610
+ * @returns The edited message.
652
611
  */
653
- abstract editMessageText(chatId: ID, messageId: number, text: string, params?: EditMessageTextParams): Promise<MessageText>;
612
+ abstract editMessageMedia(chatId: ID, messageId: number, media: InputMedia, params?: EditMessageMediaParams): Promise<Message>;
654
613
  /**
655
- * Edit a message's rich text.
614
+ * Edit a message's reply markup.
656
615
  *
657
616
  * @method ms
658
617
  * @param chatId The identifier of the chat which the message belongs to.
659
618
  * @param messageId The identifier of the message.
660
- * @param richText The new rich text of the message.
661
- * @returns The edited rich text message.
619
+ * @returns The edited message.
662
620
  */
663
- abstract editMessageRichText(chatId: ID, messageId: number, richText: InputRichText, params?: EditMessageRichTextParams): Promise<MessageRichText>;
621
+ abstract editMessageReplyMarkup(chatId: ID, messageId: number, params?: EditMessageReplyMarkupParams): Promise<Message>;
664
622
  /**
665
- * Edit a message's caption.
623
+ * Edit a message's rich text.
666
624
  *
667
625
  * @method ms
668
626
  * @param chatId The identifier of the chat which the message belongs to.
669
627
  * @param messageId The identifier of the message.
670
- * @returns The edited message.
628
+ * @param richText The new rich text of the message.
629
+ * @returns The edited rich text message.
671
630
  */
672
- abstract editMessageCaption(chatId: ID, messageId: number, params?: EditMessageCaptionParams): Promise<Message>;
631
+ abstract editMessageRichText(chatId: ID, messageId: number, richText: InputRichText, params?: EditMessageRichTextParams): Promise<MessageRichText>;
673
632
  /**
674
- * Edit a message's media.
633
+ * Edit a message's text.
675
634
  *
676
635
  * @method ms
677
636
  * @param chatId The identifier of the chat which the message belongs to.
678
637
  * @param messageId The identifier of the message.
679
- * @param media The new media of the message.
680
- * @returns The edited message.
638
+ * @param text The new text of the message.
639
+ * @returns The edited text message.
681
640
  */
682
- abstract editMessageMedia(chatId: ID, messageId: number, media: InputMedia, params?: EditMessageMediaParams): Promise<Message>;
641
+ abstract editMessageText(chatId: ID, messageId: number, text: string, params?: EditMessageTextParams): Promise<MessageText>;
683
642
  /**
684
- * Edit an inline message's media.
643
+ * Forward a single message.
685
644
  *
686
645
  * @method ms
687
- * @param inlineMessageId The identifier of the inline message.
688
- * @param media The new media of the message.
646
+ * @param from The identifier of a chat to forward the message from.
647
+ * @param to The identifier of a chat to forward the message to.
648
+ * @param messageId The identifier of the message to forward.
649
+ * @returns The forwarded message.
689
650
  */
690
- abstract editInlineMessageMedia(inlineMessageId: string, media: InputMedia, params?: EditInlineMessageMediaParams): Promise<void>;
651
+ abstract forwardMessage(from: ID, to: ID, messageId: number, params?: ForwardMessagesParams): Promise<Message>;
691
652
  /**
692
- * Edit an inline message's text. Bot-only.
653
+ * Forward multiple messages.
693
654
  *
694
655
  * @method ms
695
- * @param inlineMessageId The identifier of the inline message.
696
- * @param text The new text of the message.
656
+ * @param from The identifier of a chat to forward the messages from.
657
+ * @param to The identifier of a chat to forward the messages to.
658
+ * @param messageIds The identifiers of the messages to forward.
659
+ * @returns The forwarded messages.
697
660
  */
698
- abstract editInlineMessageText(inlineMessageId: string, text: string, params?: EditInlineMessageTextParams): Promise<void>;
661
+ abstract forwardMessages(from: ID, to: ID, messageIds: number[], params?: ForwardMessagesParams): Promise<Message[]>;
699
662
  /**
700
- * Edit an inline message's rich text. Bot-only.
663
+ * Get favorite stickers. User-only.
701
664
  *
702
665
  * @method ms
703
- * @param inlineMessageId The identifier of the inline message.
704
- * @param richText The new rich text of the message.
705
666
  */
706
- abstract editInlineMessageRichText(inlineMessageId: string, richText: InputRichText, params?: EditInlineMessageRichTextParams): Promise<void>;
667
+ abstract getFavoriteStickers(): Promise<Sticker[]>;
707
668
  /**
708
- * Edit an inline message's caption. Bot-only.
669
+ * Get the link preview for a message that is about to be sent. User-only.
709
670
  *
710
671
  * @method ms
711
- * @param inlineMessageId The identifier of the inline message.
672
+ * @param text The message's text.
712
673
  */
713
- abstract editInlineMessageCaption(inlineMessageId: string, params?: EditInlineMessageCaptionParams): Promise<void>;
674
+ abstract getLinkPreview(text: string, params?: GetLinkPreviewParams): Promise<LinkPreview | null>;
714
675
  /**
715
- * Edit a message's reply markup.
676
+ * Retrieve a single message.
716
677
  *
717
678
  * @method ms
718
- * @param chatId The identifier of the chat which the message belongs to.
719
- * @param messageId The identifier of the message.
720
- * @returns The edited message.
679
+ * @param chatId The identifier of a chat.
680
+ * @param messageId The identifier of the message to retrieve.
681
+ * @example ```ts
682
+ * const message = await client.getMessage("@MTKruto", 212);
683
+ * ```
684
+ * @returns The retrieved message.
685
+ * @cache
721
686
  */
722
- abstract editMessageReplyMarkup(chatId: ID, messageId: number, params?: EditMessageReplyMarkupParams): Promise<Message>;
687
+ abstract getMessage(chatId: ID, messageId: number): Promise<Message | null>;
723
688
  /**
724
- * Edit an inline message's reply markup. Bot-only.
689
+ * Get the counters of a single message. User-only.
725
690
  *
726
691
  * @method ms
727
- * @param inlineMessageId The identifier of the inline message.
692
+ * @param chatId The identifier of the chat including the message.
693
+ * @param messageId The identifier of the message.
728
694
  */
729
- abstract editInlineMessageReplyMarkup(inlineMessageId: string, params?: EditMessageReplyMarkupParams): Promise<void>;
695
+ abstract getMessageCounters(chatId: ID, messageId: number): Promise<MessageCounters>;
730
696
  /**
731
- * Edit a message's live location.
697
+ * Get a list of reactions made to a message. User-only.
732
698
  *
733
699
  * @method ms
734
- * @param chatId The identifier of the chat which the message belongs to.
700
+ * @param chatId The identifier of a chat.
735
701
  * @param messageId The identifier of the message.
736
- * @param latitude The new latitude.
737
- * @param longitude The new longitude.
738
- * @returns The edited location message.
739
702
  */
740
- abstract editMessageLiveLocation(chatId: ID, messageId: number, latitude: number, longitude: number, params?: EditMessageLiveLocationParams): Promise<MessageLocation>;
703
+ abstract getMessageReactions(chatId: ID, messageId: number, params?: GetMessageReactionsParams): Promise<MessageReactionList>;
741
704
  /**
742
- * Edit an inline message's live location. Bot-only.
705
+ * Get a message's read date. User-only.
743
706
  *
744
707
  * @method ms
745
- * @param inlineMessageId The identifier of the inline message.
746
- * @param latitude The new latitude.
747
- * @param longitude The new longitude.
748
- * @returns The edited location message.
708
+ * @param chatId The identifier of a chat.
709
+ * @param messageId The identifier of the message.
749
710
  */
750
- abstract editInlineMessageLiveLocation(inlineMessageId: string, latitude: number, longitude: number, params?: EditMessageLiveLocationParams): Promise<void>;
711
+ abstract getMessageReadDate(chatId: ID, messageId: number): Promise<number>;
751
712
  /**
752
713
  * Retrieve multiple messages.
753
714
  *
@@ -762,85 +723,78 @@ export declare abstract class ClientGeneric {
762
723
  */
763
724
  abstract getMessages(chatId: ID, messageIds: number[]): Promise<Message[]>;
764
725
  /**
765
- * Retrieve a single message.
726
+ * Get the counters of multiple messages. User-only.
727
+ *
728
+ * @method ms
729
+ * @param chatId The identifier of the chat including the messages.
730
+ * @param messageIds The identifiers of the messages.
731
+ */
732
+ abstract getMessagesCounters(chatId: ID, messageIds: number[]): Promise<MessageCounters[]>;
733
+ /**
734
+ * Get a message's viewers. User-only.
766
735
  *
767
736
  * @method ms
768
737
  * @param chatId The identifier of a chat.
769
- * @param messageId The identifier of the message to retrieve.
770
- * @example ```ts
771
- * const message = await client.getMessage("@MTKruto", 212);
772
- * ```
773
- * @returns The retrieved message.
774
- * @cache
738
+ * @param messageId The identifier of the message.
739
+ * @returns The message's viewers.
775
740
  */
776
- abstract getMessage(chatId: ID, messageId: number): Promise<Message | null>;
741
+ abstract getMessageViewers(chatId: ID, messageId: number): Promise<MessageViewer[]>;
777
742
  /**
778
- * Retrieve a message using its link.
743
+ * Get a progress ID that can be passed to relevant send* methods to receive upload progress updates for them.
779
744
  *
780
745
  * @method ms
781
- * @param link A message link.
782
- * @example ```ts
783
- * const message = await client.resolveMessageLink("https://t.me/MTKruto/212");
784
- * ```
785
- * @returns The message that was linked to.
746
+ * @cache
786
747
  */
787
- abstract resolveMessageLink(link: string): Promise<Message | null>;
748
+ abstract getProgressId(): Promise<string>;
788
749
  /**
789
- * Delete multiple messages.
750
+ * Get recent stickers. User-only.
790
751
  *
791
752
  * @method ms
792
- * @param chatId The identifier of the chat which the message belongs to.
793
- * @param messageIds The identifiers of the messages to delete.
794
753
  */
795
- abstract deleteMessages(chatId: ID, messageIds: number[], params?: DeleteMessagesParams): Promise<void>;
754
+ abstract getRecentStickers(): Promise<Sticker[]>;
796
755
  /**
797
- * Delete a single message.
756
+ * Get a message's full rich text. User-only.
798
757
  *
799
758
  * @method ms
800
- * @param chatId The identifier of the chat which the message belongs to.
801
- * @param messageId The identifier of the message to delete.
759
+ * @param chatId The identifier of the chat including the message.
760
+ * @param messageId The identifier of the message.
802
761
  */
803
- abstract deleteMessage(chatId: ID, messageId: number, params?: DeleteMessageParams): Promise<void>;
762
+ abstract getRichText(chatId: ID, messageId: number): Promise<RichText | null>;
804
763
  /**
805
- * Delete all messages sent by a specific member of a chat. User-only.
764
+ * Get saved animations. User-only.
806
765
  *
807
766
  * @method ms
808
- * @param chatId The identifier of a chat. Must be a supergroup.
809
- * @param memberId The identifier of the member.
810
767
  */
811
- abstract deleteChatMemberMessages(chatId: ID, memberId: ID): Promise<void>;
768
+ abstract getSavedAnimations(): Promise<Animation[]>;
812
769
  /**
813
- * Delete multiple scheduled messages.
770
+ * Get a list of saved chats.
814
771
  *
815
772
  * @method ms
816
- * @param chatId The identifier of a chat.
817
- * @param messageIds The identifiers of the scheduled messages to delete.
818
773
  */
819
- abstract deleteScheduledMessages(chatId: ID, messageIds: number[]): Promise<void>;
774
+ abstract getSavedChats(params?: GetSavedChatsParams): Promise<SavedChats>;
820
775
  /**
821
- * Delete a scheduled message.
776
+ * Get messages saved from a specific chat.
822
777
  *
823
778
  * @method ms
824
779
  * @param chatId The identifier of a chat.
825
- * @param messageId The identifier of the scheduled message to delete.
826
780
  */
827
- abstract deleteScheduledMessage(chatId: ID, messageId: number): Promise<void>;
781
+ abstract getSavedMessages(chatId: ID, params?: GetSavedMessagesParams): Promise<Message[]>;
828
782
  /**
829
- * Send multiple scheduled messages before their schedule.
783
+ * Get the scheduled messages of a chat. User-only.
830
784
  *
831
785
  * @method ms
832
- * @param chatId The identifier of a chat.
833
- * @param messageIds The identifiers of the scheduled messages to send.
786
+ * @param chatId The identifier of the chat including the scheduled messages.
834
787
  */
835
- abstract sendScheduledMessages(chatId: ID, messageIds: number[]): Promise<Message[]>;
788
+ abstract getScheduledMessages(chatId: ID): Promise<Message[]>;
836
789
  /**
837
- * Send a scheduled message before its schedule.
790
+ * Open a mini app. User-only.
838
791
  *
839
792
  * @method ms
840
- * @param chatId The identifier of a chat.
841
- * @param messageId The identifier of the scheduled message to send.
793
+ * @param botId The identifier of a bot with the mini app.
794
+ * @param chatId The identifier of the chat from which the mini app is opened.
795
+ * @cache
842
796
  */
843
- abstract sendScheduledMessage(chatId: ID, messageId: number): Promise<Message>;
797
+ abstract openMiniApp(botId: ID, chatId: ID, params?: OpenMiniAppParams): Promise<MiniAppInfo>;
844
798
  /**
845
799
  * Pin a message in a chat.
846
800
  *
@@ -850,49 +804,69 @@ export declare abstract class ClientGeneric {
850
804
  */
851
805
  abstract pinMessage(chatId: ID, messageId: number, params?: PinMessageParams): Promise<void>;
852
806
  /**
853
- * Unpin a pinned message.
807
+ * Mark messages as read. User-only.
854
808
  *
855
809
  * @method ms
856
- * @param chatId The identifier of a chat.
857
- * @param messageId The identifier of the message.
810
+ * @param chatId The identifier of the chat which the messages belong to.
811
+ * @param untilMessageId The identifier of the message that will be marked as read, along with any other unread messages before it.
858
812
  */
859
- abstract unpinMessage(chatId: ID, messageId: number, params?: UnpinMessageParams): Promise<void>;
813
+ abstract readMessages(chatId: ID, untilMessageId: number): Promise<void>;
860
814
  /**
861
- * Unpin all pinned messages.
815
+ * Remove a sticker from favorites. User-only.
862
816
  *
863
817
  * @method ms
864
- * @param chatId The identifier of a chat.
818
+ * @param fileId The file identifier of the sticker.
865
819
  */
866
- abstract unpinMessages(chatId: ID, params?: UnpinMessagesParams): Promise<void>;
820
+ abstract removeStickerFromFavorites(fileId: string): Promise<void>;
867
821
  /**
868
- * Forward multiple messages.
822
+ * Remove a sticker from recents. User-only.
869
823
  *
870
824
  * @method ms
871
- * @param from The identifier of a chat to forward the messages from.
872
- * @param to The identifier of a chat to forward the messages to.
873
- * @param messageIds The identifiers of the messages to forward.
874
- * @returns The forwarded messages.
825
+ * @param fileId The file identifier of the sticker.
875
826
  */
876
- abstract forwardMessages(from: ID, to: ID, messageIds: number[], params?: ForwardMessagesParams): Promise<Message[]>;
827
+ abstract removeStickerFromRecents(fileId: string): Promise<void>;
877
828
  /**
878
- * Forward a single message.
829
+ * Retrieve a message using its link.
879
830
  *
880
831
  * @method ms
881
- * @param from The identifier of a chat to forward the message from.
882
- * @param to The identifier of a chat to forward the message to.
883
- * @param messageId The identifier of the message to forward.
884
- * @returns The forwarded message.
832
+ * @param link A message link.
833
+ * @example ```ts
834
+ * const message = await client.resolveMessageLink("https://t.me/MTKruto/212");
835
+ * ```
836
+ * @returns The message that was linked to.
885
837
  */
886
- abstract forwardMessage(from: ID, to: ID, messageId: number, params?: ForwardMessagesParams): Promise<Message>;
838
+ abstract resolveMessageLink(link: string): Promise<Message | null>;
887
839
  /**
888
- * Stop a poll.
840
+ * Save an animation. User-only.
889
841
  *
890
842
  * @method ms
891
- * @param chatId The chat that includes the poll.
892
- * @param messageId The identifier of the poll's message.
893
- * @returns The new state of the poll.
843
+ * @param fileId The file identifier of the animation.
894
844
  */
895
- abstract stopPoll(chatId: ID, messageId: number, params?: StopPollParams): Promise<Poll>;
845
+ abstract saveAnimation(fileId: string): Promise<void>;
846
+ /**
847
+ * Search for messages. User-only.
848
+ *
849
+ * @method ms
850
+ */
851
+ abstract searchMessages(params?: SearchMessagesParams): Promise<MessageList>;
852
+ /**
853
+ * Send an animation.
854
+ *
855
+ * @method ms
856
+ * @param chatId The identifier of a chat to send the animation to.
857
+ * @param animation The animation to send.
858
+ * @returns The sent animation.
859
+ */
860
+ abstract sendAnimation(chatId: ID, animation: FileSource, params?: SendAnimationParams): Promise<MessageAnimation>;
861
+ /**
862
+ * Send an audio file.
863
+ *
864
+ * @method ms
865
+ * @param chatId The identifier of a chat to send the audio file to.
866
+ * @param audio The audio to send.
867
+ * @returns The sent audio file.
868
+ */
869
+ abstract sendAudio(chatId: ID, audio: FileSource, params?: SendAudioParams): Promise<MessageAudio>;
896
870
  /**
897
871
  * Send a chat action.
898
872
  *
@@ -904,235 +878,301 @@ export declare abstract class ClientGeneric {
904
878
  messageThreadId?: number;
905
879
  }): Promise<void>;
906
880
  /**
907
- * Search for messages. User-only.
881
+ * Send a checklist.
908
882
  *
909
883
  * @method ms
884
+ * @param chatId The identifier of a chat to send the checklist to.
885
+ * @param title The checklist's title.
886
+ * @param items The checklist's items.
887
+ * @returns The sent checklist.
910
888
  */
911
- abstract searchMessages(params?: SearchMessagesParams): Promise<MessageList>;
889
+ abstract sendChecklist(chatId: ID, title: string, items: InputChecklistItem[], params?: SendChecklistParams): Promise<MessageChecklist>;
912
890
  /**
913
- * Mark messages as read. User-only.
891
+ * Send a contact.
914
892
  *
915
893
  * @method ms
916
- * @param chatId The identifier of the chat which the messages belong to.
917
- * @param untilMessageId The identifier of the message that will be marked as read, along with any other unread messages before it.
894
+ * @param chatId The identifier of a chat to send the contact to.
895
+ * @param firstName The contact's first name.
896
+ * @param phoneNumber The contact's phone number.
897
+ * @returns The sent contact.
918
898
  */
919
- abstract readMessages(chatId: ID, untilMessageId: number): Promise<void>;
899
+ abstract sendContact(chatId: ID, firstName: string, phoneNumber: string, params?: SendContactParams): Promise<MessageContact>;
920
900
  /**
921
- * Start a bot. User-only.
901
+ * Send a dice.
922
902
  *
923
903
  * @method ms
924
- * @param botId The identifier of the bot to start.
925
- * @returns The start message.
904
+ * @param chatId The identifier of a chat to send the dice to.
905
+ * @returns The sent dice.
926
906
  */
927
- abstract startBot(botId: number, params?: StartBotParams): Promise<Message>;
907
+ abstract sendDice(chatId: ID, params?: SendDiceParams): Promise<MessageDice>;
928
908
  /**
929
- * Transcribe a voice message. User-only.
909
+ * Send a document.
930
910
  *
931
911
  * @method ms
932
- * @param chatId The identifier of the chat which the message belongs to.
933
- * @param messageId The identifier of the message.
934
- * @cache
912
+ * @param chatId The identifier of a chat to send the document to.
913
+ * @param document The document to send.
914
+ * @returns The sent document.
935
915
  */
936
- abstract transcribeVoice(chatId: ID, messageId: number): Promise<VoiceTranscription>;
937
- abstract getLinkPreview(text: string, params?: GetLinkPreviewParams): Promise<LinkPreview | null>;
916
+ abstract sendDocument(chatId: ID, document: FileSource, params?: SendDocumentParams): Promise<MessageDocument>;
938
917
  /**
939
- * Open a mini app. User-only.
918
+ * Send an invoice. Bot-only.
940
919
  *
941
920
  * @method ms
942
- * @param botId The identifier of a bot with the mini app.
943
- * @param chatId The identifier of the chat from which the mini app is opened.
944
- * @cache
921
+ * @param chatId The identifier of a chat to send the invoice to.
922
+ * @param title The invoice's title.
923
+ * @param description The invoice's description.
924
+ * @param payload The invoice's payload.
925
+ * @param currency The invoice's currency.
926
+ * @param prices The invoice's price tags.
927
+ * @returns The sent invoice.
945
928
  */
946
- abstract openMiniApp(botId: ID, chatId: ID, params?: OpenMiniAppParams): Promise<MiniAppInfo>;
929
+ abstract sendInvoice(chatId: ID, title: string, description: string, payload: string, currency: string, prices: PriceTag[], params?: SendInvoiceParams): Promise<MessageInvoice>;
947
930
  /**
948
- * Get a progress ID that can be passed to relevant send* methods to receive upload progress updates for them.
931
+ * Send a live photo.
949
932
  *
950
933
  * @method ms
951
- * @cache
934
+ * @param chatId The identifier of a chat to send the photo to.
935
+ * @param photo The photo to send.
936
+ * @param video The video version of the photo.
937
+ * @returns The sent live photo.
952
938
  */
953
- abstract getProgressId(): Promise<string>;
939
+ abstract sendLivePhoto(chatId: ID, photo: FileSource, video: FileSource, params?: SendLivePhotoParams): Promise<MessageLivePhoto>;
954
940
  /**
955
- * Get messages saved from a specific chat.
941
+ * Send a location.
956
942
  *
957
943
  * @method ms
958
- * @param chatId The identifier of a chat.
944
+ * @param chatId The identifier of a chat to send the location to.
945
+ * @param latitude The location's latitude.
946
+ * @param longitude The location's longitude.
947
+ * @returns The sent location.
959
948
  */
960
- abstract getSavedMessages(chatId: ID, params?: GetSavedMessagesParams): Promise<Message[]>;
949
+ abstract sendLocation(chatId: ID, latitude: number, longitude: number, params?: SendLocationParams): Promise<MessageLocation>;
961
950
  /**
962
- * Get a list of saved chats.
951
+ * Send a media group.
963
952
  *
964
953
  * @method ms
954
+ * @param chatId The identifier of a chat to send the media group to.
955
+ * @param media The media to include in the media group. Animations are not allowed. All of them must be of the same media type, but an exception is that photos and videos can be mixed.
956
+ * @returns The sent messages.
965
957
  */
966
- abstract getSavedChats(params?: GetSavedChatsParams): Promise<SavedChats>;
958
+ abstract sendMediaGroup(chatId: ID, media: InputMedia[], params?: SendMediaGroupParams): Promise<Message[]>;
967
959
  /**
968
- * Get a list of reactions made to a message. User-only.
960
+ * Send a text message.
969
961
  *
970
962
  * @method ms
971
- * @param chatId The identifier of a chat.
972
- * @param messageId The identifier of the message.
963
+ * @param chatId The identifier of a chat to send the message to.
964
+ * @param text The message's text.
965
+ * @returns The sent text message.
973
966
  */
974
- abstract getMessageReactions(chatId: ID, messageId: number, params?: GetMessageReactionsParams): Promise<MessageReactionList>;
967
+ abstract sendMessage(chatId: ID, text: string, params?: SendMessageParams): Promise<MessageText>;
975
968
  /**
976
- * Set a reaction as default. User-only.
969
+ * Stream a drafted text message. Bot-only.
977
970
  *
978
971
  * @method ms
979
- * @param reaction The reaction to set as default.
972
+ * @param chatId The identifier of a chat to send the message to.
973
+ * @param draftId The identifier of the draft.
974
+ * @param text The message's text.
980
975
  */
981
- abstract setDefaultReaction(reaction: Reaction): Promise<void>;
976
+ abstract sendMessageDraft(chatId: ID, draftId: number, text: string, params?: SendMessageDraftParams): Promise<void>;
982
977
  /**
983
- * Clear all message drafts. User-only.
978
+ * Send a photo.
984
979
  *
985
980
  * @method ms
981
+ * @param chatId The identifier of a chat to send the photo to.
982
+ * @param photo The photo to send.
983
+ * @returns The sent photo.
986
984
  */
987
- abstract clearDrafts(): Promise<void>;
985
+ abstract sendPhoto(chatId: ID, photo: FileSource, params?: SendPhotoParams): Promise<MessagePhoto>;
988
986
  /**
989
- * Summarize a message's text. User-only.
987
+ * Send a poll.
990
988
  *
991
989
  * @method ms
992
- * @param chatId The identifier of a chat.
993
- * @param messageId The identifier of a message.
990
+ * @param chatId The identifier of a chat to send the poll to.
991
+ * @param question The poll's question.
992
+ * @param options The poll's options.
993
+ * @returns The sent poll.
994
994
  */
995
- abstract summarizeText(chatId: ID, messageId: number, params?: SummarizeTextParams): Promise<SummarizedText>;
995
+ abstract sendPoll(chatId: ID, question: string, options: InputPollOption[], params?: SendPollParams): Promise<MessagePoll>;
996
996
  /**
997
- * View multiple messages. User-only.
997
+ * Send a rich text message.
998
998
  *
999
999
  * @method ms
1000
- * @param chatId The identifier of the chat including the messages.
1001
- * @param messageIds The identifiers of the messages.
1000
+ * @param chatId The identifier of a chat to send the message to.
1001
+ * @param richText The message's rich text.
1002
+ * @returns The sent rich text message.
1002
1003
  */
1003
- abstract viewMessages(chatId: ID, messageIds: number[]): Promise<void>;
1004
+ abstract sendRichText(chatId: ID, richText: InputRichText, params?: SendRichTextParams): Promise<MessageRichText>;
1004
1005
  /**
1005
- * View a single message. User-only.
1006
+ * Stream a drafted rich text message. Bot-only.
1006
1007
  *
1007
1008
  * @method ms
1008
- * @param chatId The identifier of the chat including the message.
1009
- * @param messageId The identifier of the message.
1009
+ * @param chatId The identifier of a chat to send the message to.
1010
+ * @param draftId The identifier of the draft.
1011
+ * @param richText The message's rich text.
1010
1012
  */
1011
- abstract viewMessage(chatId: ID, messageId: number): Promise<void>;
1013
+ abstract sendRichTextDraft(chatId: ID, draftId: number, richText: InputRichText, params?: SendRichTextDraftParams): Promise<void>;
1012
1014
  /**
1013
- * Translate multiple texts. User-only.
1015
+ * Send a scheduled message before its schedule.
1014
1016
  *
1015
1017
  * @method ms
1016
- * @param toLanguage The code of the language to translate into.
1017
- * @param texts The texts to translate.
1018
+ * @param chatId The identifier of a chat.
1019
+ * @param messageId The identifier of the scheduled message to send.
1018
1020
  */
1019
- abstract translateTexts(toLanguage: string, texts: TextToTranslate[], params?: TranslateTextParams): Promise<TranslatedText[]>;
1021
+ abstract sendScheduledMessage(chatId: ID, messageId: number): Promise<Message>;
1020
1022
  /**
1021
- * Translate a single text. User-only.
1023
+ * Send multiple scheduled messages before their schedule.
1022
1024
  *
1023
1025
  * @method ms
1024
- * @param toLanguage The code of the language to translate into.
1025
- * @param text The text to translate.
1026
+ * @param chatId The identifier of a chat.
1027
+ * @param messageIds The identifiers of the scheduled messages to send.
1026
1028
  */
1027
- abstract translateText(toLanguage: string, text: TextToTranslate, params?: TranslateTextParams): Promise<TranslatedText>;
1029
+ abstract sendScheduledMessages(chatId: ID, messageIds: number[]): Promise<Message[]>;
1028
1030
  /**
1029
- * Translate multiple texts. User-only.
1031
+ * Send a screenshot notification. User-only.
1030
1032
  *
1031
1033
  * @method ms
1032
- * @param toLanguage The code of the language to translate into.
1033
- * @param chatId The identifier of the chat including the messages.
1034
- * @param messageIds The identifiers of the messages to translate.
1034
+ * @param chatId The identifier of a chat.
1035
+ * @param replyToMessageId The identifier of the message.
1035
1036
  */
1036
- abstract translateMessages(toLanguage: string, chatId: ID, messageIds: number[], params?: TranslateTextParams): Promise<TranslatedText[]>;
1037
+ abstract sendScreenshotNotification(chatId: ID, replyToMessageId: number): Promise<void>;
1037
1038
  /**
1038
- * Translate a single text. User-only.
1039
+ * Send a sticker.
1039
1040
  *
1040
1041
  * @method ms
1041
- * @param toLanguage The code of the language to translate into.
1042
- * @param chatId The identifier of the chat including the message.
1043
- * @param messageId The identifier of the message to translate.
1042
+ * @param chatId The identifier of a chat to send the sticker to.
1043
+ * @param sticker The sticker to send.
1044
+ * @returns The sent sticker.
1044
1045
  */
1045
- abstract translateMessage(toLanguage: string, chatId: ID, messageId: number, params?: TranslateTextParams): Promise<TranslatedText>;
1046
+ abstract sendSticker(chatId: ID, sticker: FileSource, params?: SendStickerParams): Promise<MessageSticker>;
1046
1047
  /**
1047
- * Get the counters of multiple messages. User-only.
1048
+ * Send a venue.
1048
1049
  *
1049
1050
  * @method ms
1050
- * @param chatId The identifier of the chat including the messages.
1051
- * @param messageIds The identifiers of the messages.
1051
+ * @param chatId The identifier of a chat to send the venue to.
1052
+ * @param latitude The latitude of the venue.
1053
+ * @param longitude The longitude of the venue.
1054
+ * @param title The title of the venue.
1055
+ * @param address The written address of the venue.
1056
+ * @returns The sent venue.
1052
1057
  */
1053
- abstract getMessagesCounters(chatId: ID, messageIds: number[]): Promise<MessageCounters[]>;
1058
+ abstract sendVenue(chatId: ID, latitude: number, longitude: number, title: string, address: string, params?: SendVenueParams): Promise<MessageVenue>;
1054
1059
  /**
1055
- * Get the counters of a single message. User-only.
1060
+ * Send a video.
1056
1061
  *
1057
1062
  * @method ms
1058
- * @param chatId The identifier of the chat including the message.
1059
- * @param messageId The identifier of the message.
1063
+ * @param chatId The identifier of a chat to send the video to.
1064
+ * @param video The video to send.
1065
+ * @returns The sent video.
1060
1066
  */
1061
- abstract getMessageCounters(chatId: ID, messageId: number): Promise<MessageCounters>;
1067
+ abstract sendVideo(chatId: ID, video: FileSource, params?: SendVideoParams): Promise<MessageVideo>;
1062
1068
  /**
1063
- * Get a message's full rich text. User-only.
1069
+ * Send a video note.
1064
1070
  *
1065
1071
  * @method ms
1066
- * @param chatId The identifier of the chat including the message.
1067
- * @param messageId The identifier of the message.
1072
+ * @param chatId The identifier of a chat to send the video note to.
1073
+ * @param videoNote The video note to send.
1074
+ * @returns The sent video note.
1075
+ */
1076
+ abstract sendVideoNote(chatId: ID, videoNote: FileSource, params?: SendVideoNoteParams): Promise<MessageVideoNote>;
1077
+ /**
1078
+ * Send a voice message.
1079
+ *
1080
+ * @method ms
1081
+ * @param chatId The identifier of a chat to send the voice message to.
1082
+ * @param voice The voice to send.
1083
+ * @returns The sent voice message.
1084
+ */
1085
+ abstract sendVoice(chatId: ID, voice: FileSource, params?: SendVoiceParams): Promise<MessageVoice>;
1086
+ /**
1087
+ * Set a reaction as default. User-only.
1088
+ *
1089
+ * @method ms
1090
+ * @param reaction The reaction to set as default.
1068
1091
  */
1069
- abstract getRichText(chatId: ID, messageId: number): Promise<RichText | null>;
1092
+ abstract setDefaultReaction(reaction: Reaction): Promise<void>;
1070
1093
  /**
1071
- * Get the scheduled messages of a chat. User-only.
1094
+ * Start a bot. User-only.
1072
1095
  *
1073
1096
  * @method ms
1074
- * @param chatId The identifier of the chat including the scheduled messages.
1097
+ * @param botId The identifier of the bot to start.
1098
+ * @returns The start message.
1075
1099
  */
1076
- abstract getScheduledMessages(chatId: ID): Promise<Message[]>;
1100
+ abstract startBot(botId: number, params?: StartBotParams): Promise<Message>;
1077
1101
  /**
1078
- * Get favorite stickers. User-only.
1102
+ * Stop a poll.
1079
1103
  *
1080
1104
  * @method ms
1105
+ * @param chatId The chat that includes the poll.
1106
+ * @param messageId The identifier of the poll's message.
1107
+ * @returns The new state of the poll.
1081
1108
  */
1082
- abstract getFavoriteStickers(): Promise<Sticker[]>;
1109
+ abstract stopPoll(chatId: ID, messageId: number, params?: StopPollParams): Promise<Poll>;
1083
1110
  /**
1084
- * Add a sticker to favorites. User-only.
1111
+ * Summarize a message's text. User-only.
1085
1112
  *
1086
1113
  * @method ms
1087
- * @param fileId The file identifier of the sticker.
1114
+ * @param chatId The identifier of a chat.
1115
+ * @param messageId The identifier of a message.
1088
1116
  */
1089
- abstract addStickerToFavorites(fileId: string): Promise<void>;
1117
+ abstract summarizeText(chatId: ID, messageId: number, params?: SummarizeTextParams): Promise<SummarizedText>;
1090
1118
  /**
1091
- * Remove a sticker from favorites. User-only.
1119
+ * Transcribe a voice message. User-only.
1092
1120
  *
1093
1121
  * @method ms
1094
- * @param fileId The file identifier of the sticker.
1122
+ * @param chatId The identifier of the chat which the message belongs to.
1123
+ * @param messageId The identifier of the message.
1124
+ * @cache
1095
1125
  */
1096
- abstract removeStickerFromFavorites(fileId: string): Promise<void>;
1126
+ abstract transcribeVoice(chatId: ID, messageId: number): Promise<VoiceTranscription>;
1097
1127
  /**
1098
- * Add a sticker to recents. User-only.
1128
+ * Translate a single text. User-only.
1099
1129
  *
1100
1130
  * @method ms
1101
- * @param fileId The file identifier of the sticker.
1131
+ * @param toLanguage The code of the language to translate into.
1132
+ * @param chatId The identifier of the chat including the message.
1133
+ * @param messageId The identifier of the message to translate.
1102
1134
  */
1103
- abstract addStickerToRecents(fileId: string): Promise<void>;
1135
+ abstract translateMessage(toLanguage: string, chatId: ID, messageId: number, params?: TranslateTextParams): Promise<TranslatedText>;
1104
1136
  /**
1105
- * Remove a sticker from recents. User-only.
1137
+ * Translate multiple texts. User-only.
1106
1138
  *
1107
1139
  * @method ms
1108
- * @param fileId The file identifier of the sticker.
1140
+ * @param toLanguage The code of the language to translate into.
1141
+ * @param chatId The identifier of the chat including the messages.
1142
+ * @param messageIds The identifiers of the messages to translate.
1109
1143
  */
1110
- abstract removeStickerFromRecents(fileId: string): Promise<void>;
1144
+ abstract translateMessages(toLanguage: string, chatId: ID, messageIds: number[], params?: TranslateTextParams): Promise<TranslatedText[]>;
1111
1145
  /**
1112
- * Get recent stickers. User-only.
1146
+ * Translate a single text. User-only.
1113
1147
  *
1114
1148
  * @method ms
1149
+ * @param toLanguage The code of the language to translate into.
1150
+ * @param text The text to translate.
1115
1151
  */
1116
- abstract getRecentStickers(): Promise<Sticker[]>;
1152
+ abstract translateText(toLanguage: string, text: TextToTranslate, params?: TranslateTextParams): Promise<TranslatedText>;
1117
1153
  /**
1118
- * Clear recent stickers. User-only.
1154
+ * Translate multiple texts. User-only.
1119
1155
  *
1120
1156
  * @method ms
1157
+ * @param toLanguage The code of the language to translate into.
1158
+ * @param texts The texts to translate.
1121
1159
  */
1122
- abstract clearRecentStickers(): Promise<void>;
1160
+ abstract translateTexts(toLanguage: string, texts: TextToTranslate[], params?: TranslateTextParams): Promise<TranslatedText[]>;
1123
1161
  /**
1124
- * Get saved animations. User-only.
1162
+ * Unpin a pinned message.
1125
1163
  *
1126
1164
  * @method ms
1165
+ * @param chatId The identifier of a chat.
1166
+ * @param messageId The identifier of the message.
1127
1167
  */
1128
- abstract getSavedAnimations(): Promise<Animation[]>;
1168
+ abstract unpinMessage(chatId: ID, messageId: number, params?: UnpinMessageParams): Promise<void>;
1129
1169
  /**
1130
- * Save an animation. User-only.
1170
+ * Unpin all pinned messages.
1131
1171
  *
1132
1172
  * @method ms
1133
- * @param fileId The file identifier of the animation.
1173
+ * @param chatId The identifier of a chat.
1134
1174
  */
1135
- abstract saveAnimation(fileId: string): Promise<void>;
1175
+ abstract unpinMessages(chatId: ID, params?: UnpinMessagesParams): Promise<void>;
1136
1176
  /**
1137
1177
  * Unsave an animation. User-only.
1138
1178
  *
@@ -1141,63 +1181,64 @@ export declare abstract class ClientGeneric {
1141
1181
  */
1142
1182
  abstract unsaveAnimation(fileId: string): Promise<void>;
1143
1183
  /**
1144
- * Get a message's read date. User-only.
1184
+ * View a single message. User-only.
1145
1185
  *
1146
1186
  * @method ms
1147
- * @param chatId The identifier of a chat.
1187
+ * @param chatId The identifier of the chat including the message.
1148
1188
  * @param messageId The identifier of the message.
1149
1189
  */
1150
- abstract getMessageReadDate(chatId: ID, messageId: number): Promise<number>;
1190
+ abstract viewMessage(chatId: ID, messageId: number): Promise<void>;
1151
1191
  /**
1152
- * Get a message's viewers. User-only.
1192
+ * View multiple messages. User-only.
1153
1193
  *
1154
1194
  * @method ms
1155
- * @param chatId The identifier of a chat.
1156
- * @param messageId The identifier of the message.
1157
- * @returns The message's viewers.
1195
+ * @param chatId The identifier of the chat including the messages.
1196
+ * @param messageIds The identifiers of the messages.
1158
1197
  */
1159
- abstract getMessageViewers(chatId: ID, messageId: number): Promise<MessageViewer[]>;
1198
+ abstract viewMessages(chatId: ID, messageIds: number[]): Promise<void>;
1160
1199
  /**
1161
- * Cast a vote. User-only.
1200
+ * Add an option to a poll. User-only.
1162
1201
  *
1163
1202
  * @method pl
1164
1203
  * @param chatId The identifier of the chat that includes the poll.
1165
1204
  * @param messageId The identifier of the message that includes the poll.
1166
- * @param optionIndexes The indexes of the options to cast for.
1205
+ * @param option The option to add.
1167
1206
  */
1168
- abstract vote(chatId: ID, messageId: number, optionIndexes: number[]): Promise<void>;
1207
+ abstract addPollOption(chatId: ID, messageId: number, option: InputPollOption): Promise<void>;
1169
1208
  /**
1170
- * Retract a vote. User-only.
1209
+ * Get poll voters. User-only.
1171
1210
  *
1172
1211
  * @method pl
1173
1212
  * @param chatId The identifier of the chat that includes the poll.
1174
1213
  * @param messageId The identifier of the message that includes the poll.
1175
1214
  */
1176
- abstract retractVote(chatId: ID, messageId: number): Promise<void>;
1215
+ abstract getPollVoters(chatId: ID, messageId: number, params?: GetPollVotersParams): Promise<PollVoterList>;
1177
1216
  /**
1178
- * Add an option to a poll. User-only.
1217
+ * Remove an option from a poll. User-only.
1179
1218
  *
1219
+ * @method pl
1180
1220
  * @param chatId The identifier of the chat that includes the poll.
1181
1221
  * @param messageId The identifier of the message that includes the poll.
1182
- * @param option The option to add.
1222
+ * @param optionIndex The index of the option to remove.
1183
1223
  */
1184
- abstract addPollOption(chatId: ID, messageId: number, option: InputPollOption): Promise<void>;
1224
+ abstract removePollOption(chatId: ID, messageId: number, optionIndex: number): Promise<void>;
1185
1225
  /**
1186
- * Remove an option from a poll. User-only.
1226
+ * Retract a vote. User-only.
1187
1227
  *
1228
+ * @method pl
1188
1229
  * @param chatId The identifier of the chat that includes the poll.
1189
1230
  * @param messageId The identifier of the message that includes the poll.
1190
- * @param optionIndex The index of the option to remove.
1191
1231
  */
1192
- abstract removePollOption(chatId: ID, messageId: number, optionIndex: number): Promise<void>;
1232
+ abstract retractVote(chatId: ID, messageId: number): Promise<void>;
1193
1233
  /**
1194
- * Get poll voters. User-only.
1234
+ * Cast a vote. User-only.
1195
1235
  *
1196
1236
  * @method pl
1197
1237
  * @param chatId The identifier of the chat that includes the poll.
1198
1238
  * @param messageId The identifier of the message that includes the poll.
1239
+ * @param optionIndexes The indexes of the options to cast for.
1199
1240
  */
1200
- abstract getPollVoters(chatId: ID, messageId: number, params?: GetPollVotersParams): Promise<PollVoterList>;
1241
+ abstract vote(chatId: ID, messageId: number, optionIndexes: number[]): Promise<void>;
1201
1242
  /**
1202
1243
  * Add items to a checklist. User-only.
1203
1244
  *
@@ -1208,13 +1249,14 @@ export declare abstract class ClientGeneric {
1208
1249
  */
1209
1250
  abstract addToChecklist(chatId: ID, messageId: number, items: InputChecklistItem[]): Promise<void>;
1210
1251
  /**
1211
- * Update a checklist. User-only.
1252
+ * Check a single item of a checklist. User-only.
1212
1253
  *
1213
1254
  * @param chatId The identifier of a chat.
1214
1255
  * @param messageId The identifier of the checklist message.
1256
+ * @param item The identifier of the item to check.
1215
1257
  * @method cl
1216
1258
  */
1217
- abstract updateChecklist(chatId: ID, messageId: number, params?: UpdateChecklistParams): Promise<void>;
1259
+ abstract checkChecklistItem(chatId: ID, messageId: number, item: number): Promise<void>;
1218
1260
  /**
1219
1261
  * Check multiple items of a checklist. User-only.
1220
1262
  *
@@ -1225,44 +1267,31 @@ export declare abstract class ClientGeneric {
1225
1267
  */
1226
1268
  abstract checkChecklistItems(chatId: ID, messageId: number, items: number[]): Promise<void>;
1227
1269
  /**
1228
- * Uncheck multiple items of a checklist. User-only.
1270
+ * Uncheck a single item of a checklist. User-only.
1229
1271
  *
1230
1272
  * @param chatId The identifier of a chat.
1231
1273
  * @param messageId The identifier of the checklist message.
1232
- * @param items The identifiers of the items to uncheck.
1274
+ * @param item The identifier of the item to uncheck.
1233
1275
  * @method cl
1234
1276
  */
1235
- abstract uncheckChecklistItems(chatId: ID, messageId: number, items: number[]): Promise<void>;
1277
+ abstract uncheckChecklistItem(chatId: ID, messageId: number, item: number): Promise<void>;
1236
1278
  /**
1237
- * Check a single item of a checklist. User-only.
1279
+ * Uncheck multiple items of a checklist. User-only.
1238
1280
  *
1239
1281
  * @param chatId The identifier of a chat.
1240
1282
  * @param messageId The identifier of the checklist message.
1241
- * @param item The identifier of the item to check.
1283
+ * @param items The identifiers of the items to uncheck.
1242
1284
  * @method cl
1243
1285
  */
1244
- abstract checkChecklistItem(chatId: ID, messageId: number, item: number): Promise<void>;
1286
+ abstract uncheckChecklistItems(chatId: ID, messageId: number, items: number[]): Promise<void>;
1245
1287
  /**
1246
- * Uncheck a single item of a checklist. User-only.
1288
+ * Update a checklist. User-only.
1247
1289
  *
1248
1290
  * @param chatId The identifier of a chat.
1249
1291
  * @param messageId The identifier of the checklist message.
1250
- * @param item The identifier of the item to uncheck.
1251
1292
  * @method cl
1252
1293
  */
1253
- abstract uncheckChecklistItem(chatId: ID, messageId: number, item: number): Promise<void>;
1254
- /**
1255
- * Download a chunk of a file.
1256
- *
1257
- * @method fs
1258
- * @param fileId The identifier of a file.
1259
- * @example ```ts
1260
- * const chunk = await client.downloadChunk(fileId, { chunkSize: 256 * 1024 });
1261
- * ```
1262
- * @returns The downloaded chunk.
1263
- * @cache file
1264
- */
1265
- abstract downloadChunk(fileId: string, params?: DownloadParams): Promise<Uint8Array>;
1294
+ abstract updateChecklist(chatId: ID, messageId: number, params?: UpdateChecklistParams): Promise<void>;
1266
1295
  /**
1267
1296
  * Download a file.
1268
1297
  *
@@ -1277,6 +1306,18 @@ export declare abstract class ClientGeneric {
1277
1306
  * @cache file
1278
1307
  */
1279
1308
  abstract download(fileId: string, params?: DownloadParams): AsyncGenerator<Uint8Array, void, unknown>;
1309
+ /**
1310
+ * Download a chunk of a file.
1311
+ *
1312
+ * @method fs
1313
+ * @param fileId The identifier of a file.
1314
+ * @example ```ts
1315
+ * const chunk = await client.downloadChunk(fileId, { chunkSize: 256 * 1024 });
1316
+ * ```
1317
+ * @returns The downloaded chunk.
1318
+ * @cache file
1319
+ */
1320
+ abstract downloadChunk(fileId: string, params?: DownloadParams): Promise<Uint8Array>;
1280
1321
  /**
1281
1322
  * Get custom emoji documents for download.
1282
1323
  *
@@ -1287,636 +1328,673 @@ export declare abstract class ClientGeneric {
1287
1328
  */
1288
1329
  abstract getCustomEmojiStickers(id: string | string[]): Promise<Sticker[]>;
1289
1330
  /**
1290
- * Get chats from a chat list. User-only.
1331
+ * Add a single user to a chat.
1291
1332
  *
1292
1333
  * @method ch
1334
+ * @param chatId The identifier of a chat to add the user to.
1335
+ * @param userId The identifier of the user to add to the chat.
1336
+ * @returns An array of FailedInvitation that has at most a length of 1. If empty, it means that the user was added.
1293
1337
  */
1294
- abstract getChats(params?: GetChatsParams): Promise<ChatListItem[]>;
1338
+ abstract addChatMember(chatId: ID, userId: ID, params?: AddChatMemberParams): Promise<FailedInvitation[]>;
1295
1339
  /**
1296
- * Get pinned chats from a chat list. User-only.
1340
+ * Add multiple users at once to a channel or a supergroup.
1297
1341
  *
1298
1342
  * @method ch
1299
- * @param from The chat list to get the pinned chats from. Defaults to main.
1343
+ * @param chatId The identifier of the channel or supergroup to add the users to.
1344
+ * @param userIds The identifiers of the users to add to the channel or supergroup.
1345
+ * @returns An array of FailedInvitation that has at most a length that is the same as that of the parameter userIds. If empty, it means that all the provided users were added.
1300
1346
  */
1301
- abstract getPinnedChats(from?: "archived" | "main"): Promise<ChatListItem[]>;
1347
+ abstract addChatMembers(chatId: ID, userIds: ID[]): Promise<FailedInvitation[]>;
1302
1348
  /**
1303
- * Get a chat.
1349
+ * Approve a join request.
1304
1350
  *
1305
1351
  * @method ch
1306
- * @cache
1352
+ * @param chatId The identifier of a chat with the join request.
1353
+ * @param userId The user who made the join request.
1307
1354
  */
1308
- abstract getChat(chatId: ID): Promise<Chat>;
1355
+ abstract approveJoinRequest(chatId: ID, userId: ID): Promise<void>;
1309
1356
  /**
1310
- * Get chat history. User-only.
1357
+ * Approve all join requests. User-only.
1311
1358
  *
1312
1359
  * @method ch
1313
- * @param chatId The identifier of a chat.
1360
+ * @param chatId The identifier of a chat with the join requests.
1314
1361
  */
1315
- abstract getHistory(chatId: ID, params?: GetHistoryParams): Promise<Message[]>;
1362
+ abstract approveJoinRequests(chatId: ID, params?: ApproveJoinRequestsParams): Promise<void>;
1316
1363
  /**
1317
- * Set a chat's available reactions. User-only.
1364
+ * Archive a single chat. User-only.
1318
1365
  *
1319
1366
  * @method ch
1320
1367
  * @param chatId The identifier of a chat.
1321
- * @param availableReactions The new available reactions.
1322
1368
  */
1323
- abstract setAvailableReactions(chatId: ID, availableReactions: AvailableReactions): Promise<void>;
1369
+ abstract archiveChat(chatId: ID): Promise<void>;
1324
1370
  /**
1325
- * Set a chat's photo.
1371
+ * Archive multiple chats. User-only.
1326
1372
  *
1327
1373
  * @method ch
1328
- * @param chatId The identifier of a chat.
1329
- * @param photo A photo to set as the chat's photo.
1374
+ * @param chatIds The identifiers of the chats to archive.
1330
1375
  */
1331
- abstract setChatPhoto(chatId: ID, photo: FileSource, params?: SetChatPhotoParams): Promise<void>;
1376
+ abstract archiveChats(chatIds: ID[]): Promise<void>;
1332
1377
  /**
1333
- * Delete a chat's photo.
1378
+ * Ban a member from a chat.
1334
1379
  *
1335
1380
  * @method ch
1336
1381
  * @param chatId The identifier of a chat.
1382
+ * @param memberId The identifier of the member.
1337
1383
  */
1338
- abstract deleteChatPhoto(chatId: ID): Promise<void>;
1384
+ abstract banChatMember(chatId: ID, memberId: ID, params?: BanChatMemberParams): Promise<void>;
1339
1385
  /**
1340
- * Ban a member from a chat.
1386
+ * Close a chat previously opened by openChat.
1387
+ *
1388
+ * @method ch
1389
+ * @param chatId The identifier of a chat to close.
1390
+ */
1391
+ abstract closeChat(chatId: ID): Promise<void>;
1392
+ /**
1393
+ * Close a forum topic.
1341
1394
  *
1342
1395
  * @method ch
1343
1396
  * @param chatId The identifier of a chat.
1344
- * @param memberId The identifier of the member.
1397
+ * @param topicId The identifier of the topic.
1345
1398
  */
1346
- abstract banChatMember(chatId: ID, memberId: ID, params?: BanChatMemberParams): Promise<void>;
1399
+ abstract closeTopic(chatId: ID, topicId: number): Promise<void>;
1347
1400
  /**
1348
- * Unban a member from a chat.
1401
+ * Create a channel. User-only.
1349
1402
  *
1350
1403
  * @method ch
1351
- * @param chatId The identifier of a chat. Must be a supergroup.
1352
- * @param memberId The identifier of the member.
1404
+ * @param title The title of the channel.
1405
+ * @returns The created channel.
1406
+ */
1407
+ abstract createChannel(title: string, params?: CreateChannelParams): Promise<ChatPChannel>;
1408
+ /**
1409
+ * Create a group. User-only.
1410
+ *
1411
+ * @method ch
1412
+ * @param title The title of the group.
1413
+ * @returns The created group.
1414
+ */
1415
+ abstract createGroup(title: string, params?: CreateGroupParams): Promise<ChatPGroup>;
1416
+ /**
1417
+ * Create an invite link.
1418
+ *
1419
+ * @method ch
1420
+ * @param chatId The identifier of a chat to create the invite link for.
1421
+ * @returns The newly created invite link.
1422
+ */
1423
+ abstract createInviteLink(chatId: ID, params?: CreateInviteLinkParams): Promise<InviteLink>;
1424
+ /**
1425
+ * Create a supergroup. User-only.
1426
+ *
1427
+ * @method ch
1428
+ * @param title The title of the supergroup.
1429
+ * @returns The created supergroup.
1430
+ */
1431
+ abstract createSupergroup(title: string, params?: CreateSupergroupParams): Promise<ChatPSupergroup>;
1432
+ /**
1433
+ * Create a forum topic.
1434
+ *
1435
+ * @method ch
1436
+ * @param chatId The identifier of a chat.
1437
+ * @param title The title of the topic.
1438
+ * @returns The created topic.
1353
1439
  */
1354
- abstract unbanChatMember(chatId: ID, memberId: ID): Promise<void>;
1440
+ abstract createTopic(chatId: ID, title: string, params?: CreateTopicParams): Promise<Topic>;
1355
1441
  /**
1356
- * Kick a member from a chat. Same as a banChatMember call followed by unbanChatMember.
1442
+ * Decline a join request.
1357
1443
  *
1358
1444
  * @method ch
1359
- * @param chatId The identifier of a chat. Must be a supergroup.
1360
- * @param memberId The identifier of the member.
1445
+ * @param chatId The identifier of a chat with the join request.
1446
+ * @param userId The user who made the join request.
1361
1447
  */
1362
- abstract kickChatMember(chatId: ID, memberId: ID): Promise<void>;
1448
+ abstract declineJoinRequest(chatId: ID, userId: ID): Promise<void>;
1363
1449
  /**
1364
- * Set the rights of a chat member.
1450
+ * Decline all join requests. User-only.
1365
1451
  *
1366
1452
  * @method ch
1367
- * @param chatId The identifier of a chat. Must be a supergroup.
1368
- * @param memberId The identifier of the member.
1453
+ * @param chatId The identifier of a chat with the join requests.
1369
1454
  */
1370
- abstract setChatMemberRights(chatId: ID, memberId: ID, params?: SetChatMemberRightsParams): Promise<void>;
1455
+ abstract declineJoinRequests(chatId: ID, params?: DeclineJoinRequestsParams): Promise<void>;
1371
1456
  /**
1372
- * Get the administrators of a chat.
1457
+ * Delete a chat. User-only.
1373
1458
  *
1374
1459
  * @method ch
1375
1460
  * @param chatId The identifier of a chat.
1376
- * @returns The chat's administrators.
1377
1461
  */
1378
- abstract getChatAdministrators(chatId: ID): Promise<ChatMember[]>;
1462
+ abstract deleteChat(chatId: ID): Promise<void>;
1379
1463
  /**
1380
- * Enable join requests in a chat. User-only.
1464
+ * Delete a chat's photo.
1381
1465
  *
1382
1466
  * @method ch
1383
- * @param chatId The identifier of a chat. Must be a channel or a supergroup.
1467
+ * @param chatId The identifier of a chat.
1384
1468
  */
1385
- abstract enableJoinRequests(chatId: ID): Promise<void>;
1469
+ abstract deleteChatPhoto(chatId: ID): Promise<void>;
1386
1470
  /**
1387
- * Disable join requests in a chat. User-only.
1471
+ * Delete a chat's sticker set.
1388
1472
  *
1389
1473
  * @method ch
1390
- * @param chatId The identifier of a chat. Must be a channel or a supergroup.
1474
+ * @param chatId The identifier of a chat. Must be a supergroup.
1391
1475
  */
1392
- abstract disableJoinRequests(chatId: ID): Promise<void>;
1476
+ abstract deleteChatStickerSet(chatId: ID): Promise<void>;
1393
1477
  /**
1394
- * Get inactive chats. User-only.
1478
+ * Disable automatic anti-spam in a group. User-only.
1395
1479
  *
1396
1480
  * @method ch
1397
- * @returns A list of inactive chats the current user is a member of.
1481
+ * @param chatId The identifier of the group.
1398
1482
  */
1399
- abstract getInactiveChats(): Promise<InactiveChat[]>;
1483
+ abstract disableAntispam(chatId: ID): Promise<void>;
1400
1484
  /**
1401
- * Get the invite links created for a chat. User-only.
1485
+ * Disable business bots in a private chat. User-only.
1402
1486
  *
1403
1487
  * @method ch
1404
- * @param chatId The identifier of a chat.
1405
- * @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.
1488
+ * @param chatId The identifier of the private chat to disable business bots in.
1406
1489
  */
1407
- abstract getCreatedInviteLinks(chatId: ID, params?: GetCreatedInviteLinksParams): Promise<InviteLink[]>;
1490
+ abstract disableBusinessBots(chatId: ID): Promise<void>;
1408
1491
  /**
1409
- * Join a chat. User-only.
1492
+ * Disable chat history for new members. User-only.
1410
1493
  *
1411
1494
  * @method ch
1412
1495
  * @param chatId The identifier of a chat.
1413
1496
  */
1414
- abstract joinChat(chatId: ID): Promise<void>;
1497
+ abstract disableChatHistoryForNewMembers(chatId: ID): Promise<void>;
1415
1498
  /**
1416
- * Leave a chat.
1499
+ * Disable join requests in a chat. User-only.
1417
1500
  *
1418
1501
  * @method ch
1419
- * @param chatId The identifier of a chat.
1502
+ * @param chatId The identifier of a chat. Must be a channel or a supergroup.
1420
1503
  */
1421
- abstract leaveChat(chatId: ID): Promise<void>;
1504
+ abstract disableJoinRequests(chatId: ID): Promise<void>;
1422
1505
  /**
1423
- * Get information on a user's chat membership.
1506
+ * Disable sharing in a chat. User-only.
1424
1507
  *
1425
1508
  * @method ch
1426
1509
  * @param chatId The identifier of a chat.
1427
- * @param userId The identifier of the user.
1428
1510
  */
1429
- abstract getChatMember(chatId: ID, userId: ID): Promise<ChatMember>;
1511
+ abstract disableSharing(chatId: ID): Promise<void>;
1430
1512
  /**
1431
- * Get the members of a chat.
1513
+ * Disable post signatures in a channel. User-only.
1432
1514
  *
1433
1515
  * @method ch
1434
- * @param chatId The identifier of a chat.
1516
+ * @param chatId The identifier of the channel.
1435
1517
  */
1436
- abstract getChatMembers(chatId: ID, params?: GetChatMembersParams): Promise<ChatMember[]>;
1518
+ abstract disableSignatures(chatId: ID): Promise<void>;
1437
1519
  /**
1438
- * Set a chat's sticker set.
1520
+ * Disable slow mode in a group. User-only.
1439
1521
  *
1440
1522
  * @method ch
1441
- * @param chatId The identifier of a chat. Must be a supergroup.
1442
- * @param setName The name of the set.
1523
+ * @param chatId The identifier of the group to disable slow mode in.
1443
1524
  */
1444
- abstract setChatStickerSet(chatId: ID, setName: string): Promise<void>;
1525
+ abstract disableSlowMode(chatId: ID): Promise<void>;
1445
1526
  /**
1446
- * Delete a chat's sticker set.
1527
+ * Disable topics in a group. User-only.
1447
1528
  *
1448
1529
  * @method ch
1449
- * @param chatId The identifier of a chat. Must be a supergroup.
1530
+ * @param chatId The identifier of the group.
1450
1531
  */
1451
- abstract deleteChatStickerSet(chatId: ID): Promise<void>;
1532
+ abstract disableTopics(chatId: ID): Promise<void>;
1452
1533
  /**
1453
- * Set the number of boosts required to circumvent a chat's default restrictions. User-only.
1534
+ * Edit a forum topic.
1454
1535
  *
1455
1536
  * @method ch
1456
1537
  * @param chatId The identifier of a chat.
1457
- * @param boosts The number of boosts required to circumvent its restrictions.
1538
+ * @param topicId The identifier of the topic.
1539
+ * @param title The new title of the topic.
1540
+ * @returns The new topic.
1458
1541
  */
1459
- abstract setBoostsRequiredToCircumventRestrictions(chatId: ID, boosts: number): Promise<void>;
1542
+ abstract editTopic(chatId: ID, topicId: number, title: string, params?: EditTopicParams): Promise<Topic>;
1460
1543
  /**
1461
- * Create an invite link.
1544
+ * Enable automatic anti-spam in a group. User-only.
1462
1545
  *
1463
1546
  * @method ch
1464
- * @param chatId The identifier of a chat to create the invite link for.
1465
- * @returns The newly created invite link.
1547
+ * @param chatId The identifier of the group.
1466
1548
  */
1467
- abstract createInviteLink(chatId: ID, params?: CreateInviteLinkParams): Promise<InviteLink>;
1549
+ abstract enableAntispam(chatId: ID): Promise<void>;
1468
1550
  /**
1469
- * Approve a join request.
1551
+ * Enable business bots in a private chat. User-only.
1470
1552
  *
1471
1553
  * @method ch
1472
- * @param chatId The identifier of a chat with the join request.
1473
- * @param userId The user who made the join request.
1554
+ * @param chatId The identifier of the private chat to enable business bots in.
1474
1555
  */
1475
- abstract approveJoinRequest(chatId: ID, userId: ID): Promise<void>;
1556
+ abstract enableBusinessBots(chatId: ID): Promise<void>;
1476
1557
  /**
1477
- * Decline a join request.
1558
+ * Enable chat history for new members. User-only.
1478
1559
  *
1479
1560
  * @method ch
1480
- * @param chatId The identifier of a chat with the join request.
1481
- * @param userId The user who made the join request.
1561
+ * @param chatId The identifier of a chat.
1482
1562
  */
1483
- abstract declineJoinRequest(chatId: ID, userId: ID): Promise<void>;
1563
+ abstract enableChatHistoryForNewMembers(chatId: ID): Promise<void>;
1484
1564
  /**
1485
- * Approve all join requests. User-only.
1565
+ * Enable join requests in a chat. User-only.
1486
1566
  *
1487
1567
  * @method ch
1488
- * @param chatId The identifier of a chat with the join requests.
1568
+ * @param chatId The identifier of a chat. Must be a channel or a supergroup.
1489
1569
  */
1490
- abstract approveJoinRequests(chatId: ID, params?: ApproveJoinRequestsParams): Promise<void>;
1570
+ abstract enableJoinRequests(chatId: ID): Promise<void>;
1491
1571
  /**
1492
- * Decline all join requests. User-only.
1572
+ * Enable sharing in a chat. User-only.
1493
1573
  *
1494
1574
  * @method ch
1495
- * @param chatId The identifier of a chat with the join requests.
1575
+ * @param chatId The identifier of a chat.
1496
1576
  */
1497
- abstract declineJoinRequests(chatId: ID, params?: DeclineJoinRequestsParams): Promise<void>;
1577
+ abstract enableSharing(chatId: ID): Promise<void>;
1498
1578
  /**
1499
- * Get pending join requests in a chat. User-only.
1579
+ * Enable post signatures in a channel. User-only.
1500
1580
  *
1501
1581
  * @method ch
1502
- * @param chatId The identifier of a chat with the join requests.
1582
+ * @param chatId The identifier of the channel.
1503
1583
  */
1504
- abstract getJoinRequests(chatId: ID, params?: GetJoinRequestsParams): Promise<JoinRequest[]>;
1584
+ abstract enableSignatures(chatId: ID, params?: EnableSignaturesParams): Promise<void>;
1505
1585
  /**
1506
- * Add a single user to a chat.
1586
+ * Enable topics in a group. User-only.
1507
1587
  *
1508
1588
  * @method ch
1509
- * @param chatId The identifier of a chat to add the user to.
1510
- * @param userId The identifier of the user to add to the chat.
1511
- * @returns An array of FailedInvitation that has at most a length of 1. If empty, it means that the user was added.
1589
+ * @param chatId The identifier of the group.
1590
+ * @param isShownAsTabs Whether topics should be displayed as tabs.
1512
1591
  */
1513
- abstract addChatMember(chatId: ID, userId: ID, params?: AddChatMemberParams): Promise<FailedInvitation[]>;
1592
+ abstract enableTopics(chatId: ID, isShownAsTabs: boolean): Promise<void>;
1514
1593
  /**
1515
- * Add multiple users at once to a channel or a supergroup.
1594
+ * Get a chat.
1516
1595
  *
1517
1596
  * @method ch
1518
- * @param chatId The identifier of the channel or supergroup to add the users to.
1519
- * @param userIds The identifiers of the users to add to the channel or supergroup.
1520
- * @returns An array of FailedInvitation that has at most a length that is the same as that of the parameter userIds. If empty, it means that all the provided users were added.
1597
+ * @cache
1521
1598
  */
1522
- abstract addChatMembers(chatId: ID, userIds: ID[]): Promise<FailedInvitation[]>;
1599
+ abstract getChat(chatId: ID): Promise<Chat>;
1523
1600
  /**
1524
- * Open a chat.
1601
+ * Get the administrators of a chat.
1525
1602
  *
1526
1603
  * @method ch
1527
- * @param chatId The identifier of a chat to open.
1604
+ * @param chatId The identifier of a chat.
1605
+ * @returns The chat's administrators.
1528
1606
  */
1529
- abstract openChat(chatId: ID, params?: OpenChatParams): Promise<void>;
1607
+ abstract getChatAdministrators(chatId: ID): Promise<ChatMember[]>;
1530
1608
  /**
1531
- * Close a chat previously opened by openChat.
1609
+ * Get information on a user's chat membership.
1532
1610
  *
1533
1611
  * @method ch
1534
- * @param chatId The identifier of a chat to close.
1612
+ * @param chatId The identifier of a chat.
1613
+ * @param userId The identifier of the user.
1535
1614
  */
1536
- abstract closeChat(chatId: ID): Promise<void>;
1615
+ abstract getChatMember(chatId: ID, userId: ID): Promise<ChatMember>;
1537
1616
  /**
1538
- * Create a group. User-only.
1617
+ * Get the members of a chat.
1539
1618
  *
1540
1619
  * @method ch
1541
- * @param title The title of the group.
1542
- * @returns The created group.
1620
+ * @param chatId The identifier of a chat.
1543
1621
  */
1544
- abstract createGroup(title: string, params?: CreateGroupParams): Promise<ChatPGroup>;
1622
+ abstract getChatMembers(chatId: ID, params?: GetChatMembersParams): Promise<ChatMember[]>;
1545
1623
  /**
1546
- * Create a supergroup. User-only.
1624
+ * Get a partial chat.
1547
1625
  *
1548
1626
  * @method ch
1549
- * @param title The title of the supergroup.
1550
- * @returns The created supergroup.
1627
+ * @cache
1551
1628
  */
1552
- abstract createSupergroup(title: string, params?: CreateSupergroupParams): Promise<ChatPSupergroup>;
1629
+ abstract getChatP(chatId: ID): Promise<ChatP>;
1553
1630
  /**
1554
- * Create a channel. User-only.
1631
+ * Get chats from a chat list. User-only.
1555
1632
  *
1556
1633
  * @method ch
1557
- * @param title The title of the channel.
1558
- * @returns The created channel.
1559
1634
  */
1560
- abstract createChannel(title: string, params?: CreateChannelParams): Promise<ChatPChannel>;
1635
+ abstract getChats(params?: GetChatsParams): Promise<ChatListItem[]>;
1561
1636
  /**
1562
- * Set the time to live of the messages of a chat. User-only.
1637
+ * Get the settings of a chat. User-only.
1563
1638
  *
1564
1639
  * @method ch
1565
1640
  * @param chatId The identifier of a chat.
1566
- * @param messageTtl The time to live of the messages in seconds.
1567
1641
  */
1568
- abstract setMessageTtl(chatId: ID, messageTtl: number): Promise<void>;
1642
+ abstract getChatSettings(chatId: ID): Promise<ChatSettings>;
1569
1643
  /**
1570
- * Archive multiple chats. User-only.
1644
+ * Get common chats between a user and the current one. User-only.
1571
1645
  *
1572
1646
  * @method ch
1573
- * @param chatIds The identifiers of the chats to archive.
1647
+ * @param userId The identifier of the user to get the common chats with them.
1574
1648
  */
1575
- abstract archiveChats(chatIds: ID[]): Promise<void>;
1649
+ abstract getCommonChats(userId: ID, params?: GetCommonChatsParams): Promise<ChatP[]>;
1576
1650
  /**
1577
- * Archive a single chat. User-only.
1651
+ * Get the invite links created for a chat. User-only.
1578
1652
  *
1579
1653
  * @method ch
1580
1654
  * @param chatId The identifier of a chat.
1655
+ * @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.
1581
1656
  */
1582
- abstract archiveChat(chatId: ID): Promise<void>;
1657
+ abstract getCreatedInviteLinks(chatId: ID, params?: GetCreatedInviteLinksParams): Promise<InviteLink[]>;
1583
1658
  /**
1584
- * Unarchive multiple chats. User-only.
1659
+ * Get discussion chat suggestions. User-only.
1585
1660
  *
1586
1661
  * @method ch
1587
- * @param chatIds The identifiers of the chats to unarchive.
1588
1662
  */
1589
- abstract unarchiveChats(chatIds: ID[]): Promise<void>;
1663
+ abstract getDiscussionChatSuggestions(): Promise<ChatP[]>;
1590
1664
  /**
1591
- * Unarchive a single chat. User-only.
1665
+ * Get chat history. User-only.
1592
1666
  *
1593
1667
  * @method ch
1594
1668
  * @param chatId The identifier of a chat.
1595
1669
  */
1596
- abstract unarchiveChat(chatId: ID): Promise<void>;
1670
+ abstract getHistory(chatId: ID, params?: GetHistoryParams): Promise<Message[]>;
1597
1671
  /**
1598
- * Get common chats between a user and the current one. User-only.
1672
+ * Get inactive chats. User-only.
1599
1673
  *
1600
1674
  * @method ch
1601
- * @param userId The identifier of the user to get the common chats with them.
1675
+ * @returns A list of inactive chats the current user is a member of.
1602
1676
  */
1603
- abstract getCommonChats(userId: ID, params?: GetCommonChatsParams): Promise<ChatP[]>;
1677
+ abstract getInactiveChats(): Promise<InactiveChat[]>;
1604
1678
  /**
1605
- * Get the settings of a chat. User-only.
1679
+ * Get pending join requests in a chat. User-only.
1606
1680
  *
1607
1681
  * @method ch
1608
- * @param chatId The identifier of a chat.
1682
+ * @param chatId The identifier of a chat with the join requests.
1609
1683
  */
1610
- abstract getChatSettings(chatId: ID): Promise<ChatSettings>;
1684
+ abstract getJoinRequests(chatId: ID, params?: GetJoinRequestsParams): Promise<JoinRequest[]>;
1611
1685
  /**
1612
- * Disable business bots in a private chat. User-only.
1686
+ * Get the count of online members in a chat. User-only.
1613
1687
  *
1614
1688
  * @method ch
1615
- * @param chatId The identifier of the private chat to disable business bots in.
1689
+ * @param chatId The identifier of a chat.
1690
+ * @returns The count of online members in the chat.
1616
1691
  */
1617
- abstract disableBusinessBots(chatId: ID): Promise<void>;
1692
+ abstract getOnlineCount(chatId: ID): Promise<number>;
1618
1693
  /**
1619
- * Enable business bots in a private chat. User-only.
1694
+ * Get pinned chats from a chat list. User-only.
1620
1695
  *
1621
1696
  * @method ch
1622
- * @param chatId The identifier of the private chat to enable business bots in.
1697
+ * @param from The chat list to get the pinned chats from. Defaults to main.
1623
1698
  */
1624
- abstract enableBusinessBots(chatId: ID): Promise<void>;
1699
+ abstract getPinnedChats(from?: "archived" | "main"): Promise<ChatListItem[]>;
1625
1700
  /**
1626
- * Disable slow mode in a group. User-only.
1701
+ * Get recommended channels. User-only.
1627
1702
  *
1628
1703
  * @method ch
1629
- * @param chatId The identifier of the group to disable slow mode in.
1704
+ * @returns A list of recommended channels.
1630
1705
  */
1631
- abstract disableSlowMode(chatId: ID): Promise<void>;
1706
+ abstract getRecommendedChannels(): Promise<ChatPChannel[]>;
1632
1707
  /**
1633
- * Change slow mode in a group. User-only.
1708
+ * Get similar bots. User-only.
1634
1709
  *
1635
1710
  * @method ch
1636
- * @param chatId The identifier of the group to change slow mode in.
1637
- * @param duration New slow mode duration.
1711
+ * @param chatId The identifier of a bot to get similar bots for.
1712
+ * @returns A list of similar bots.
1638
1713
  */
1639
- abstract setSlowMode(chatId: ID, duration: SlowModeDuration): Promise<void>;
1714
+ abstract getSimilarBots(chatId: ID): Promise<ChatPPrivate[]>;
1640
1715
  /**
1641
- * Change the title of a chat.
1716
+ * Get similar channels. User-only.
1642
1717
  *
1643
1718
  * @method ch
1644
- * @param chatId The identifier of a chat.
1645
- * @param title The new title.
1719
+ * @param chatId The identifier of a channel to get similar channels for.
1720
+ * @returns A list of similar channels.
1646
1721
  */
1647
- abstract setChatTitle(chatId: ID, title: string): Promise<void>;
1722
+ abstract getSimilarChannels(chatId: ID): Promise<ChatPChannel[]>;
1648
1723
  /**
1649
- * Change the description of a chat.
1724
+ * Get a topic of a forum chat by its identifier. User-only.
1650
1725
  *
1651
1726
  * @method ch
1652
- * @param chatId The identifier of a chat.
1653
- * @param description The new description.
1727
+ * @param chatId The identifier of the chat.
1728
+ * @param topicId The identifier of the topic.
1654
1729
  */
1655
- abstract setChatDescription(chatId: ID, description: string): Promise<void>;
1730
+ abstract getTopic(chatId: ID, topicId: number): Promise<TopicListItem | null>;
1656
1731
  /**
1657
- * Hide the member list of a group to non-admins. User-only.
1732
+ * Get the topics of a forum chat. User-only.
1658
1733
  *
1659
1734
  * @method ch
1660
- * @param chatId The identifier of the group.
1735
+ * @param chatId The identifier of the chat.
1661
1736
  */
1662
- abstract hideMemberList(chatId: ID): Promise<void>;
1737
+ abstract getTopics(chatId: ID, params?: GetTopicsParams): Promise<TopicList>;
1663
1738
  /**
1664
- * Show the member list of a group to non-admins. User-only.
1739
+ * Get topics of a forum chat by their identifiers. User-only.
1665
1740
  *
1666
1741
  * @method ch
1667
- * @param chatId The identifier of the group.
1742
+ * @param chatId The identifier of the chat.
1743
+ * @param topicIds The identifiers of the topics.
1668
1744
  */
1669
- abstract showMemberList(chatId: ID): Promise<void>;
1745
+ abstract getTopicsById(chatId: ID, topicIds: number[]): Promise<TopicList>;
1670
1746
  /**
1671
- * Enable topics in a group. User-only.
1747
+ * Hide the general forum topic.
1672
1748
  *
1673
1749
  * @method ch
1674
- * @param chatId The identifier of the group.
1675
- * @param isShownAsTabs Whether topics should be displayed as tabs.
1750
+ * @param chatId The identifier of a chat.
1676
1751
  */
1677
- abstract enableTopics(chatId: ID, isShownAsTabs: boolean): Promise<void>;
1752
+ abstract hideGeneralTopic(chatId: ID): Promise<void>;
1678
1753
  /**
1679
- * Disable topics in a group. User-only.
1754
+ * Hide the member list of a group to non-admins. User-only.
1680
1755
  *
1681
1756
  * @method ch
1682
1757
  * @param chatId The identifier of the group.
1683
1758
  */
1684
- abstract disableTopics(chatId: ID): Promise<void>;
1759
+ abstract hideMemberList(chatId: ID): Promise<void>;
1685
1760
  /**
1686
- * Enable automatic anti-spam in a group. User-only.
1761
+ * Join a chat. User-only.
1687
1762
  *
1688
1763
  * @method ch
1689
- * @param chatId The identifier of the group.
1764
+ * @param chatId The identifier of a chat.
1690
1765
  */
1691
- abstract enableAntispam(chatId: ID): Promise<void>;
1766
+ abstract joinChat(chatId: ID): Promise<void>;
1692
1767
  /**
1693
- * Disable automatic anti-spam in a group. User-only.
1768
+ * Kick a member from a chat. Same as a banChatMember call followed by unbanChatMember.
1694
1769
  *
1695
1770
  * @method ch
1696
- * @param chatId The identifier of the group.
1771
+ * @param chatId The identifier of a chat. Must be a supergroup.
1772
+ * @param memberId The identifier of the member.
1697
1773
  */
1698
- abstract disableAntispam(chatId: ID): Promise<void>;
1774
+ abstract kickChatMember(chatId: ID, memberId: ID): Promise<void>;
1699
1775
  /**
1700
- * Enable post signatures in a channel. User-only.
1776
+ * Leave a chat.
1701
1777
  *
1702
1778
  * @method ch
1703
- * @param chatId The identifier of the channel.
1779
+ * @param chatId The identifier of a chat.
1704
1780
  */
1705
- abstract enableSignatures(chatId: ID, params?: EnableSignaturesParams): Promise<void>;
1781
+ abstract leaveChat(chatId: ID): Promise<void>;
1706
1782
  /**
1707
- * Disable post signatures in a channel. User-only.
1783
+ * Mark all mentions in a chat as read. User-only.
1708
1784
  *
1709
1785
  * @method ch
1710
- * @param chatId The identifier of the channel.
1786
+ * @param chatId The identifier of the chat.
1711
1787
  */
1712
- abstract disableSignatures(chatId: ID): Promise<void>;
1788
+ abstract markAllMentionsAsRead(chatId: ID, params?: MarkAllMentionsAsReadParams): Promise<void>;
1713
1789
  /**
1714
- * Delete a chat. User-only.
1790
+ * Mark a chat as read. User-only.
1715
1791
  *
1716
1792
  * @method ch
1717
1793
  * @param chatId The identifier of a chat.
1718
1794
  */
1719
- abstract deleteChat(chatId: ID): Promise<void>;
1795
+ abstract markChatAsRead(chatId: ID): Promise<void>;
1720
1796
  /**
1721
- * Get discussion chat suggestions. User-only.
1797
+ * Mark a chat as unread. User-only.
1722
1798
  *
1723
1799
  * @method ch
1800
+ * @param chatId The identifier of a chat.
1724
1801
  */
1725
- abstract getDiscussionChatSuggestions(): Promise<ChatP[]>;
1802
+ abstract markChatAsUnread(chatId: ID): Promise<void>;
1726
1803
  /**
1727
- * Set a channel's discussion chat. User-only.
1804
+ * Open a chat.
1728
1805
  *
1729
1806
  * @method ch
1730
- * @param chatId The identifier of a channel.
1731
- * @param discussionChatId The identifier of a chat to use as discussion for the channel.
1807
+ * @param chatId The identifier of a chat to open.
1732
1808
  */
1733
- abstract setDiscussionChat(chatId: ID, discussionChatId: ID): Promise<void>;
1809
+ abstract openChat(chatId: ID, params?: OpenChatParams): Promise<void>;
1734
1810
  /**
1735
- * Transfer the ownership of a chat. User-only.
1811
+ * Pin a forum topic.
1736
1812
  *
1737
1813
  * @method ch
1738
1814
  * @param chatId The identifier of a chat.
1739
- * @param userId The identifier of the new owner.
1740
- * @param password The password of the current account.
1815
+ * @param topicId The identifier of the topic.
1741
1816
  */
1742
- abstract transferChatOwnership(chatId: ID, userId: ID, password: string): Promise<void>;
1817
+ abstract pinTopic(chatId: ID, topicId: number): Promise<void>;
1743
1818
  /**
1744
- * Create a forum topic.
1819
+ * Promote a chat member.
1745
1820
  *
1746
1821
  * @method ch
1747
1822
  * @param chatId The identifier of a chat.
1748
- * @param title The title of the topic.
1749
- * @returns The created topic.
1823
+ * @param userId The identifier of the user to promote.
1750
1824
  */
1751
- abstract createTopic(chatId: ID, title: string, params?: CreateTopicParams): Promise<Topic>;
1825
+ abstract promoteChatMember(chatId: ID, userId: ID, params?: PromoteChatMemberParams): Promise<void>;
1752
1826
  /**
1753
- * Edit a forum topic.
1827
+ * Reopen a forum topic.
1754
1828
  *
1755
1829
  * @method ch
1756
1830
  * @param chatId The identifier of a chat.
1757
1831
  * @param topicId The identifier of the topic.
1758
- * @param title The new title of the topic.
1759
- * @returns The new topic.
1760
1832
  */
1761
- abstract editTopic(chatId: ID, topicId: number, title: string, params?: EditTopicParams): Promise<Topic>;
1833
+ abstract reopenTopic(chatId: ID, topicId: number): Promise<void>;
1762
1834
  /**
1763
- * Hide the general forum topic.
1835
+ * Report a chat. User-only.
1764
1836
  *
1765
1837
  * @method ch
1766
- * @param chatId The identifier of a chat.
1838
+ * @param chatId The identifier of a chat to report.
1839
+ * @param reason The reason of the report.
1767
1840
  */
1768
- abstract hideGeneralTopic(chatId: ID): Promise<void>;
1841
+ abstract reportChat(chatId: ID, reason: ReportReason, params?: ReportChatParams): Promise<void>;
1769
1842
  /**
1770
- * Show the general forum topic.
1843
+ * Set a chat's available reactions. User-only.
1771
1844
  *
1772
1845
  * @method ch
1773
1846
  * @param chatId The identifier of a chat.
1847
+ * @param availableReactions The new available reactions.
1774
1848
  */
1775
- abstract showGeneralTopic(chatId: ID): Promise<void>;
1849
+ abstract setAvailableReactions(chatId: ID, availableReactions: AvailableReactions): Promise<void>;
1776
1850
  /**
1777
- * Close a forum topic.
1851
+ * Set the number of boosts required to circumvent a chat's default restrictions. User-only.
1778
1852
  *
1779
1853
  * @method ch
1780
1854
  * @param chatId The identifier of a chat.
1781
- * @param topicId The identifier of the topic.
1855
+ * @param boosts The number of boosts required to circumvent its restrictions.
1782
1856
  */
1783
- abstract closeTopic(chatId: ID, topicId: number): Promise<void>;
1857
+ abstract setBoostsRequiredToCircumventRestrictions(chatId: ID, boosts: number): Promise<void>;
1784
1858
  /**
1785
- * Reopen a forum topic.
1859
+ * Change the description of a chat.
1786
1860
  *
1787
1861
  * @method ch
1788
1862
  * @param chatId The identifier of a chat.
1789
- * @param topicId The identifier of the topic.
1863
+ * @param description The new description.
1790
1864
  */
1791
- abstract reopenTopic(chatId: ID, topicId: number): Promise<void>;
1865
+ abstract setChatDescription(chatId: ID, description: string): Promise<void>;
1792
1866
  /**
1793
- * Pin a forum topic.
1867
+ * Set the rights of a chat member.
1794
1868
  *
1795
1869
  * @method ch
1796
- * @param chatId The identifier of a chat.
1797
- * @param topicId The identifier of the topic.
1870
+ * @param chatId The identifier of a chat. Must be a supergroup.
1871
+ * @param memberId The identifier of the member.
1798
1872
  */
1799
- abstract pinTopic(chatId: ID, topicId: number): Promise<void>;
1873
+ abstract setChatMemberRights(chatId: ID, memberId: ID, params?: SetChatMemberRightsParams): Promise<void>;
1800
1874
  /**
1801
- * Unpin a forum topic.
1875
+ * Change the tag of a chat member.
1802
1876
  *
1803
1877
  * @method ch
1804
1878
  * @param chatId The identifier of a chat.
1805
- * @param topicId The identifier of the topic.
1879
+ * @param userId The identifier of the user that is a member of the chat.
1806
1880
  */
1807
- abstract unpinTopic(chatId: ID, topicId: number): Promise<void>;
1881
+ abstract setChatMemberTag(chatId: ID, userId: ID, params?: SetChatMemberTagParams): Promise<void>;
1808
1882
  /**
1809
- * Promote a chat member.
1883
+ * Set a chat's photo.
1810
1884
  *
1811
1885
  * @method ch
1812
1886
  * @param chatId The identifier of a chat.
1813
- * @param userId The identifier of the user to promote.
1887
+ * @param photo A photo to set as the chat's photo.
1814
1888
  */
1815
- abstract promoteChatMember(chatId: ID, userId: ID, params?: PromoteChatMemberParams): Promise<void>;
1889
+ abstract setChatPhoto(chatId: ID, photo: FileSource, params?: SetChatPhotoParams): Promise<void>;
1816
1890
  /**
1817
- * Change the tag of a chat member.
1891
+ * Set a chat's sticker set.
1818
1892
  *
1819
1893
  * @method ch
1820
- * @param chatId The identifier of a chat.
1821
- * @param userId The identifier of the user that is a member of the chat.
1894
+ * @param chatId The identifier of a chat. Must be a supergroup.
1895
+ * @param setName The name of the set.
1822
1896
  */
1823
- abstract setChatMemberTag(chatId: ID, userId: ID, params?: SetChatMemberTagParams): Promise<void>;
1897
+ abstract setChatStickerSet(chatId: ID, setName: string): Promise<void>;
1824
1898
  /**
1825
- * Enable sharing in a chat. User-only.
1899
+ * Change the title of a chat.
1826
1900
  *
1827
1901
  * @method ch
1828
1902
  * @param chatId The identifier of a chat.
1903
+ * @param title The new title.
1829
1904
  */
1830
- abstract enableSharing(chatId: ID): Promise<void>;
1905
+ abstract setChatTitle(chatId: ID, title: string): Promise<void>;
1831
1906
  /**
1832
- * Disable sharing in a chat. User-only.
1907
+ * Set the default send as chat of a chat. User-only.
1833
1908
  *
1834
1909
  * @method ch
1835
1910
  * @param chatId The identifier of a chat.
1911
+ * @param sendAs The new default send as chat.
1836
1912
  */
1837
- abstract disableSharing(chatId: ID): Promise<void>;
1913
+ abstract setDefaultSendAs(chatId: ID, sendAs: ID): Promise<void>;
1838
1914
  /**
1839
- * Get recommended channels. User-only.
1915
+ * Set a channel's discussion chat. User-only.
1840
1916
  *
1841
1917
  * @method ch
1842
- * @returns A list of recommended channels.
1918
+ * @param chatId The identifier of a channel.
1919
+ * @param discussionChatId The identifier of a chat to use as discussion for the channel.
1843
1920
  */
1844
- abstract getRecommendedChannels(): Promise<ChatPChannel[]>;
1921
+ abstract setDiscussionChat(chatId: ID, discussionChatId: ID): Promise<void>;
1845
1922
  /**
1846
- * Get similar channels. User-only.
1923
+ * Set the time to live of the messages of a chat. User-only.
1847
1924
  *
1848
1925
  * @method ch
1849
- * @param chatId The identifier of a channel to get similar channels for.
1850
- * @returns A list of similar channels.
1926
+ * @param chatId The identifier of a chat.
1927
+ * @param messageTtl The time to live of the messages in seconds.
1851
1928
  */
1852
- abstract getSimilarChannels(chatId: ID): Promise<ChatPChannel[]>;
1929
+ abstract setMessageTtl(chatId: ID, messageTtl: number): Promise<void>;
1853
1930
  /**
1854
- * Get similar bots. User-only.
1931
+ * Change slow mode in a group. User-only.
1855
1932
  *
1856
1933
  * @method ch
1857
- * @param chatId The identifier of a bot to get similar bots for.
1858
- * @returns A list of similar bots.
1934
+ * @param chatId The identifier of the group to change slow mode in.
1935
+ * @param duration New slow mode duration.
1859
1936
  */
1860
- abstract getSimilarBots(chatId: ID): Promise<ChatPPrivate[]>;
1937
+ abstract setSlowMode(chatId: ID, duration: SlowModeDuration): Promise<void>;
1861
1938
  /**
1862
- * Get the count of online members in a chat. User-only.
1939
+ * Show the general forum topic.
1863
1940
  *
1864
1941
  * @method ch
1865
1942
  * @param chatId The identifier of a chat.
1866
- * @returns The count of online members in the chat.
1867
1943
  */
1868
- abstract getOnlineCount(chatId: ID): Promise<number>;
1944
+ abstract showGeneralTopic(chatId: ID): Promise<void>;
1869
1945
  /**
1870
- * Enable chat history for new members. User-only.
1946
+ * Show the member list of a group to non-admins. User-only.
1871
1947
  *
1872
1948
  * @method ch
1873
- * @param chatId The identifier of a chat.
1949
+ * @param chatId The identifier of the group.
1874
1950
  */
1875
- abstract enableChatHistoryForNewMembers(chatId: ID): Promise<void>;
1951
+ abstract showMemberList(chatId: ID): Promise<void>;
1876
1952
  /**
1877
- * Disable chat history for new members. User-only.
1953
+ * Transfer the ownership of a chat. User-only.
1878
1954
  *
1879
1955
  * @method ch
1880
1956
  * @param chatId The identifier of a chat.
1957
+ * @param userId The identifier of the new owner.
1958
+ * @param password The password of the current account.
1881
1959
  */
1882
- abstract disableChatHistoryForNewMembers(chatId: ID): Promise<void>;
1960
+ abstract transferChatOwnership(chatId: ID, userId: ID, password: string): Promise<void>;
1883
1961
  /**
1884
- * Set the default send as chat of a chat. User-only.
1962
+ * Unarchive a single chat. User-only.
1885
1963
  *
1886
1964
  * @method ch
1887
1965
  * @param chatId The identifier of a chat.
1888
- * @param sendAs The new default send as chat.
1889
1966
  */
1890
- abstract setDefaultSendAs(chatId: ID, sendAs: ID): Promise<void>;
1967
+ abstract unarchiveChat(chatId: ID): Promise<void>;
1891
1968
  /**
1892
- * Report a chat. User-only.
1969
+ * Unarchive multiple chats. User-only.
1893
1970
  *
1894
1971
  * @method ch
1895
- * @param chatId The identifier of a chat to report.
1896
- * @param reason The reason of the report.
1972
+ * @param chatIds The identifiers of the chats to unarchive.
1897
1973
  */
1898
- abstract reportChat(chatId: ID, reason: ReportReason, params?: ReportChatParams): Promise<void>;
1974
+ abstract unarchiveChats(chatIds: ID[]): Promise<void>;
1899
1975
  /**
1900
- * Mark a chat as unread. User-only.
1976
+ * Unban a member from a chat.
1901
1977
  *
1902
1978
  * @method ch
1903
- * @param chatId The identifier of a chat.
1979
+ * @param chatId The identifier of a chat. Must be a supergroup.
1980
+ * @param memberId The identifier of the member.
1904
1981
  */
1905
- abstract markChatAsUnread(chatId: ID): Promise<void>;
1982
+ abstract unbanChatMember(chatId: ID, memberId: ID): Promise<void>;
1906
1983
  /**
1907
- * Mark a chat as read. User-only.
1984
+ * Unpin a forum topic.
1908
1985
  *
1909
1986
  * @method ch
1910
1987
  * @param chatId The identifier of a chat.
1988
+ * @param topicId The identifier of the topic.
1911
1989
  */
1912
- abstract markChatAsRead(chatId: ID): Promise<void>;
1990
+ abstract unpinTopic(chatId: ID, topicId: number): Promise<void>;
1913
1991
  /**
1914
- * Mark all mentions in a chat as read. User-only.
1992
+ * Answer a callback query. Bot-only.
1915
1993
  *
1916
- * @method ch
1917
- * @param chatId The identifier of the chat.
1994
+ * @method cq
1995
+ * @param id ID of the callback query to answer.
1918
1996
  */
1919
- abstract markAllMentionsAsRead(chatId: ID, params?: MarkAllMentionsAsReadParams): Promise<void>;
1997
+ abstract answerCallbackQuery(id: string, params?: AnswerCallbackQueryParams): Promise<void>;
1920
1998
  /**
1921
1999
  * Send a callback query. User-only.
1922
2000
  *
@@ -1929,12 +2007,13 @@ export declare abstract class ClientGeneric {
1929
2007
  */
1930
2008
  abstract sendCallbackQuery(botId: ID, messageId: number, question: CallbackQueryQuestion): Promise<CallbackQueryAnswer>;
1931
2009
  /**
1932
- * Answer a callback query. Bot-only.
2010
+ * Answer an inline query. Bot-only.
1933
2011
  *
1934
- * @method cq
1935
- * @param id ID of the callback query to answer.
2012
+ * @method iq
2013
+ * @param id The identifier of the inline query to answer.
2014
+ * @param results The results to answer with.
1936
2015
  */
1937
- abstract answerCallbackQuery(id: string, params?: AnswerCallbackQueryParams): Promise<void>;
2016
+ abstract answerInlineQuery(id: string, results: InlineQueryResult[], params?: AnswerInlineQueryParams): Promise<void>;
1938
2017
  /**
1939
2018
  * Send an inline query. User-only.
1940
2019
  *
@@ -1946,40 +2025,12 @@ export declare abstract class ClientGeneric {
1946
2025
  */
1947
2026
  abstract sendInlineQuery(botId: ID, chatId: ID, params?: SendInlineQueryParams): Promise<InlineQueryAnswer>;
1948
2027
  /**
1949
- * Answer an inline query. Bot-only.
1950
- *
1951
- * @method iq
1952
- * @param id The identifier of the inline query to answer.
1953
- * @param results The results to answer with.
1954
- */
1955
- abstract answerInlineQuery(id: string, results: InlineQueryResult[], params?: AnswerInlineQueryParams): Promise<void>;
1956
- /**
1957
- * Set the bot's description in the given language. Bot-only.
1958
- *
1959
- * @method bo
1960
- */
1961
- abstract setMyDescription(params?: {
1962
- description?: string;
1963
- languageCode?: string;
1964
- }): Promise<void>;
1965
- /**
1966
- * Set the bot's name in the given language. Bot-only.
1967
- *
1968
- * @method bo
1969
- */
1970
- abstract setMyName(params?: {
1971
- name?: string;
1972
- languageCode?: string;
1973
- }): Promise<void>;
1974
- /**
1975
- * Set the bot's short description in the given language. Bot-only.
2028
+ * Get the bot's commands in the given scope and/or language. Bot-only.
1976
2029
  *
1977
2030
  * @method bo
1978
- */
1979
- abstract setMyShortDescription(params?: {
1980
- shortDescription?: string;
1981
- languageCode?: string;
1982
- }): Promise<void>;
2031
+ * @returns The current bot's commands in the specified language.
2032
+ */
2033
+ abstract getMyCommands(params?: GetMyCommandsParams): Promise<BotCommand[]>;
1983
2034
  /**
1984
2035
  * Get the bot's description in the given language. Bot-only.
1985
2036
  *
@@ -2015,21 +2066,32 @@ export declare abstract class ClientGeneric {
2015
2066
  */
2016
2067
  abstract setMyCommands(commands: BotCommand[], params?: SetMyCommandsParams): Promise<void>;
2017
2068
  /**
2018
- * Get the bot's commands in the given scope and/or language. Bot-only.
2069
+ * Set the bot's description in the given language. Bot-only.
2019
2070
  *
2020
2071
  * @method bo
2021
- * @returns The current bot's commands in the specified language.
2022
2072
  */
2023
- abstract getMyCommands(params?: GetMyCommandsParams): Promise<BotCommand[]>;
2073
+ abstract setMyDescription(params?: {
2074
+ description?: string;
2075
+ languageCode?: string;
2076
+ }): Promise<void>;
2024
2077
  /**
2025
- * Change reactions made to a message.
2078
+ * Set the bot's name in the given language. Bot-only.
2026
2079
  *
2027
- * @method re
2028
- * @param chatId The identifier of the chat which the message belongs to.
2029
- * @param messageId The identifier of the message to add the reaction to.
2030
- * @param reactions The new reactions.
2080
+ * @method bo
2031
2081
  */
2032
- abstract setReactions(chatId: ID, messageId: number, reactions: Reaction[], params?: SetReactionsParams): Promise<void>;
2082
+ abstract setMyName(params?: {
2083
+ name?: string;
2084
+ languageCode?: string;
2085
+ }): Promise<void>;
2086
+ /**
2087
+ * Set the bot's short description in the given language. Bot-only.
2088
+ *
2089
+ * @method bo
2090
+ */
2091
+ abstract setMyShortDescription(params?: {
2092
+ shortDescription?: string;
2093
+ languageCode?: string;
2094
+ }): Promise<void>;
2033
2095
  /**
2034
2096
  * Make a reaction to a message.
2035
2097
  *
@@ -2039,6 +2101,12 @@ export declare abstract class ClientGeneric {
2039
2101
  * @param reaction The reaction to add.
2040
2102
  */
2041
2103
  abstract addReaction(chatId: ID, messageId: number, reaction: Reaction, params?: AddReactionParams): Promise<void>;
2104
+ /**
2105
+ * Clear recent reactions. User-only.
2106
+ *
2107
+ * @method re
2108
+ */
2109
+ abstract clearRecentReactions(): Promise<void>;
2042
2110
  /**
2043
2111
  * Undo a reaction made to a message.
2044
2112
  *
@@ -2066,37 +2134,38 @@ export declare abstract class ClientGeneric {
2066
2134
  */
2067
2135
  abstract removeUserReactions(chatId: ID, userId: ID): Promise<void>;
2068
2136
  /**
2069
- * Clear recent reactions. User-only.
2137
+ * Change reactions made to a message.
2070
2138
  *
2071
2139
  * @method re
2140
+ * @param chatId The identifier of the chat which the message belongs to.
2141
+ * @param messageId The identifier of the message to add the reaction to.
2142
+ * @param reactions The new reactions.
2072
2143
  */
2073
- abstract clearRecentReactions(): Promise<void>;
2144
+ abstract setReactions(chatId: ID, messageId: number, reactions: Reaction[], params?: SetReactionsParams): Promise<void>;
2074
2145
  /**
2075
- * Create a story. User-only.
2146
+ * Add multiple stories to highlights. User-only.
2076
2147
  *
2077
2148
  * @method st
2078
- * @param content The content of the story.
2079
- * @returns The created story.
2149
+ * @param chatId The identifier of a chat.
2150
+ * @param storyIds The identifiers of the stories to add to highlights.
2080
2151
  */
2081
- abstract createStory(chatId: ID, content: InputStoryContent, params?: CreateStoryParams): Promise<Story>;
2152
+ abstract addStoriesToHighlights(chatId: ID, storyIds: number[]): Promise<void>;
2082
2153
  /**
2083
- * Retrieve multiple stories. User-only.
2154
+ * Add a single story to highlights. User-only.
2084
2155
  *
2085
2156
  * @method st
2086
2157
  * @param chatId The identifier of a chat.
2087
- * @param storyIds The identifiers of the stories to retrieve.
2088
- * @returns The retrieved stories.
2158
+ * @param storyId The identifier of the story to add to highlights.
2089
2159
  */
2090
- abstract getStories(chatId: ID, storyIds: number[]): Promise<Story[]>;
2160
+ abstract addStoryToHighlights(chatId: ID, storyId: number): Promise<void>;
2091
2161
  /**
2092
- * Retrieve a single story. User-only.
2162
+ * Create a story. User-only.
2093
2163
  *
2094
2164
  * @method st
2095
- * @param chatId The identifier of a chat.
2096
- * @param storyId The identifier of the story to retrieve.
2097
- * @returns The retrieved story.
2165
+ * @param content The content of the story.
2166
+ * @returns The created story.
2098
2167
  */
2099
- abstract getStory(chatId: ID, storyId: number): Promise<Story | null>;
2168
+ abstract createStory(chatId: ID, content: InputStoryContent, params?: CreateStoryParams): Promise<Story>;
2100
2169
  /**
2101
2170
  * Delete multiple stories. User-only.
2102
2171
  *
@@ -2114,21 +2183,23 @@ export declare abstract class ClientGeneric {
2114
2183
  */
2115
2184
  abstract deleteStory(chatId: ID, storyId: number): Promise<void>;
2116
2185
  /**
2117
- * Add multiple stories to highlights. User-only.
2186
+ * Retrieve multiple stories. User-only.
2118
2187
  *
2119
2188
  * @method st
2120
2189
  * @param chatId The identifier of a chat.
2121
- * @param storyIds The identifiers of the stories to add to highlights.
2190
+ * @param storyIds The identifiers of the stories to retrieve.
2191
+ * @returns The retrieved stories.
2122
2192
  */
2123
- abstract addStoriesToHighlights(chatId: ID, storyIds: number[]): Promise<void>;
2193
+ abstract getStories(chatId: ID, storyIds: number[]): Promise<Story[]>;
2124
2194
  /**
2125
- * Add a single story to highlights. User-only.
2195
+ * Retrieve a single story. User-only.
2126
2196
  *
2127
2197
  * @method st
2128
2198
  * @param chatId The identifier of a chat.
2129
- * @param storyId The identifier of the story to add to highlights.
2199
+ * @param storyId The identifier of the story to retrieve.
2200
+ * @returns The retrieved story.
2130
2201
  */
2131
- abstract addStoryToHighlights(chatId: ID, storyId: number): Promise<void>;
2202
+ abstract getStory(chatId: ID, storyId: number): Promise<Story | null>;
2132
2203
  /**
2133
2204
  * Remove multiple stories from highlights. User-only.
2134
2205
  *
@@ -2145,14 +2216,6 @@ export declare abstract class ClientGeneric {
2145
2216
  * @param storyId The identifier of the story to remove from highlights.
2146
2217
  */
2147
2218
  abstract removeStoryFromHighlights(chatId: ID, storyId: number): Promise<void>;
2148
- /**
2149
- * Report a single story. User-only.
2150
- *
2151
- * @method st
2152
- * @param chatId The identifier of a chat that posted the story.
2153
- * @param storyId The identifier of the story to report.
2154
- */
2155
- abstract reportStory(chatId: ID, storyId: number, params?: ReportStoryParams): Promise<StoryReportResult>;
2156
2219
  /**
2157
2220
  * Report multiple stories. User-only.
2158
2221
  *
@@ -2162,23 +2225,13 @@ export declare abstract class ClientGeneric {
2162
2225
  */
2163
2226
  abstract reportStories(chatId: ID, storyIds: number[], params?: ReportStoryParams): Promise<StoryReportResult>;
2164
2227
  /**
2165
- * Create a story album. User-only.
2166
- *
2167
- * @method sa
2168
- * @param chatId The identifier of the chat to create the album in.
2169
- * @param name The name of the album.
2170
- * @param storyIds The initial stories inside the album.
2171
- */
2172
- abstract createStoryAlbum(chatId: ID, name: string, storyIds: number[]): Promise<StoryAlbum>;
2173
- /**
2174
- * Set the name of a story album. User-only.
2228
+ * Report a single story. User-only.
2175
2229
  *
2176
- * @method sa
2177
- * @param chatId The identifier of the chat including the album.
2178
- * @param albumId The identifier of the album to rename.
2179
- * @param name The new name of the album.
2230
+ * @method st
2231
+ * @param chatId The identifier of a chat that posted the story.
2232
+ * @param storyId The identifier of the story to report.
2180
2233
  */
2181
- abstract setStoryAlbumName(chatId: ID, albumId: number, name: string): Promise<StoryAlbum>;
2234
+ abstract reportStory(chatId: ID, storyId: number, params?: ReportStoryParams): Promise<StoryReportResult>;
2182
2235
  /**
2183
2236
  * Add multiple stories to an album. User-only.
2184
2237
  *
@@ -2197,6 +2250,30 @@ export declare abstract class ClientGeneric {
2197
2250
  * @param storyId The identifier of the story to add.
2198
2251
  */
2199
2252
  abstract addStoryToAlbum(chatId: ID, albumId: number, storyId: number): Promise<StoryAlbum>;
2253
+ /**
2254
+ * Create a story album. User-only.
2255
+ *
2256
+ * @method sa
2257
+ * @param chatId The identifier of the chat to create the album in.
2258
+ * @param name The name of the album.
2259
+ * @param storyIds The initial stories inside the album.
2260
+ */
2261
+ abstract createStoryAlbum(chatId: ID, name: string, storyIds: number[]): Promise<StoryAlbum>;
2262
+ /**
2263
+ * Get stories inside an album. User-only.
2264
+ *
2265
+ * @method sa
2266
+ * @param chatId The identifier of the chat including albums.
2267
+ * @param albumId The identifier of an album.
2268
+ */
2269
+ abstract getStoriesInAlbum(chatId: ID, albumId: number): Promise<AlbumStoryList>;
2270
+ /**
2271
+ * Get story albums in a chat. User-only.
2272
+ *
2273
+ * @method sa
2274
+ * @param chatId The identifier of a chat including albums.
2275
+ */
2276
+ abstract getStoryAlbums(chatId: ID): Promise<StoryAlbum[]>;
2200
2277
  /**
2201
2278
  * Remove multiple stories from an album. User-only.
2202
2279
  *
@@ -2225,20 +2302,14 @@ export declare abstract class ClientGeneric {
2225
2302
  */
2226
2303
  abstract reorderStoriesInAlbum(chatId: ID, albumId: number, storyIds: number[]): Promise<StoryAlbum>;
2227
2304
  /**
2228
- * Get story albums in a chat. User-only.
2229
- *
2230
- * @method sa
2231
- * @param chatId The identifier of a chat including albums.
2232
- */
2233
- abstract getStoryAlbums(chatId: ID): Promise<StoryAlbum[]>;
2234
- /**
2235
- * Get stories inside an album. User-only.
2305
+ * Set the name of a story album. User-only.
2236
2306
  *
2237
2307
  * @method sa
2238
- * @param chatId The identifier of the chat including albums.
2239
- * @param albumId The identifier of an album.
2308
+ * @param chatId The identifier of the chat including the album.
2309
+ * @param albumId The identifier of the album to rename.
2310
+ * @param name The new name of the album.
2240
2311
  */
2241
- abstract getStoriesInAlbum(chatId: ID, albumId: number): Promise<AlbumStoryList>;
2312
+ abstract setStoryAlbumName(chatId: ID, albumId: number, name: string): Promise<StoryAlbum>;
2242
2313
  /**
2243
2314
  * Get network statistics. This might not always be available.
2244
2315
  *
@@ -2246,70 +2317,70 @@ export declare abstract class ClientGeneric {
2246
2317
  */
2247
2318
  abstract getNetworkStatistics(): Promise<NetworkStatistics>;
2248
2319
  /**
2249
- * Start a video chat. User-only.
2320
+ * Download a live stream segment. User-only.
2250
2321
  *
2251
2322
  * @method vc
2252
- * @param chatId The identifier of a chat to start the video chat in.
2253
- * @returns The started video chat.
2323
+ * @param id The identifier of a video chat retrieved from getChat, startVideoChat, or scheduleVideoChat.
2324
+ * @param channelId Stream channel ID.
2325
+ * @param scale Stream channel scale.
2326
+ * @param timestamp Millisecond timestamp of the chunk to download.
2254
2327
  */
2255
- abstract startVideoChat(chatId: ID, params?: StartVideoChatParams): Promise<VideoChatActive>;
2328
+ abstract downloadLiveStreamSegment(id: string, channelId: number, scale: number, timestamp: number, params?: DownloadLiveStreamSegmentParams): Promise<Uint8Array>;
2256
2329
  /**
2257
- * Schedule a video chat. User-only.
2330
+ * Get live stream channels. User-only.
2258
2331
  *
2259
2332
  * @method vc
2260
- * @param chatId The identifier of a chat to schedule the video chat in.
2261
- * @param startAt A point in time in the future when the video chat will be started.
2262
- * @returns The scheduled video chat.
2333
+ * @param id The identifier of a video chat retrieved from getChat, startVideoChat, or scheduleVideoChat.
2263
2334
  */
2264
- abstract scheduleVideoChat(chatId: ID, startAt: number, params?: ScheduleVideoChatParams): Promise<VideoChatScheduled>;
2335
+ abstract getLiveStreamChannels(id: string): Promise<LiveStreamChannel[]>;
2265
2336
  /**
2266
- * Join a video chat. User-only.
2337
+ * Get a video chat. User-only.
2267
2338
  *
2268
2339
  * @method vc
2269
2340
  * @param id The identifier of a video chat retrieved from getChat, startVideoChat, or scheduleVideoChat.
2270
- * @param params_ WebRTC connection parameters.
2271
- * @returns Parameters to be passed to the used WebRTC library.
2341
+ * @cache
2272
2342
  */
2273
- abstract joinVideoChat(id: string, params_: string, params?: JoinVideoChatParams): Promise<string>;
2343
+ abstract getVideoChat(id: string): Promise<VideoChat>;
2274
2344
  /**
2275
- * Leave a video chat. User-only.
2345
+ * Join a live stream. User-only.
2276
2346
  *
2277
2347
  * @method vc
2278
2348
  * @param id The identifier of a video chat retrieved from getChat, startVideoChat, or scheduleVideoChat.
2279
2349
  */
2280
- abstract leaveVideoChat(id: string): Promise<void>;
2350
+ abstract joinLiveStream(id: string): Promise<void>;
2281
2351
  /**
2282
- * Join a live stream. User-only.
2352
+ * Join a video chat. User-only.
2283
2353
  *
2284
2354
  * @method vc
2285
2355
  * @param id The identifier of a video chat retrieved from getChat, startVideoChat, or scheduleVideoChat.
2356
+ * @param params_ WebRTC connection parameters.
2357
+ * @returns Parameters to be passed to the used WebRTC library.
2286
2358
  */
2287
- abstract joinLiveStream(id: string): Promise<void>;
2359
+ abstract joinVideoChat(id: string, params_: string, params?: JoinVideoChatParams): Promise<string>;
2288
2360
  /**
2289
- * Get a video chat. User-only.
2361
+ * Leave a video chat. User-only.
2290
2362
  *
2291
2363
  * @method vc
2292
2364
  * @param id The identifier of a video chat retrieved from getChat, startVideoChat, or scheduleVideoChat.
2293
- * @cache
2294
2365
  */
2295
- abstract getVideoChat(id: string): Promise<VideoChat>;
2366
+ abstract leaveVideoChat(id: string): Promise<void>;
2296
2367
  /**
2297
- * Get live stream channels. User-only.
2368
+ * Schedule a video chat. User-only.
2298
2369
  *
2299
2370
  * @method vc
2300
- * @param id The identifier of a video chat retrieved from getChat, startVideoChat, or scheduleVideoChat.
2371
+ * @param chatId The identifier of a chat to schedule the video chat in.
2372
+ * @param startAt A point in time in the future when the video chat will be started.
2373
+ * @returns The scheduled video chat.
2301
2374
  */
2302
- abstract getLiveStreamChannels(id: string): Promise<LiveStreamChannel[]>;
2375
+ abstract scheduleVideoChat(chatId: ID, startAt: number, params?: ScheduleVideoChatParams): Promise<VideoChatScheduled>;
2303
2376
  /**
2304
- * Download a live stream segment. User-only.
2377
+ * Start a video chat. User-only.
2305
2378
  *
2306
2379
  * @method vc
2307
- * @param id The identifier of a video chat retrieved from getChat, startVideoChat, or scheduleVideoChat.
2308
- * @param channelId Stream channel ID.
2309
- * @param scale Stream channel scale.
2310
- * @param timestamp Millisecond timestamp of the chunk to download.
2380
+ * @param chatId The identifier of a chat to start the video chat in.
2381
+ * @returns The started video chat.
2311
2382
  */
2312
- abstract downloadLiveStreamSegment(id: string, channelId: number, scale: number, timestamp: number, params?: DownloadLiveStreamSegmentParams): Promise<Uint8Array>;
2383
+ abstract startVideoChat(chatId: ID, params?: StartVideoChatParams): Promise<VideoChatActive>;
2313
2384
  /**
2314
2385
  * Answer a pre-checkout query. Bot-only.
2315
2386
  *
@@ -2319,20 +2390,19 @@ export declare abstract class ClientGeneric {
2319
2390
  */
2320
2391
  abstract answerPreCheckoutQuery(preCheckoutQueryId: string, ok: boolean, params?: AnswerPreCheckoutQueryParams): Promise<void>;
2321
2392
  /**
2322
- * Refund a star payment. Bot-only.
2393
+ * Get the star balance of a chat.
2323
2394
  *
2324
2395
  * @method pa
2325
- * @param userId The identifier of the user that was charged.
2326
- * @param telegramPaymentChargeId The identifier of the charge.
2396
+ * @param chatId The identifier of the chat to get the star balance for.
2327
2397
  */
2328
- abstract refundStarPayment(userId: ID, telegramPaymentChargeId: string): Promise<void>;
2398
+ abstract getStarBalance(chatId: ID): Promise<StarAmount>;
2329
2399
  /**
2330
- * Get the star balance of a chat.
2400
+ * Get star transactions.
2331
2401
  *
2332
2402
  * @method pa
2333
- * @param chatId The identifier of the chat to get the star balance for.
2403
+ * @param chatId The identifier of the chat to get star transactions for.
2334
2404
  */
2335
- abstract getStarBalance(chatId: ID): Promise<StarAmount>;
2405
+ abstract getStarTransactions(chatId: ID, params?: GetStarTransactionsParams): Promise<StarTransactionList>;
2336
2406
  /**
2337
2407
  * Get the TON balance of a chat.
2338
2408
  *
@@ -2341,40 +2411,41 @@ export declare abstract class ClientGeneric {
2341
2411
  */
2342
2412
  abstract getTonBalance(chatId: ID): Promise<number>;
2343
2413
  /**
2344
- * Get star transactions.
2414
+ * Refund a star payment. Bot-only.
2345
2415
  *
2346
2416
  * @method pa
2347
- * @param chatId The identifier of the chat to get star transactions for.
2417
+ * @param userId The identifier of the user that was charged.
2418
+ * @param telegramPaymentChargeId The identifier of the charge.
2348
2419
  */
2349
- abstract getStarTransactions(chatId: ID, params?: GetStarTransactionsParams): Promise<StarTransactionList>;
2420
+ abstract refundStarPayment(userId: ID, telegramPaymentChargeId: string): Promise<void>;
2350
2421
  /**
2351
- * Get contacts. User-only.
2422
+ * Add a contact. User-only.
2352
2423
  *
2353
2424
  * @method co
2425
+ * @param userId The identifier of the user to add as contact.
2426
+ * @param firstName The contact's first name.
2354
2427
  */
2355
- abstract getContacts(): Promise<User[]>;
2428
+ abstract addContact(userId: ID, firstName: string, params?: AddContactParams): Promise<void>;
2356
2429
  /**
2357
- * Delete multiple contacts. User-only.
2430
+ * Delete a single contact. User-only.
2358
2431
  *
2359
2432
  * @method co
2360
- * @param userIds The identifiers of contacts to delete.
2433
+ * @param userId The identifier of the contact to delete.
2361
2434
  */
2362
- abstract deleteContacts(userIds: ID[]): Promise<void>;
2435
+ abstract deleteContact(userId: ID): Promise<void>;
2363
2436
  /**
2364
- * Delete a single contact. User-only.
2437
+ * Delete multiple contacts. User-only.
2365
2438
  *
2366
2439
  * @method co
2367
- * @param userId The identifier of the contact to delete.
2440
+ * @param userIds The identifiers of contacts to delete.
2368
2441
  */
2369
- abstract deleteContact(userId: ID): Promise<void>;
2442
+ abstract deleteContacts(userIds: ID[]): Promise<void>;
2370
2443
  /**
2371
- * Add a contact. User-only.
2444
+ * Get contacts. User-only.
2372
2445
  *
2373
2446
  * @method co
2374
- * @param userId The identifier of the user to add as contact.
2375
- * @param firstName The contact's first name.
2376
2447
  */
2377
- abstract addContact(userId: ID, firstName: string, params?: AddContactParams): Promise<void>;
2448
+ abstract getContacts(): Promise<User[]>;
2378
2449
  /**
2379
2450
  * Set a contact note.
2380
2451
  *
@@ -2390,11 +2461,12 @@ export declare abstract class ClientGeneric {
2390
2461
  */
2391
2462
  abstract getTranslations(params?: GetTranslationsParams): Promise<Translation[]>;
2392
2463
  /**
2393
- * Get available gifts.
2464
+ * Craft gifts.
2394
2465
  *
2395
2466
  * @method gf
2467
+ * @param gifts The gifts to craft.
2396
2468
  */
2397
- abstract getGifts(): Promise<Gift[]>;
2469
+ abstract craftGifts(gifts: InputGift[]): Promise<void>;
2398
2470
  /**
2399
2471
  * Get gifts claimed by a user or a channel. User-only.
2400
2472
  *
@@ -2403,57 +2475,58 @@ export declare abstract class ClientGeneric {
2403
2475
  */
2404
2476
  abstract getClaimedGifts(chatId: ID, params?: GetClaimedGiftsParams): Promise<ClaimedGifts>;
2405
2477
  /**
2406
- * Send a gift.
2478
+ * Get a gift using its slug.
2407
2479
  *
2408
2480
  * @method gf
2409
- * @param chatId The identifier of a user or a channel to send the gift to.
2410
- * @param giftId The identifier of the gift to send.
2481
+ * @param slug The slug of a gift.
2411
2482
  */
2412
- abstract sendGift(chatId: ID, giftId: string, params?: SendGiftParams): Promise<void>;
2483
+ abstract getGift(slug: string): Promise<Gift>;
2413
2484
  /**
2414
- * Sell a gift.
2485
+ * Get available gifts.
2415
2486
  *
2416
2487
  * @method gf
2417
- * @param gift The gift to sell.
2418
2488
  */
2419
- abstract sellGift(gift: InputGift): Promise<void>;
2489
+ abstract getGifts(): Promise<Gift[]>;
2420
2490
  /**
2421
- * Craft gifts.
2491
+ * Gift a Telegram Premium subscription. Bot-only.
2422
2492
  *
2423
2493
  * @method gf
2424
- * @param gifts The gifts to craft.
2494
+ * @param userId The identifier of a user to gift the Telegram Premium subscription to.
2495
+ * @param duration The duration of the subscription.
2425
2496
  */
2426
- abstract craftGifts(gifts: InputGift[]): Promise<void>;
2497
+ abstract giftPremiumSubscription(userId: ID, duration: PremiumSubscriptionDuration, params?: GiftPremiumSubscriptionParams): Promise<void>;
2427
2498
  /**
2428
- * Get a gift using its slug.
2499
+ * Sell a gift.
2429
2500
  *
2430
2501
  * @method gf
2431
- * @param slug The slug of a gift.
2502
+ * @param gift The gift to sell.
2432
2503
  */
2433
- abstract getGift(slug: string): Promise<Gift>;
2504
+ abstract sellGift(gift: InputGift): Promise<void>;
2434
2505
  /**
2435
- * Transfer a gift. User-only.
2506
+ * Send a gift.
2436
2507
  *
2437
2508
  * @method gf
2438
- * @param chatId The identifier of a chat to transfer the gift to.
2439
- * @param gift The gift to transfer.
2509
+ * @param chatId The identifier of a user or a channel to send the gift to.
2510
+ * @param giftId The identifier of the gift to send.
2440
2511
  */
2441
- abstract transferGift(chatId: ID, gift: InputGift): Promise<void>;
2512
+ abstract sendGift(chatId: ID, giftId: string, params?: SendGiftParams): Promise<void>;
2442
2513
  /**
2443
- * Gift a Telegram Premium subscription. Bot-only.
2514
+ * Transfer a gift. User-only.
2444
2515
  *
2445
2516
  * @method gf
2446
- * @param userId The identifier of a user to gift the Telegram Premium subscription to.
2447
- * @param duration The duration of the subscription.
2517
+ * @param chatId The identifier of a chat to transfer the gift to.
2518
+ * @param gift The gift to transfer.
2448
2519
  */
2449
- abstract giftPremiumSubscription(userId: ID, duration: PremiumSubscriptionDuration, params?: GiftPremiumSubscriptionParams): Promise<void>;
2520
+ abstract transferGift(chatId: ID, gift: InputGift): Promise<void>;
2450
2521
  /**
2451
- * Get gift collections of a chat. User-only.
2522
+ * Add gifts to a gift collection. User-only.
2452
2523
  *
2453
2524
  * @method gc
2454
- * @param chatId The identifier of a chat to get gift collections for.
2525
+ * @param chatId The identifier of the chat that includes the gift collection.
2526
+ * @param collectionId The identifier of a gift collection.
2527
+ * @param gifts The gifts to add to the collection.
2455
2528
  */
2456
- abstract getGiftCollections(chatId: ID): Promise<GiftCollection[]>;
2529
+ abstract addGiftsToCollection(chatId: ID, collectionId: number, gifts: InputGift[]): Promise<GiftCollection>;
2457
2530
  /**
2458
2531
  * Create a gift collection. User-only.
2459
2532
  *
@@ -2464,23 +2537,20 @@ export declare abstract class ClientGeneric {
2464
2537
  */
2465
2538
  abstract createGiftCollection(chatId: ID, name: string, gifts: InputGift[]): Promise<GiftCollection>;
2466
2539
  /**
2467
- * Set the name of a gift collection. User-only.
2540
+ * Delete a gift collection. User-only.
2468
2541
  *
2469
2542
  * @method gc
2470
2543
  * @param chatId The identifier of the chat that includes the gift collection.
2471
2544
  * @param collectionId The identifier of a gift collection.
2472
- * @param name The gift collection's new name.
2473
2545
  */
2474
- abstract setGiftCollectionName(chatId: ID, collectionId: number, name: string): Promise<GiftCollection>;
2546
+ abstract deleteGiftCollection(chatId: ID, collectionId: number): Promise<void>;
2475
2547
  /**
2476
- * Add gifts to a gift collection. User-only.
2548
+ * Get gift collections of a chat. User-only.
2477
2549
  *
2478
2550
  * @method gc
2479
- * @param chatId The identifier of the chat that includes the gift collection.
2480
- * @param collectionId The identifier of a gift collection.
2481
- * @param gifts The gifts to add to the collection.
2551
+ * @param chatId The identifier of a chat to get gift collections for.
2482
2552
  */
2483
- abstract addGiftsToCollection(chatId: ID, collectionId: number, gifts: InputGift[]): Promise<GiftCollection>;
2553
+ abstract getGiftCollections(chatId: ID): Promise<GiftCollection[]>;
2484
2554
  /**
2485
2555
  * Remove gifts from a gift collection. User-only.
2486
2556
  *
@@ -2500,20 +2570,14 @@ export declare abstract class ClientGeneric {
2500
2570
  */
2501
2571
  abstract reorderGiftsInCollection(chatId: ID, collectionId: number, gifts: InputGift[]): Promise<GiftCollection>;
2502
2572
  /**
2503
- * Delete a gift collection. User-only.
2573
+ * Set the name of a gift collection. User-only.
2504
2574
  *
2505
2575
  * @method gc
2506
2576
  * @param chatId The identifier of the chat that includes the gift collection.
2507
2577
  * @param collectionId The identifier of a gift collection.
2578
+ * @param name The gift collection's new name.
2508
2579
  */
2509
- abstract deleteGiftCollection(chatId: ID, collectionId: number): Promise<void>;
2510
- /**
2511
- * Start a takeout session. User-only.
2512
- *
2513
- * @method to
2514
- * @returns The identifier of the takeout session.
2515
- */
2516
- abstract startTakeoutSession(params?: StartTakeoutSessionParams): Promise<string>;
2580
+ abstract setGiftCollectionName(chatId: ID, collectionId: number, name: string): Promise<GiftCollection>;
2517
2581
  /**
2518
2582
  * End a takeout session. User-only.
2519
2583
  *
@@ -2529,19 +2593,28 @@ export declare abstract class ClientGeneric {
2529
2593
  */
2530
2594
  abstract getLeftChannels(takeoutId: string, params?: GetLeftChannelsParams): Promise<LeftChannelList>;
2531
2595
  /**
2532
- * Get a sticker set.
2596
+ * Start a takeout session. User-only.
2597
+ *
2598
+ * @method to
2599
+ * @returns The identifier of the takeout session.
2600
+ */
2601
+ abstract startTakeoutSession(params?: StartTakeoutSessionParams): Promise<string>;
2602
+ /**
2603
+ * Add a sticker to a sticker set.
2533
2604
  *
2534
2605
  * @method ss
2535
2606
  * @param slug The slug of the sticker set or its link.
2607
+ * @param sticker The sticker to add.
2536
2608
  */
2537
- abstract getStickerSet(slug: string): Promise<StickerSet>;
2609
+ abstract addStickerToStickerSet(slug: string, sticker: InputSticker, params?: AddStickerToStickerSetParams): Promise<void>;
2538
2610
  /**
2539
- * Get a dice sticker set.
2611
+ * Change the position of a sticker in its set.
2540
2612
  *
2541
2613
  * @method ss
2542
- * @param emoji The emoji of the dice.
2614
+ * @param fileId The identifier of the sticker.
2615
+ * @param position The new position of the sticker.
2543
2616
  */
2544
- abstract getDiceStickerSet(emoji: string): Promise<StickerSet>;
2617
+ abstract changeStickerPositionInStickerSet(fileId: string, position: number): Promise<void>;
2545
2618
  /**
2546
2619
  * Check the availability of a sticker set slug.
2547
2620
  *
@@ -2550,14 +2623,6 @@ export declare abstract class ClientGeneric {
2550
2623
  * @returns Whether the slug is available.
2551
2624
  */
2552
2625
  abstract checkStickerSetSlug(slug: string): Promise<boolean>;
2553
- /**
2554
- * Suggest a sticker set slug from its title.
2555
- *
2556
- * @method ss
2557
- * @param title A title of a sticker set.
2558
- * @returns The suggested slug.
2559
- */
2560
- abstract suggestStickerSetSlug(title: string): Promise<string>;
2561
2626
  /**
2562
2627
  * Create a sticker set.
2563
2628
  *
@@ -2568,13 +2633,26 @@ export declare abstract class ClientGeneric {
2568
2633
  */
2569
2634
  abstract createStickerSet(name: string, slug: string, stickers: InputSticker[], params?: CreateStickerSetParams): Promise<StickerSet>;
2570
2635
  /**
2571
- * Add a sticker to a sticker set.
2636
+ * Delete a sticker set.
2572
2637
  *
2573
2638
  * @method ss
2574
2639
  * @param slug The slug of the sticker set or its link.
2575
- * @param sticker The sticker to add.
2576
2640
  */
2577
- abstract addStickerToStickerSet(slug: string, sticker: InputSticker, params?: AddStickerToStickerSetParams): Promise<void>;
2641
+ abstract deleteStickerSet(slug: string): Promise<void>;
2642
+ /**
2643
+ * Get a dice sticker set.
2644
+ *
2645
+ * @method ss
2646
+ * @param emoji The emoji of the dice.
2647
+ */
2648
+ abstract getDiceStickerSet(emoji: string): Promise<StickerSet>;
2649
+ /**
2650
+ * Get a sticker set.
2651
+ *
2652
+ * @method ss
2653
+ * @param slug The slug of the sticker set or its link.
2654
+ */
2655
+ abstract getStickerSet(slug: string): Promise<StickerSet>;
2578
2656
  /**
2579
2657
  * Remove a sticker from its set.
2580
2658
  *
@@ -2599,44 +2677,44 @@ export declare abstract class ClientGeneric {
2599
2677
  */
2600
2678
  abstract replaceStickerInStickerSet(currentStickerFileId: string, newSticker: InputSticker, params?: ReplaceStickerInStickerSetParams): Promise<void>;
2601
2679
  /**
2602
- * Delete a sticker set.
2680
+ * Set a custom emoji as a sticker set's thumbnail.
2603
2681
  *
2604
2682
  * @method ss
2605
2683
  * @param slug The slug of the sticker set or its link.
2684
+ * @param customEmojiId The identifier of the custom emoji to use as thumbnail.
2606
2685
  */
2607
- abstract deleteStickerSet(slug: string): Promise<void>;
2686
+ abstract setCustomEmojiAsStickerSetThumbnail(slug: string, customEmojiId: string): Promise<void>;
2608
2687
  /**
2609
- * Set the title of a sticker set.
2688
+ * Set a sticker set's thumbnail.
2610
2689
  *
2611
2690
  * @method ss
2612
2691
  * @param slug The slug of the sticker set or its link.
2613
- * @param title The sticker set's new title.
2692
+ * @param thumbnail The new thumbnail of the sticker set.
2614
2693
  */
2615
- abstract setStickerSetTitle(slug: string, title: string): Promise<void>;
2694
+ abstract setStickerSetThumbnail(slug: string, thumbnail: FileSource): Promise<void>;
2616
2695
  /**
2617
- * Change the position of a sticker in its set.
2696
+ * Set the title of a sticker set.
2618
2697
  *
2619
2698
  * @method ss
2620
- * @param fileId The identifier of the sticker.
2621
- * @param position The new position of the sticker.
2699
+ * @param slug The slug of the sticker set or its link.
2700
+ * @param title The sticker set's new title.
2622
2701
  */
2623
- abstract changeStickerPositionInStickerSet(fileId: string, position: number): Promise<void>;
2702
+ abstract setStickerSetTitle(slug: string, title: string): Promise<void>;
2624
2703
  /**
2625
- * Set a sticker set's thumbnail.
2704
+ * Suggest a sticker set slug from its title.
2626
2705
  *
2627
2706
  * @method ss
2628
- * @param slug The slug of the sticker set or its link.
2629
- * @param thumbnail The new thumbnail of the sticker set.
2707
+ * @param title A title of a sticker set.
2708
+ * @returns The suggested slug.
2630
2709
  */
2631
- abstract setStickerSetThumbnail(slug: string, thumbnail: FileSource): Promise<void>;
2710
+ abstract suggestStickerSetSlug(title: string): Promise<string>;
2632
2711
  /**
2633
- * Set a custom emoji as a sticker set's thumbnail.
2712
+ * Set the access settings of a managed bot. Bot-only.
2634
2713
  *
2635
- * @method ss
2636
- * @param slug The slug of the sticker set or its link.
2637
- * @param customEmojiId The identifier of the custom emoji to use as thumbnail.
2714
+ * @method mb
2715
+ * @param userId The identifier of the bot user.
2638
2716
  */
2639
- abstract setCustomEmojiAsStickerSetThumbnail(slug: string, customEmojiId: string): Promise<void>;
2717
+ abstract getManagedBotAccessSettings(userId: ID): Promise<BotAccessSettings>;
2640
2718
  /**
2641
2719
  * Get the token of a managed bot. Bot-only.
2642
2720
  *
@@ -2661,13 +2739,6 @@ export declare abstract class ClientGeneric {
2661
2739
  * @param isAccessRestricted Whether access is restricted to specific users.
2662
2740
  */
2663
2741
  abstract setManagedBotAccessSettings(userId: ID, isAccessRestricted: boolean, params?: SetManagedBotAccessSettingsParams): Promise<void>;
2664
- /**
2665
- * Set the access settings of a managed bot. Bot-only.
2666
- *
2667
- * @method mb
2668
- * @param userId The identifier of the bot user.
2669
- */
2670
- abstract getManagedBotAccessSettings(userId: ID): Promise<BotAccessSettings>;
2671
2742
  /**
2672
2743
  * Answer a guest query. Bot-only.
2673
2744
  *
@@ -2676,13 +2747,6 @@ export declare abstract class ClientGeneric {
2676
2747
  * @returns The identifier of the sent message.
2677
2748
  */
2678
2749
  abstract answerGuestQuery(id: string, result: InlineQueryResult): Promise<string>;
2679
- /**
2680
- * Request a secret chat. User-only.
2681
- *
2682
- * @method sc
2683
- * @param chatId The identifier of a chat.
2684
- */
2685
- abstract requestSecretChat(chatId: ID): Promise<SecretChat>;
2686
2750
  /**
2687
2751
  * Accept a secret chat. User-only.
2688
2752
  *
@@ -2698,33 +2762,35 @@ export declare abstract class ClientGeneric {
2698
2762
  */
2699
2763
  abstract endSecretChat(id: number, params?: EndSecretChatParams): Promise<SecretChat>;
2700
2764
  /**
2701
- * Send a message to a secret chat. User-only.
2765
+ * Request a secret chat. User-only.
2766
+ *
2767
+ * @method sc
2768
+ * @param chatId The identifier of a chat.
2769
+ */
2770
+ abstract requestSecretChat(chatId: ID): Promise<SecretChat>;
2771
+ /**
2772
+ * Send an animation to a secret chat. User-only.
2702
2773
  *
2703
2774
  * @method sc
2704
2775
  * @param id The identifier of the secret chat.
2705
- * @param text The message's text.
2776
+ * @param animation The animation to send.
2706
2777
  */
2707
- abstract sendSecretMessage(id: number, text: string, params?: SendSecretMessageParams): Promise<void>;
2778
+ abstract sendSecretAnimation(id: number, animation: FileSource, params?: SendSecretAnimationParams): Promise<void>;
2708
2779
  /**
2709
- * Send a location to a secret chat. User-only.
2780
+ * Send an audio file to a secret chat. User-only.
2710
2781
  *
2711
2782
  * @method sc
2712
2783
  * @param id The identifier of the secret chat.
2713
- * @param latitude The location's latitude.
2714
- * @param longitude The location's longitude.
2784
+ * @param audio The audio file to send.
2715
2785
  */
2716
- abstract sendSecretLocation(id: number, latitude: number, longitude: number, params?: SendSecretLocationParams): Promise<void>;
2786
+ abstract sendSecretAudio(id: number, audio: FileSource, params?: SendSecretAudioParams): Promise<void>;
2717
2787
  /**
2718
- * Send a venue to a secret chat. User-only.
2788
+ * Send a cancel typing action to a secret chat. User-only.
2719
2789
  *
2720
2790
  * @method sc
2721
2791
  * @param id The identifier of the secret chat.
2722
- * @param latitude The latitude of the venue.
2723
- * @param longitude The longitude of the venue.
2724
- * @param title The title of the venue.
2725
- * @param address The written address of the venue.
2726
2792
  */
2727
- abstract sendSecretVenue(id: number, latitude: number, longitude: number, title: string, address: string, params?: SendSecretVenueParams): Promise<void>;
2793
+ abstract sendSecretCancelTypingAction(id: number): Promise<void>;
2728
2794
  /**
2729
2795
  * Send a contact to a secret chat. User-only.
2730
2796
  *
@@ -2742,6 +2808,23 @@ export declare abstract class ClientGeneric {
2742
2808
  * @param document The document to send.
2743
2809
  */
2744
2810
  abstract sendSecretDocument(id: number, document: FileSource, params?: SendSecretDocumentParams): Promise<void>;
2811
+ /**
2812
+ * Send a location to a secret chat. User-only.
2813
+ *
2814
+ * @method sc
2815
+ * @param id The identifier of the secret chat.
2816
+ * @param latitude The location's latitude.
2817
+ * @param longitude The location's longitude.
2818
+ */
2819
+ abstract sendSecretLocation(id: number, latitude: number, longitude: number, params?: SendSecretLocationParams): Promise<void>;
2820
+ /**
2821
+ * Send a message to a secret chat. User-only.
2822
+ *
2823
+ * @method sc
2824
+ * @param id The identifier of the secret chat.
2825
+ * @param text The message's text.
2826
+ */
2827
+ abstract sendSecretMessage(id: number, text: string, params?: SendSecretMessageParams): Promise<void>;
2745
2828
  /**
2746
2829
  * Send a photo to a secret chat. User-only.
2747
2830
  *
@@ -2751,52 +2834,62 @@ export declare abstract class ClientGeneric {
2751
2834
  */
2752
2835
  abstract sendSecretPhoto(id: number, photo: FileSource, params?: SendSecretPhotoParams): Promise<void>;
2753
2836
  /**
2754
- * Send a video to a secret chat. User-only.
2837
+ * Send a secret chat screenshot notification. User-only.
2755
2838
  *
2756
2839
  * @method sc
2757
2840
  * @param id The identifier of the secret chat.
2758
- * @param video The video to send.
2841
+ * @param messageIds Identifiers of messages.
2759
2842
  */
2760
- abstract sendSecretVideo(id: number, video: FileSource, params?: SendSecretVideoParams): Promise<void>;
2843
+ abstract sendSecretScreenshotNotification(id: number, messageIds: string[]): Promise<void>;
2761
2844
  /**
2762
- * Send a video note to a secret chat. User-only.
2845
+ * Send a sticker to a secret chat. User-only.
2763
2846
  *
2764
2847
  * @method sc
2765
2848
  * @param id The identifier of the secret chat.
2766
- * @param videoNote The video note to send.
2849
+ * @param sticker The sticker to send.
2767
2850
  */
2768
- abstract sendSecretVideoNote(id: number, videoNote: FileSource, params?: SendSecretVideoNoteParams): Promise<void>;
2851
+ abstract sendSecretSticker(id: number, sticker: FileSource | Sticker, params?: SendSecretStickerParams): Promise<void>;
2769
2852
  /**
2770
- * Send an animation to a secret chat. User-only.
2853
+ * Send a typing action to a secret chat. User-only.
2771
2854
  *
2772
2855
  * @method sc
2773
2856
  * @param id The identifier of the secret chat.
2774
- * @param animation The animation to send.
2775
2857
  */
2776
- abstract sendSecretAnimation(id: number, animation: FileSource, params?: SendSecretAnimationParams): Promise<void>;
2858
+ abstract sendSecretTypingAction(id: number): Promise<void>;
2777
2859
  /**
2778
- * Send an audio file to a secret chat. User-only.
2860
+ * Send a venue to a secret chat. User-only.
2779
2861
  *
2780
2862
  * @method sc
2781
2863
  * @param id The identifier of the secret chat.
2782
- * @param audio The audio file to send.
2864
+ * @param latitude The latitude of the venue.
2865
+ * @param longitude The longitude of the venue.
2866
+ * @param title The title of the venue.
2867
+ * @param address The written address of the venue.
2783
2868
  */
2784
- abstract sendSecretAudio(id: number, audio: FileSource, params?: SendSecretAudioParams): Promise<void>;
2869
+ abstract sendSecretVenue(id: number, latitude: number, longitude: number, title: string, address: string, params?: SendSecretVenueParams): Promise<void>;
2785
2870
  /**
2786
- * Send a voice message to a secret chat. User-only.
2871
+ * Send a video to a secret chat. User-only.
2787
2872
  *
2788
2873
  * @method sc
2789
2874
  * @param id The identifier of the secret chat.
2790
- * @param voice The voice message to send.
2875
+ * @param video The video to send.
2791
2876
  */
2792
- abstract sendSecretVoice(id: number, voice: FileSource, params?: SendSecretVoiceParams): Promise<void>;
2877
+ abstract sendSecretVideo(id: number, video: FileSource, params?: SendSecretVideoParams): Promise<void>;
2793
2878
  /**
2794
- * Send a sticker to a secret chat. User-only.
2879
+ * Send a video note to a secret chat. User-only.
2795
2880
  *
2796
2881
  * @method sc
2797
2882
  * @param id The identifier of the secret chat.
2798
- * @param sticker The sticker to send.
2883
+ * @param videoNote The video note to send.
2799
2884
  */
2800
- abstract sendSecretSticker(id: number, sticker: FileSource | Sticker, params?: SendSecretStickerParams): Promise<void>;
2885
+ abstract sendSecretVideoNote(id: number, videoNote: FileSource, params?: SendSecretVideoNoteParams): Promise<void>;
2886
+ /**
2887
+ * Send a voice message to a secret chat. User-only.
2888
+ *
2889
+ * @method sc
2890
+ * @param id The identifier of the secret chat.
2891
+ * @param voice The voice message to send.
2892
+ */
2893
+ abstract sendSecretVoice(id: number, voice: FileSource, params?: SendSecretVoiceParams): Promise<void>;
2801
2894
  }
2802
2895
  //# sourceMappingURL=1_client_generic.d.ts.map