@tgify/tgify 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) hide show
  1. package/LICENSE +23 -0
  2. package/README.md +356 -0
  3. package/filters.d.ts +1 -0
  4. package/filters.js +1 -0
  5. package/format.d.ts +1 -0
  6. package/format.js +1 -0
  7. package/future.d.ts +1 -0
  8. package/future.js +1 -0
  9. package/lib/button.js +100 -0
  10. package/lib/cli.mjs +105 -0
  11. package/lib/composer.js +582 -0
  12. package/lib/context.js +1219 -0
  13. package/lib/core/helpers/args.js +57 -0
  14. package/lib/core/helpers/check.js +55 -0
  15. package/lib/core/helpers/compact.js +16 -0
  16. package/lib/core/helpers/deunionize.js +12 -0
  17. package/lib/core/helpers/formatting.js +91 -0
  18. package/lib/core/helpers/util.js +50 -0
  19. package/lib/core/network/client.js +330 -0
  20. package/lib/core/network/error.js +21 -0
  21. package/lib/core/network/multipart-stream.js +71 -0
  22. package/lib/core/network/polling.js +87 -0
  23. package/lib/core/network/webhook.js +54 -0
  24. package/lib/core/types/typegram.js +27 -0
  25. package/lib/filters.js +69 -0
  26. package/lib/format.js +38 -0
  27. package/lib/future.js +149 -0
  28. package/lib/index.js +58 -0
  29. package/lib/input.js +61 -0
  30. package/lib/markup.js +121 -0
  31. package/lib/middleware.js +2 -0
  32. package/lib/reactions.js +84 -0
  33. package/lib/router.js +46 -0
  34. package/lib/scenes/base.js +39 -0
  35. package/lib/scenes/context.js +104 -0
  36. package/lib/scenes/index.js +21 -0
  37. package/lib/scenes/stage.js +49 -0
  38. package/lib/scenes/wizard/context.js +31 -0
  39. package/lib/scenes/wizard/index.js +45 -0
  40. package/lib/scenes.js +17 -0
  41. package/lib/session.js +166 -0
  42. package/lib/telegraf.js +256 -0
  43. package/lib/telegram-types.js +6 -0
  44. package/lib/telegram.js +1240 -0
  45. package/lib/types.js +2 -0
  46. package/lib/utils.js +5 -0
  47. package/markup.d.ts +1 -0
  48. package/markup.js +1 -0
  49. package/package.json +140 -0
  50. package/scenes.d.ts +1 -0
  51. package/scenes.js +1 -0
  52. package/session.d.ts +1 -0
  53. package/session.js +1 -0
  54. package/src/button.ts +182 -0
  55. package/src/composer.ts +1008 -0
  56. package/src/context.ts +1661 -0
  57. package/src/core/helpers/args.ts +63 -0
  58. package/src/core/helpers/check.ts +71 -0
  59. package/src/core/helpers/compact.ts +18 -0
  60. package/src/core/helpers/deunionize.ts +26 -0
  61. package/src/core/helpers/formatting.ts +119 -0
  62. package/src/core/helpers/util.ts +96 -0
  63. package/src/core/network/client.ts +396 -0
  64. package/src/core/network/error.ts +29 -0
  65. package/src/core/network/multipart-stream.ts +45 -0
  66. package/src/core/network/polling.ts +94 -0
  67. package/src/core/network/webhook.ts +58 -0
  68. package/src/core/types/typegram.ts +54 -0
  69. package/src/filters.ts +109 -0
  70. package/src/format.ts +110 -0
  71. package/src/future.ts +213 -0
  72. package/src/index.ts +17 -0
  73. package/src/input.ts +59 -0
  74. package/src/markup.ts +142 -0
  75. package/src/middleware.ts +24 -0
  76. package/src/reactions.ts +118 -0
  77. package/src/router.ts +55 -0
  78. package/src/scenes/base.ts +52 -0
  79. package/src/scenes/context.ts +136 -0
  80. package/src/scenes/index.ts +21 -0
  81. package/src/scenes/stage.ts +71 -0
  82. package/src/scenes/wizard/context.ts +58 -0
  83. package/src/scenes/wizard/index.ts +63 -0
  84. package/src/scenes.ts +1 -0
  85. package/src/session.ts +204 -0
  86. package/src/telegraf.ts +354 -0
  87. package/src/telegram-types.ts +219 -0
  88. package/src/telegram.ts +1635 -0
  89. package/src/types.ts +2 -0
  90. package/src/utils.ts +1 -0
  91. package/types.d.ts +1 -0
  92. package/types.js +1 -0
  93. package/typings/button.d.ts +36 -0
  94. package/typings/button.d.ts.map +1 -0
  95. package/typings/composer.d.ts +227 -0
  96. package/typings/composer.d.ts.map +1 -0
  97. package/typings/context.d.ts +655 -0
  98. package/typings/context.d.ts.map +1 -0
  99. package/typings/core/helpers/args.d.ts +11 -0
  100. package/typings/core/helpers/args.d.ts.map +1 -0
  101. package/typings/core/helpers/check.d.ts +56 -0
  102. package/typings/core/helpers/check.d.ts.map +1 -0
  103. package/typings/core/helpers/compact.d.ts +4 -0
  104. package/typings/core/helpers/compact.d.ts.map +1 -0
  105. package/typings/core/helpers/deunionize.d.ts +18 -0
  106. package/typings/core/helpers/deunionize.d.ts.map +1 -0
  107. package/typings/core/helpers/formatting.d.ts +30 -0
  108. package/typings/core/helpers/formatting.d.ts.map +1 -0
  109. package/typings/core/helpers/util.d.ts +26 -0
  110. package/typings/core/helpers/util.d.ts.map +1 -0
  111. package/typings/core/network/client.d.ts +53 -0
  112. package/typings/core/network/client.d.ts.map +1 -0
  113. package/typings/core/network/error.d.ts +16 -0
  114. package/typings/core/network/error.d.ts.map +1 -0
  115. package/typings/core/network/multipart-stream.d.ts +16 -0
  116. package/typings/core/network/multipart-stream.d.ts.map +1 -0
  117. package/typings/core/network/polling.d.ts +16 -0
  118. package/typings/core/network/polling.d.ts.map +1 -0
  119. package/typings/core/network/webhook.d.ts +6 -0
  120. package/typings/core/network/webhook.d.ts.map +1 -0
  121. package/typings/core/types/typegram.d.ts +42 -0
  122. package/typings/core/types/typegram.d.ts.map +1 -0
  123. package/typings/filters.d.ts +18 -0
  124. package/typings/filters.d.ts.map +1 -0
  125. package/typings/format.d.ts +22 -0
  126. package/typings/format.d.ts.map +1 -0
  127. package/typings/future.d.ts +12 -0
  128. package/typings/future.d.ts.map +1 -0
  129. package/typings/index.d.ts +15 -0
  130. package/typings/index.d.ts.map +1 -0
  131. package/typings/input.d.ts +50 -0
  132. package/typings/input.d.ts.map +1 -0
  133. package/typings/markup.d.ts +27 -0
  134. package/typings/markup.d.ts.map +1 -0
  135. package/typings/middleware.d.ts +8 -0
  136. package/typings/middleware.d.ts.map +1 -0
  137. package/typings/reactions.d.ts +32 -0
  138. package/typings/reactions.d.ts.map +1 -0
  139. package/typings/router.d.ts +21 -0
  140. package/typings/router.d.ts.map +1 -0
  141. package/typings/scenes/base.d.ts +22 -0
  142. package/typings/scenes/base.d.ts.map +1 -0
  143. package/typings/scenes/context.d.ts +36 -0
  144. package/typings/scenes/context.d.ts.map +1 -0
  145. package/typings/scenes/index.d.ts +11 -0
  146. package/typings/scenes/index.d.ts.map +1 -0
  147. package/typings/scenes/stage.d.ts +24 -0
  148. package/typings/scenes/stage.d.ts.map +1 -0
  149. package/typings/scenes/wizard/context.d.ts +29 -0
  150. package/typings/scenes/wizard/context.d.ts.map +1 -0
  151. package/typings/scenes/wizard/index.d.ts +16 -0
  152. package/typings/scenes/wizard/index.d.ts.map +1 -0
  153. package/typings/scenes.d.ts +2 -0
  154. package/typings/scenes.d.ts.map +1 -0
  155. package/typings/session.d.ts +55 -0
  156. package/typings/session.d.ts.map +1 -0
  157. package/typings/telegraf.d.ts +115 -0
  158. package/typings/telegraf.d.ts.map +1 -0
  159. package/typings/telegram-types.d.ts +117 -0
  160. package/typings/telegram-types.d.ts.map +1 -0
  161. package/typings/telegram.d.ts +675 -0
  162. package/typings/telegram.d.ts.map +1 -0
  163. package/typings/types.d.ts +3 -0
  164. package/typings/types.d.ts.map +1 -0
  165. package/typings/utils.d.ts +2 -0
  166. package/typings/utils.d.ts.map +1 -0
  167. package/utils.d.ts +1 -0
  168. package/utils.js +1 -0
@@ -0,0 +1,675 @@
1
+ import * as tg from './core/types/typegram';
2
+ import * as tt from './telegram-types';
3
+ import ApiClient from './core/network/client';
4
+ import { URL } from 'url';
5
+ import { FmtString } from './format';
6
+ export declare class Telegram extends ApiClient {
7
+ /**
8
+ * Get basic information about the bot
9
+ */
10
+ getMe(): Promise<tg.UserFromGetMe>;
11
+ /**
12
+ * Get basic info about a file and prepare it for downloading.
13
+ * @param fileId Id of file to get link to
14
+ */
15
+ getFile(fileId: string): Promise<tg.File>;
16
+ /**
17
+ * Get download link to a file.
18
+ */
19
+ getFileLink(fileId: string | tg.File): Promise<URL>;
20
+ /**
21
+ * Directly request incoming updates.
22
+ * You should probably use `Telegraf::launch` instead.
23
+ */
24
+ getUpdates(timeout: number, limit: number, offset: number, allowedUpdates: readonly tt.UpdateType[] | undefined): Promise<tg.Update[]>;
25
+ getWebhookInfo(): Promise<tg.WebhookInfo>;
26
+ getGameHighScores(userId: number, inlineMessageId: string | undefined, chatId: number | undefined, messageId: number | undefined): Promise<tg.GameHighScore[]>;
27
+ setGameScore(userId: number, score: number, inlineMessageId: string | undefined, chatId: number | undefined, messageId: number | undefined, editMessage?: boolean, force?: boolean): Promise<true | (tg.Update.Edited & tg.Message.GameMessage)>;
28
+ /**
29
+ * Specify a url to receive incoming updates via an outgoing webhook.
30
+ * @param url HTTPS url to send updates to. Use an empty string to remove webhook integration
31
+ */
32
+ setWebhook(url: string, extra?: tt.ExtraSetWebhook): Promise<true>;
33
+ /**
34
+ * Remove webhook integration.
35
+ */
36
+ deleteWebhook(extra?: {
37
+ drop_pending_updates?: boolean;
38
+ }): Promise<true>;
39
+ /**
40
+ * Send a text message.
41
+ * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
42
+ * @param text Text of the message to be sent
43
+ */
44
+ sendMessage(chatId: number | string, text: string | FmtString, extra?: tt.ExtraReplyMessage): Promise<tg.Message.TextMessage>;
45
+ /**
46
+ * Forward existing message.
47
+ * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
48
+ * @param fromChatId Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername)
49
+ * @param messageId Message identifier in the chat specified in from_chat_id
50
+ */
51
+ forwardMessage(chatId: number | string, fromChatId: number | string, messageId: number, extra?: tt.ExtraForwardMessage): Promise<tg.Message>;
52
+ /**
53
+ * Use this method to forward multiple messages of any kind. If some of the specified messages can't be found or forwarded, they are skipped. Service messages and messages with protected content can't be forwarded. Album grouping is kept for forwarded messages.
54
+ * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
55
+ * @param fromChatId Unique identifier for the chat where the original messages were sent (or channel username in the format @channelusername)
56
+ * @param messageIds Identifiers of 1-100 messages in the chat from_chat_id to forward. The identifiers must be specified in a strictly increasing order.
57
+ */
58
+ forwardMessages(chatId: number | string, fromChatId: number | string, messageIds: number[], extra?: tt.ExtraForwardMessages): Promise<tg.MessageId[]>;
59
+ /**
60
+ * Use this method when you need to tell the user that something is happening on the bot's side.
61
+ * The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status).
62
+ * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
63
+ */
64
+ sendChatAction(chat_id: number | string, action: tt.ChatAction, extra?: tt.ExtraSendChatAction): Promise<true>;
65
+ /**
66
+ * Use this method to change the chosen reactions on a message. Service messages can't be reacted to.
67
+ * Automatically forwarded messages from a channel to its discussion group have the same available
68
+ * reactions as messages in the channel. In albums, bots must react to the first message.
69
+ * @param chat_id Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
70
+ * @param message_id Identifier of the target message
71
+ * @param reaction New list of reaction types to set on the message. Currently, as non-premium users, bots can set up
72
+ * to one reaction per message. A custom emoji reaction can be used if it is either already present on the message
73
+ * or explicitly allowed by chat administrators.
74
+ * @param is_big Pass True to set the reaction with a big animation
75
+ * @returns
76
+ */
77
+ setMessageReaction(chat_id: number | string, message_id: number, reaction?: tg.ReactionType[], is_big?: boolean): Promise<true>;
78
+ getUserProfilePhotos(userId: number, offset?: number, limit?: number): Promise<tg.UserProfilePhotos>;
79
+ /**
80
+ * Send point on the map.
81
+ * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
82
+ */
83
+ sendLocation(chatId: number | string, latitude: number, longitude: number, extra?: tt.ExtraLocation): Promise<tg.Message.LocationMessage>;
84
+ sendVenue(chatId: number | string, latitude: number, longitude: number, title: string, address: string, extra?: tt.ExtraVenue): Promise<tg.Message.VenueMessage>;
85
+ /**
86
+ * @param chatId Unique identifier for the target private chat
87
+ */
88
+ sendInvoice(chatId: number | string, invoice: tt.NewInvoiceParameters, extra?: tt.ExtraInvoice): Promise<tg.Message.InvoiceMessage>;
89
+ sendContact(chatId: number | string, phoneNumber: string, firstName: string, extra?: tt.ExtraContact): Promise<tg.Message.ContactMessage>;
90
+ /**
91
+ * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
92
+ */
93
+ sendPhoto(chatId: number | string, photo: tg.Opts<'sendPhoto'>['photo'], extra?: tt.ExtraPhoto): Promise<tg.Message.PhotoMessage>;
94
+ /**
95
+ * Send a dice, which will have a random value from 1 to 6.
96
+ * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
97
+ */
98
+ sendDice(chatId: number | string, extra?: tt.ExtraDice): Promise<tg.Message.DiceMessage>;
99
+ /**
100
+ * Send general files. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future.
101
+ * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
102
+ */
103
+ sendDocument(chatId: number | string, document: tg.Opts<'sendDocument'>['document'], extra?: tt.ExtraDocument): Promise<tg.Message.DocumentMessage>;
104
+ /**
105
+ * Send audio files, if you want Telegram clients to display them in the music player.
106
+ * Your audio must be in the .mp3 format.
107
+ * Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future.
108
+ * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
109
+ */
110
+ sendAudio(chatId: number | string, audio: tg.Opts<'sendAudio'>['audio'], extra?: tt.ExtraAudio): Promise<tg.Message.AudioMessage>;
111
+ /**
112
+ * Send .webp, animated .tgs, or video .webm stickers
113
+ * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
114
+ */
115
+ sendSticker(chatId: number | string, sticker: tg.Opts<'sendSticker'>['sticker'], extra?: tt.ExtraSticker): Promise<tg.Message.StickerMessage>;
116
+ /**
117
+ * Send video files, Telegram clients support mp4 videos (other formats may be sent as Document).
118
+ * Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future.
119
+ * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
120
+ */
121
+ sendVideo(chatId: number | string, video: tg.Opts<'sendVideo'>['video'], extra?: tt.ExtraVideo): Promise<tg.Message.VideoMessage>;
122
+ /**
123
+ * Send .gif animations.
124
+ * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
125
+ */
126
+ sendAnimation(chatId: number | string, animation: tg.Opts<'sendAnimation'>['animation'], extra?: tt.ExtraAnimation): Promise<tg.Message.AnimationMessage>;
127
+ /**
128
+ * Send video messages.
129
+ * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
130
+ */
131
+ sendVideoNote(chatId: number | string, videoNote: string | tg.InputFileVideoNote, extra?: tt.ExtraVideoNote): Promise<tg.Message.VideoNoteMessage>;
132
+ /**
133
+ * Send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .ogg file encoded with OPUS (other formats may be sent as Audio or Document). On success, the sent Message is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.
134
+ * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
135
+ */
136
+ sendVoice(chatId: number | string, voice: tg.Opts<'sendVoice'>['voice'], extra?: tt.ExtraVoice): Promise<tg.Message.VoiceMessage>;
137
+ /**
138
+ * @param chatId Unique identifier for the target chat
139
+ * @param gameShortName Short name of the game, serves as the unique identifier for the game. Set up your games via Botfather.
140
+ */
141
+ sendGame(chatId: number, gameName: string, extra?: tt.ExtraGame): Promise<tg.Message.GameMessage>;
142
+ /**
143
+ * Send a group of photos or videos as an album.
144
+ * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
145
+ * @param media A JSON-serialized array describing photos and videos to be sent, must include 2–10 items
146
+ */
147
+ sendMediaGroup(chatId: number | string, media: tt.MediaGroup, extra?: tt.ExtraMediaGroup): Promise<(tg.Message.DocumentMessage | tg.Message.AudioMessage | tg.Message.PhotoMessage | tg.Message.VideoMessage)[]>;
148
+ /**
149
+ * Send a native poll.
150
+ * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
151
+ * @param question Poll question, 1-255 characters
152
+ * @param options A JSON-serialized list of answer options, 2-10 strings 1-100 characters each
153
+ */
154
+ sendPoll(chatId: number | string, question: string, options: readonly string[], extra?: tt.ExtraPoll): Promise<tg.Message.PollMessage>;
155
+ /**
156
+ * Send a native quiz.
157
+ * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
158
+ * @param question Poll question, 1-255 characters
159
+ * @param options A JSON-serialized list of answer options, 2-10 strings 1-100 characters each
160
+ */
161
+ sendQuiz(chatId: number | string, question: string, options: readonly string[], extra?: tt.ExtraPoll): Promise<tg.Message.PollMessage>;
162
+ /**
163
+ * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
164
+ * @param messageId Identifier of the original message with the poll
165
+ */
166
+ stopPoll(chatId: number | string, messageId: number, extra?: tt.ExtraStopPoll): Promise<tg.Poll>;
167
+ /**
168
+ * Get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc.).
169
+ * @param chatId Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
170
+ */
171
+ getChat(chatId: number | string): Promise<tg.ChatFromGetChat>;
172
+ /**
173
+ * @param chatId Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
174
+ */
175
+ getChatAdministrators(chatId: number | string): Promise<(tg.ChatMemberOwner | tg.ChatMemberAdministrator)[]>;
176
+ /**
177
+ * Get information about a member of a chat.
178
+ * @param chatId Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
179
+ * @param userId Unique identifier of the target user
180
+ */
181
+ getChatMember(chatId: string | number, userId: number): Promise<tg.ChatMember>;
182
+ /**
183
+ * Get the number of members in a chat.
184
+ * @param chatId Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
185
+ */
186
+ getChatMembersCount(chatId: string | number): Promise<number>;
187
+ /**
188
+ * Send answers to an inline query.
189
+ * No more than 50 results per query are allowed.
190
+ */
191
+ answerInlineQuery(inlineQueryId: string, results: readonly tg.InlineQueryResult[], extra?: tt.ExtraAnswerInlineQuery): Promise<true>;
192
+ setChatPermissions(chatId: number | string, permissions: tg.ChatPermissions, extra?: tt.ExtraSetChatPermissions): Promise<true>;
193
+ /**
194
+ * Kick a user from a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the group on their own using invite links, etc., unless unbanned first. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
195
+ * @param chatId Unique identifier for the target group or username of the target supergroup or channel (in the format `@channelusername`)
196
+ * @param untilDate Date when the user will be unbanned, unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever
197
+ */
198
+ banChatMember(chatId: number | string, userId: number, untilDate?: number, extra?: tt.ExtraBanChatMember): Promise<true>;
199
+ /**
200
+ * Kick a user from a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the group on their own using invite links, etc., unless unbanned first. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
201
+ * @param chatId Unique identifier for the target group or username of the target supergroup or channel (in the format `@channelusername`)
202
+ * @param untilDate Date when the user will be unbanned, unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever
203
+ * @deprecated since API 5.3. Use {@link Telegram.banChatMember}
204
+ */
205
+ get kickChatMember(): (chatId: number | string, userId: number, untilDate?: number, extra?: tt.ExtraBanChatMember) => Promise<true>;
206
+ /**
207
+ * Promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Pass False for all boolean parameters to demote a user.
208
+ * @param chatId Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
209
+ */
210
+ promoteChatMember(chatId: number | string, userId: number, extra: tt.ExtraPromoteChatMember): Promise<true>;
211
+ /**
212
+ * Restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work and must have the appropriate admin rights. Pass True for all boolean parameters to lift restrictions from a user.
213
+ * @param chatId Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
214
+ */
215
+ restrictChatMember(chatId: string | number, userId: number, extra: tt.ExtraRestrictChatMember): Promise<true>;
216
+ setChatAdministratorCustomTitle(chatId: number | string, userId: number, title: string): Promise<true>;
217
+ /**
218
+ * Export an invite link to a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
219
+ * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
220
+ */
221
+ exportChatInviteLink(chatId: number | string): Promise<string>;
222
+ createChatInviteLink(chatId: number | string, extra?: tt.ExtraCreateChatInviteLink): Promise<tg.ChatInviteLink>;
223
+ createInvoiceLink(invoice: tt.NewInvoiceLinkParameters): Promise<string>;
224
+ editChatInviteLink(chatId: number | string, inviteLink: string, extra?: tt.ExtraEditChatInviteLink): Promise<tg.ChatInviteLink>;
225
+ revokeChatInviteLink(chatId: number | string, inviteLink: string): Promise<tg.ChatInviteLink>;
226
+ setChatPhoto(chatId: number | string, photo: tg.Opts<'setChatPhoto'>['photo']): Promise<true>;
227
+ deleteChatPhoto(chatId: number | string): Promise<true>;
228
+ /**
229
+ * Change the title of a chat. Titles can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
230
+ * @param chatId Unique identifier for the target group or username of the target supergroup or channel (in the format `@channelusername`)
231
+ * @param title New chat title, 1-255 characters
232
+ */
233
+ setChatTitle(chatId: number | string, title: string): Promise<true>;
234
+ setChatDescription(chatId: number | string, description?: string): Promise<true>;
235
+ /**
236
+ * Pin a message in a group, a supergroup, or a channel. The bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in the supergroup or 'can_edit_messages' admin right in the channel.
237
+ * @param chatId Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
238
+ */
239
+ pinChatMessage(chatId: number | string, messageId: number, extra?: {
240
+ disable_notification?: boolean;
241
+ }): Promise<true>;
242
+ /**
243
+ * Unpin a message in a group, a supergroup, or a channel. The bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in the supergroup or 'can_edit_messages' admin right in the channel.
244
+ * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
245
+ */
246
+ unpinChatMessage(chatId: number | string, messageId?: number): Promise<true>;
247
+ /**
248
+ * Clear the list of pinned messages in a chat.
249
+ * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
250
+ */
251
+ unpinAllChatMessages(chatId: number | string): Promise<true>;
252
+ /**
253
+ * Use this method for your bot to leave a group, supergroup or channel.
254
+ * @param chatId Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
255
+ */
256
+ leaveChat(chatId: number | string): Promise<true>;
257
+ /**
258
+ * Unban a user from a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
259
+ * @param chatId Unique identifier for the target group or username of the target supergroup or channel (in the format @username)
260
+ * @param userId Unique identifier of the target user
261
+ */
262
+ unbanChatMember(chatId: number | string, userId: number, extra?: {
263
+ only_if_banned?: boolean;
264
+ }): Promise<true>;
265
+ answerCbQuery(callbackQueryId: string, text?: string, extra?: tt.ExtraAnswerCbQuery): Promise<true>;
266
+ answerGameQuery(callbackQueryId: string, url: string): Promise<true>;
267
+ /**
268
+ * Use this method to get the list of boosts added to a chat by a user. Requires administrator rights in the chat. Returns a UserChatBoosts object.
269
+ * @param chat_id Unique identifier for the chat or username of the channel (in the format `@channelusername`)
270
+ * @param user_id Unique identifier of the target user
271
+ */
272
+ getUserChatBoosts(chat_id: number | string, user_id: number): Promise<tg.UserChatBoosts[]>;
273
+ /**
274
+ * If you sent an invoice requesting a shipping address and the parameter is_flexible was specified,
275
+ * the Bot API will send an Update with a shipping_query field to the bot.
276
+ * Reply to shipping queries.
277
+ * @param ok Specify True if delivery to the specified address is possible and False if there are any problems (for example, if delivery to the specified address is not possible)
278
+ * @param shippingOptions Required if ok is True. A JSON-serialized array of available shipping options.
279
+ * @param errorMessage Required if ok is False. Error message in human readable form that explains why it is impossible to complete the order (e.g. "Sorry, delivery to your desired address is unavailable'). Telegram will display this message to the user.
280
+ */
281
+ answerShippingQuery(shippingQueryId: string, ok: boolean, shippingOptions: readonly tg.ShippingOption[] | undefined, errorMessage: string | undefined): Promise<true>;
282
+ /**
283
+ * Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of an Update with the field pre_checkout_query.
284
+ * Respond to such pre-checkout queries. On success, True is returned.
285
+ * Note: The Bot API must receive an answer within 10 seconds after the pre-checkout query was sent.
286
+ * @param ok Specify True if everything is alright (goods are available, etc.) and the bot is ready to proceed with the order. Use False if there are any problems.
287
+ * @param errorMessage Required if ok is False. Error message in human readable form that explains the reason for failure to proceed with the checkout (e.g. "Sorry, somebody just bought the last of our amazing black T-shirts while you were busy filling out your payment details. Please choose a different color or garment!"). Telegram will display this message to the user.
288
+ */
289
+ answerPreCheckoutQuery(preCheckoutQueryId: string, ok: boolean, errorMessage?: string): Promise<true>;
290
+ answerWebAppQuery(webAppQueryId: string, result: tg.InlineQueryResult): Promise<tg.SentWebAppMessage>;
291
+ /**
292
+ * Edit text and game messages sent by the bot or via the bot (for inline bots).
293
+ * On success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned.
294
+ * @param chatId Required if inlineMessageId is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)
295
+ * @param messageId Required if inlineMessageId is not specified. Identifier of the sent message
296
+ * @param inlineMessageId Required if chatId and messageId are not specified. Identifier of the inline message
297
+ * @param text New text of the message
298
+ */
299
+ editMessageText(chatId: number | string | undefined, messageId: number | undefined, inlineMessageId: string | undefined, text: string | FmtString, extra?: tt.ExtraEditMessageText): Promise<true | (tg.Update.Edited & tg.Message.TextMessage)>;
300
+ /**
301
+ * Edit captions of messages sent by the bot or via the bot (for inline bots).
302
+ * On success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned.
303
+ * @param chatId Required if inlineMessageId is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)
304
+ * @param messageId Required if inlineMessageId is not specified. Identifier of the sent message
305
+ * @param inlineMessageId Required if chatId and messageId are not specified. Identifier of the inline message
306
+ * @param caption New caption of the message
307
+ * @param markup A JSON-serialized object for an inline keyboard.
308
+ */
309
+ editMessageCaption(chatId: number | string | undefined, messageId: number | undefined, inlineMessageId: string | undefined, caption: string | FmtString | undefined, extra?: tt.ExtraEditMessageCaption): Promise<true | (tg.Update.Edited & tg.Message.CaptionableMessage)>;
310
+ /**
311
+ * Edit animation, audio, document, photo, or video messages.
312
+ * If a message is a part of a message album, then it can be edited only to a photo or a video.
313
+ * Otherwise, message type can be changed arbitrarily.
314
+ * When inline message is edited, new file can't be uploaded.
315
+ * Use previously uploaded file via its file_id or specify a URL.
316
+ * @param chatId Required if inlineMessageId is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)
317
+ * @param messageId Required if inlineMessageId is not specified. Identifier of the sent message
318
+ * @param inlineMessageId Required if chatId and messageId are not specified. Identifier of the inline message
319
+ * @param media New media of message
320
+ * @param extra Additional parameters, such as reply_markup
321
+ */
322
+ editMessageMedia(chatId: number | string | undefined, messageId: number | undefined, inlineMessageId: string | undefined, media: tt.WrapCaption<tg.InputMedia>, extra?: tt.ExtraEditMessageMedia): Promise<true | (tg.Update.Edited & tg.Message)>;
323
+ /**
324
+ * Edit only the reply markup of messages sent by the bot or via the bot (for inline bots).
325
+ * @param chatId Required if inlineMessageId is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)
326
+ * @param messageId Required if inlineMessageId is not specified. Identifier of the sent message
327
+ * @param inlineMessageId Required if chatId and messageId are not specified. Identifier of the inline message
328
+ * @param markup A JSON-serialized object for an inline keyboard.
329
+ * @returns If edited message is sent by the bot, the edited Message is returned, otherwise True is returned.
330
+ */
331
+ editMessageReplyMarkup(chatId: number | string | undefined, messageId: number | undefined, inlineMessageId: string | undefined, markup: tg.InlineKeyboardMarkup | undefined): Promise<true | (tg.Update.Edited & tg.Message)>;
332
+ editMessageLiveLocation(chatId: number | string | undefined, messageId: number | undefined, inlineMessageId: string | undefined, latitude: number, longitude: number, extra?: tt.ExtraEditMessageLiveLocation): Promise<true | (tg.Update.Edited & tg.Message.LocationMessage)>;
333
+ stopMessageLiveLocation(chatId: number | string | undefined, messageId: number | undefined, inlineMessageId: string | undefined, markup?: tg.InlineKeyboardMarkup): Promise<true | (tg.Update.Edited & tg.Message.LocationMessage)>;
334
+ /**
335
+ * Delete a message, including service messages, with the following limitations:
336
+ * - A message can only be deleted if it was sent less than 48 hours ago.
337
+ * - Bots can delete outgoing messages in groups and supergroups.
338
+ * - Bots granted can_post_messages permissions can delete outgoing messages in channels.
339
+ * - If the bot is an administrator of a group, it can delete any message there.
340
+ * - If the bot has can_delete_messages permission in a supergroup or a channel, it can delete any message there.
341
+ * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
342
+ * @param messageId Identifier of the message to delete
343
+ */
344
+ deleteMessage(chatId: number | string, messageId: number): Promise<true>;
345
+ /**
346
+ * Use this method to delete multiple messages simultaneously. If some of the specified messages can't be found, they are skipped.
347
+ * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
348
+ * @param messageIds Identifiers of 1-100 messages to delete. See deleteMessage for limitations on which messages can be deleted
349
+ */
350
+ deleteMessages(chatId: number | string, messageIds: number[]): Promise<true>;
351
+ setChatStickerSet(chatId: number | string, setName: string): Promise<true>;
352
+ deleteChatStickerSet(chatId: number | string): Promise<true>;
353
+ /**
354
+ * Use this method to get custom emoji stickers, which can be used as a forum topic icon by any user.
355
+ * Requires no parameters. Returns an Array of Sticker objects.
356
+ *
357
+ * @see https://core.telegram.org/bots/api#getforumtopiciconstickers
358
+ */
359
+ getForumTopicIconStickers(): Promise<tg.Sticker[]>;
360
+ /**
361
+ * Use this method to create a topic in a forum supergroup chat. The bot must be an administrator in the chat for this
362
+ * to work and must have the can_manage_topics administrator rights. Returns information about the created topic as a
363
+ * ForumTopic object.
364
+ *
365
+ * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
366
+ * @param name Topic name, 1-128 characters
367
+ *
368
+ * @see https://core.telegram.org/bots/api#createforumtopic
369
+ */
370
+ createForumTopic(chat_id: number | string, name: string, extra?: tt.ExtraCreateForumTopic): Promise<tg.ForumTopic>;
371
+ /**
372
+ * Use this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator in
373
+ * the chat for this to work and must have can_manage_topics administrator rights, unless it is the creator of the
374
+ * topic. Returns True on success.
375
+ *
376
+ * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
377
+ * @param message_thread_id Unique identifier for the target message thread of the forum topic
378
+ *
379
+ * @see https://core.telegram.org/bots/api#editforumtopic
380
+ */
381
+ editForumTopic(chat_id: number | string, message_thread_id: number, extra: tt.ExtraEditForumTopic): Promise<true>;
382
+ /**
383
+ * Use this method to close an open topic in a forum supergroup chat. The bot must be an administrator in the chat
384
+ * for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic.
385
+ * Returns True on success.
386
+ *
387
+ * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
388
+ * @param message_thread_id Unique identifier for the target message thread of the forum topic
389
+ *
390
+ * @see https://core.telegram.org/bots/api#closeforumtopic
391
+ */
392
+ closeForumTopic(chat_id: number | string, message_thread_id: number): Promise<true>;
393
+ /**
394
+ * Use this method to reopen a closed topic in a forum supergroup chat. The bot must be an administrator in the chat
395
+ * for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic.
396
+ * Returns True on success.
397
+ *
398
+ * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
399
+ * @param message_thread_id Unique identifier for the target message thread of the forum topic
400
+ *
401
+ * @see https://core.telegram.org/bots/api#reopenforumtopic
402
+ */
403
+ reopenForumTopic(chat_id: number | string, message_thread_id: number): Promise<true>;
404
+ /**
405
+ * Use this method to delete a forum topic along with all its messages in a forum supergroup chat. The bot must be an
406
+ * administrator in the chat for this to work and must have the can_delete_messages administrator rights.
407
+ * Returns True on success.
408
+ *
409
+ * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
410
+ * @param message_thread_id Unique identifier for the target message thread of the forum topic
411
+ *
412
+ * @see https://core.telegram.org/bots/api#deleteforumtopic
413
+ */
414
+ deleteForumTopic(chat_id: number | string, message_thread_id: number): Promise<true>;
415
+ /**
416
+ * Use this method to clear the list of pinned messages in a forum topic. The bot must be an administrator in the chat
417
+ * for this to work and must have the can_pin_messages administrator right in the supergroup. Returns True on success.
418
+ *
419
+ * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
420
+ * @param message_thread_id Unique identifier for the target message thread of the forum topic
421
+ *
422
+ * @see https://core.telegram.org/bots/api#unpinallforumtopicmessages
423
+ */
424
+ unpinAllForumTopicMessages(chat_id: number | string, message_thread_id: number): Promise<true>;
425
+ /**
426
+ * Use this method to edit the name of the 'General' topic in a forum supergroup chat. The bot must be an administrator
427
+ * in the chat for this to work and must have can_manage_topics administrator rights. Returns True on success.
428
+ *
429
+ * @param chat_id Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
430
+ * @param name New topic name, 1-128 characters
431
+ *
432
+ * @see https://core.telegram.org/bots/api#editgeneralforumtopic
433
+ */
434
+ editGeneralForumTopic(chat_id: number | string, name: string): Promise<true>;
435
+ /**
436
+ * Use this method to close an open 'General' topic in a forum supergroup chat. The bot must be an administrator in the
437
+ * chat for this to work and must have the can_manage_topics administrator rights. Returns True on success.
438
+ *
439
+ * @param chat_id Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
440
+ *
441
+ * @see https://core.telegram.org/bots/api#closegeneralforumtopic
442
+ */
443
+ closeGeneralForumTopic(chat_id: number | string): Promise<true>;
444
+ /**
445
+ * Use this method to reopen a closed 'General' topic in a forum supergroup chat. The bot must be an administrator in
446
+ * the chat for this to work and must have the can_manage_topics administrator rights. The topic will be automatically
447
+ * unhidden if it was hidden. Returns True on success.
448
+ *
449
+ * @param chat_id Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
450
+ *
451
+ * @see https://core.telegram.org/bots/api#reopengeneralforumtopic
452
+ */
453
+ reopenGeneralForumTopic(chat_id: number | string): Promise<true>;
454
+ /**
455
+ * Use this method to hide the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat
456
+ * for this to work and must have the can_manage_topics administrator rights. The topic will be automatically closed
457
+ * if it was open. Returns True on success.
458
+ *
459
+ * @param chat_id Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
460
+ *
461
+ * @see https://core.telegram.org/bots/api#hidegeneralforumtopic
462
+ */
463
+ hideGeneralForumTopic(chat_id: number | string): Promise<true>;
464
+ /**
465
+ * Use this method to unhide the 'General' topic in a forum supergroup chat. The bot must be an administrator in the
466
+ * chat for this to work and must have the can_manage_topics administrator rights. Returns True on success.
467
+ *
468
+ * @param chat_id Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
469
+ *
470
+ * @see https://core.telegram.org/bots/api#unhidegeneralforumtopic
471
+ */
472
+ unhideGeneralForumTopic(chat_id: number | string): Promise<true>;
473
+ /**
474
+ * Use this method to clear the list of pinned messages in a General forum topic.
475
+ * The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator
476
+ * right in the supergroup.
477
+ *
478
+ * @param chat_id Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
479
+ */
480
+ unpinAllGeneralForumTopicMessages(chat_id: number | string): Promise<true>;
481
+ getStickerSet(name: string): Promise<tg.StickerSet>;
482
+ /**
483
+ * Upload a .png file with a sticker for later use in createNewStickerSet and addStickerToSet methods (can be used multiple times).
484
+ * https://core.telegram.org/bots/api#sending-files
485
+ * @param ownerId User identifier of sticker file owner
486
+ * @param stickerFile Png image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px.
487
+ */
488
+ uploadStickerFile(ownerId: number, sticker: tg.Opts<'uploadStickerFile'>['sticker'], sticker_format: tg.Opts<'uploadStickerFile'>['sticker_format']): Promise<tg.File>;
489
+ /**
490
+ * Create new sticker set owned by a user. The bot will be able to edit the created sticker set.
491
+ * @param ownerId User identifier of created sticker set owner
492
+ * @param name Short name of sticker set, to be used in t.me/addstickers/ URLs (e.g., animals). Can contain only english letters, digits and underscores. Must begin with a letter, can't contain consecutive underscores and must end in “_by_<bot username>”. <bot_username> is case insensitive. 1-64 characters.
493
+ * @param title Sticker set title, 1-64 characters
494
+ */
495
+ createNewStickerSet(ownerId: number, name: string, title: string, stickerData: tt.ExtraCreateNewStickerSet): Promise<true>;
496
+ /**
497
+ * Add a new sticker to a set created by the bot.
498
+ * @param ownerId User identifier of sticker set owner
499
+ * @param name Sticker set name
500
+ */
501
+ addStickerToSet(ownerId: number, name: string, stickerData: tt.ExtraAddStickerToSet): Promise<true>;
502
+ /**
503
+ * Move a sticker in a set created by the bot to a specific position.
504
+ * @param sticker File identifier of the sticker
505
+ * @param position New sticker position in the set, zero-based
506
+ */
507
+ setStickerPositionInSet(sticker: string, position: number): Promise<true>;
508
+ /**
509
+ * @deprecated since API 6.8. Use {@link Telegram.setStickerSetThumbnail}
510
+ */
511
+ get setStickerSetThumb(): (name: string, userId: number, thumbnail?: tg.Opts<"setStickerSetThumbnail">["thumbnail"]) => Promise<true>;
512
+ /**
513
+ * Use this method to set the thumbnail of a regular or mask sticker set.
514
+ * The format of the thumbnail file must match the format of the stickers in the set.
515
+ * @param name Sticker set name
516
+ * @param userId User identifier of the sticker set owner
517
+ * @param thumbnail A .WEBP or .PNG image with the thumbnail, must be up to 128 kilobytes in size
518
+ * and have a width and height of exactly 100px, or a .TGS animation with a thumbnail up to
519
+ * 32 kilobytes in size (see
520
+ * [animated sticker technical requirements](https://core.telegram.org/stickers#animated-sticker-requirements)),
521
+ * or a WEBM video with the thumbnail up to 32 kilobytes in size; see
522
+ * [video sticker technical requirements](https://core.telegram.org/stickers#video-sticker-requirements).
523
+ * Pass a file_id as a String to send a file that already exists on the Telegram servers, pass a
524
+ * HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using
525
+ * Input helpers. Animated and video sticker set thumbnails can't be uploaded via HTTP URL.
526
+ * If omitted, then the thumbnail is dropped and the first sticker is used as the thumbnail.
527
+ */
528
+ setStickerSetThumbnail(name: string, userId: number, thumbnail?: tg.Opts<'setStickerSetThumbnail'>['thumbnail']): Promise<true>;
529
+ setStickerMaskPosition(sticker: string, mask_position?: tg.MaskPosition): Promise<true>;
530
+ setStickerKeywords(sticker: string, keywords?: string[]): Promise<true>;
531
+ setStickerEmojiList(sticker: string, emoji_list: string[]): Promise<true>;
532
+ deleteStickerSet(name: string): Promise<true>;
533
+ setStickerSetTitle(name: string, title: string): Promise<true>;
534
+ setCustomEmojiStickerSetThumbnail(name: string, custom_emoji_id: string): Promise<true>;
535
+ /**
536
+ * Delete a sticker from a set created by the bot.
537
+ * @param sticker File identifier of the sticker
538
+ */
539
+ deleteStickerFromSet(sticker: string): Promise<true>;
540
+ getCustomEmojiStickers(custom_emoji_ids: string[]): Promise<tg.Sticker[]>;
541
+ /**
542
+ * Change the list of the bot's commands.
543
+ * @param commands A list of bot commands to be set as the list of the bot's commands. At most 100 commands can be specified.
544
+ */
545
+ setMyCommands(commands: readonly tg.BotCommand[], extra?: tt.ExtraSetMyCommands): Promise<true>;
546
+ deleteMyCommands(extra?: tg.Opts<'deleteMyCommands'>): Promise<true>;
547
+ /**
548
+ * Get the current list of the bot's commands.
549
+ */
550
+ getMyCommands(extra?: tg.Opts<'getMyCommands'>): Promise<tg.BotCommand[]>;
551
+ /**
552
+ * Use this method to change the bot's description, which is shown in the chat with the bot if the chat is empty.
553
+ * @param description New bot description; 0-512 characters. Pass an empty string to remove the dedicated description for the given language.
554
+ * @param language_code A two-letter ISO 639-1 language code. If empty, the description will be applied to all users for whose language there is no dedicated description.
555
+ */
556
+ setMyDescription(description: string, language_code?: string): Promise<true>;
557
+ /**
558
+ * Use this method to change the bot's name.
559
+ * @param name New bot name; 0-64 characters. Pass an empty string to remove the dedicated name for the given language.
560
+ * @param language_code A two-letter ISO 639-1 language code. If empty, the name will be shown to all users for whose language there is no dedicated name.
561
+ */
562
+ setMyName(name: string, language_code?: string): Promise<true>;
563
+ /**
564
+ * Use this method to get the current bot name for the given user language.
565
+ * @param language_code A two-letter ISO 639-1 language code or an empty string
566
+ */
567
+ getMyName(language_code?: string): Promise<tg.BotName>;
568
+ /**
569
+ * Use this method to get the current bot description for the given user language.
570
+ * @param language_code A two-letter ISO 639-1 language code.
571
+ */
572
+ getMyDescription(language_code?: string): Promise<tg.BotDescription>;
573
+ /**
574
+ * Use this method to change the bot's short description, which is shown on the bot's profile page and is sent together with the link when users share the bot.
575
+ * @param description New short description for the bot; 0-120 characters. Pass an empty string to remove the dedicated short description for the given language.
576
+ * @param language_code A two-letter ISO 639-1 language code. If empty, the short description will be applied to all users for whose language there is no dedicated short description.
577
+ */
578
+ setMyShortDescription(short_description: string, language_code?: string): Promise<true>;
579
+ /**
580
+ * Use this method to get the current bot short description for the given user language.
581
+ * @param language_code A two-letter ISO 639-1 language code or an empty string
582
+ */
583
+ getMyShortDescription(language_code?: string): Promise<tg.BotShortDescription>;
584
+ setPassportDataErrors(userId: number, errors: readonly tg.PassportElementError[]): Promise<true>;
585
+ /**
586
+ * Send copy of existing message.
587
+ * @deprecated use `copyMessage` instead
588
+ * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
589
+ * @param message Received message object
590
+ */
591
+ sendCopy(chatId: number | string, message: tg.Message, extra?: tt.ExtraCopyMessage): Promise<tg.MessageId>;
592
+ /**
593
+ * Send copy of existing message.
594
+ * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
595
+ * @param fromChatId Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername)
596
+ * @param messageId Message identifier in the chat specified in from_chat_id
597
+ */
598
+ copyMessage(chatId: number | string, fromChatId: number | string, messageId: number, extra?: tt.ExtraCopyMessage): Promise<tg.MessageId>;
599
+ /**
600
+ * Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are skipped. Service messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessages, but the copied messages don't have a link to the original message. Album grouping is kept for copied messages.
601
+ * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
602
+ * @param fromChatId Unique identifier for the chat where the original messages were sent (or channel username in the format @channelusername)
603
+ * @param messageIds Identifiers of 1-100 messages in the chat from_chat_id to copy. The identifiers must be specified in a strictly increasing order.
604
+ */
605
+ copyMessages(chatId: number | string, fromChatId: number | string, messageIds: number[], extra?: tt.ExtraCopyMessages): Promise<tg.MessageId[]>;
606
+ /**
607
+ * Approve a chat join request.
608
+ * The bot must be an administrator in the chat for this to work and must have the can_invite_users administrator right.
609
+ * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
610
+ * @param userId Unique identifier of the target user
611
+ */
612
+ approveChatJoinRequest(chatId: number | string, userId: number): Promise<true>;
613
+ /**
614
+ * Decline a chat join request.
615
+ * The bot must be an administrator in the chat for this to work and must have the can_invite_users administrator right.
616
+ * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
617
+ * @param userId Unique identifier of the target user
618
+ */
619
+ declineChatJoinRequest(chatId: number | string, userId: number): Promise<true>;
620
+ /**
621
+ * Ban a channel chat in a supergroup or a channel. The owner of the chat will not be able to send messages and join live streams on behalf of the chat, unless it is unbanned first.
622
+ * The bot must be an administrator in the supergroup or channel for this to work and must have the appropriate administrator rights.
623
+ * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
624
+ * @param senderChatId Unique identifier of the target sender chat
625
+ */
626
+ banChatSenderChat(chatId: number | string, senderChatId: number, extra?: tt.ExtraBanChatSenderChat): Promise<true>;
627
+ /**
628
+ * Unban a previously banned channel chat in a supergroup or channel.
629
+ * The bot must be an administrator for this to work and must have the appropriate administrator rights.
630
+ * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
631
+ * @param senderChatId Unique identifier of the target sender chat
632
+ */
633
+ unbanChatSenderChat(chatId: number | string, senderChatId: number): Promise<true>;
634
+ /**
635
+ * Use this method to change the bot's menu button in a private chat, or the default menu button. Returns true on success.
636
+ * @param chatId Unique identifier for the target private chat. If not specified, default bot's menu button will be changed.
637
+ * @param menuButton An object for the bot's new menu button.
638
+ */
639
+ setChatMenuButton({ chatId, menuButton, }?: {
640
+ chatId?: number | undefined;
641
+ menuButton?: tg.MenuButton | undefined;
642
+ }): Promise<true>;
643
+ /**
644
+ * Use this method to get the current value of the bot's menu button in a private chat, or the default menu button. Returns MenuButton on success.
645
+ * @param chatId Unique identifier for the target private chat. If not specified, default bot's menu button will be returned.
646
+ */
647
+ getChatMenuButton({ chatId }?: {
648
+ chatId?: number;
649
+ }): Promise<tg.MenuButton>;
650
+ /**
651
+ * Use this method to change the default administrator rights requested by the bot when it's added as an administrator to groups or channels.
652
+ * These rights will be suggested to users, but they are are free to modify the list before adding the bot.
653
+ */
654
+ setMyDefaultAdministratorRights({ rights, forChannels, }?: {
655
+ rights?: tg.ChatAdministratorRights;
656
+ forChannels?: boolean;
657
+ }): Promise<true>;
658
+ /**
659
+ * Use this method to get the current default administrator rights of the bot. Returns ChatAdministratorRights on success.
660
+ * @param forChannels Pass true to get default administrator rights of the bot in channels. Otherwise, default administrator rights of the bot for groups and supergroups will be returned.
661
+ */
662
+ getMyDefaultAdministratorRights({ forChannels, }?: {
663
+ forChannels?: boolean;
664
+ }): Promise<tg.ChatAdministratorRights>;
665
+ /**
666
+ * Log out from the cloud Bot API server before launching the bot locally.
667
+ */
668
+ logOut(): Promise<true>;
669
+ /**
670
+ * Close the bot instance before moving it from one local server to another.
671
+ */
672
+ close(): Promise<true>;
673
+ }
674
+ export default Telegram;
675
+ //# sourceMappingURL=telegram.d.ts.map