teleproto 203.0.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 (224) hide show
  1. package/CryptoFile.d.ts +2 -0
  2. package/CryptoFile.js +23 -0
  3. package/Helpers.d.ts +151 -0
  4. package/Helpers.js +477 -0
  5. package/LICENSE +23 -0
  6. package/Password.d.ts +15 -0
  7. package/Password.js +271 -0
  8. package/README.md +111 -0
  9. package/Utils.d.ts +228 -0
  10. package/Utils.js +1248 -0
  11. package/Version.d.ts +1 -0
  12. package/Version.js +4 -0
  13. package/client/2fa.d.ts +48 -0
  14. package/client/2fa.js +109 -0
  15. package/client/TelegramClient.d.ts +1042 -0
  16. package/client/TelegramClient.js +1167 -0
  17. package/client/account.d.ts +0 -0
  18. package/client/account.js +1 -0
  19. package/client/auth.d.ts +93 -0
  20. package/client/auth.js +375 -0
  21. package/client/bots.d.ts +6 -0
  22. package/client/bots.js +24 -0
  23. package/client/buttons.d.ts +4 -0
  24. package/client/buttons.js +87 -0
  25. package/client/chats.d.ts +46 -0
  26. package/client/chats.js +350 -0
  27. package/client/dialogs.d.ts +52 -0
  28. package/client/dialogs.js +174 -0
  29. package/client/downloads.d.ts +157 -0
  30. package/client/downloads.js +598 -0
  31. package/client/fs.d.ts +1 -0
  32. package/client/fs.js +13 -0
  33. package/client/index.d.ts +15 -0
  34. package/client/index.js +50 -0
  35. package/client/messageParse.d.ts +17 -0
  36. package/client/messageParse.js +191 -0
  37. package/client/messages.d.ts +259 -0
  38. package/client/messages.js +804 -0
  39. package/client/os.d.ts +2 -0
  40. package/client/os.js +23 -0
  41. package/client/path.d.ts +2 -0
  42. package/client/path.js +7 -0
  43. package/client/telegramBaseClient.d.ts +238 -0
  44. package/client/telegramBaseClient.js +368 -0
  45. package/client/updates.d.ts +31 -0
  46. package/client/updates.js +254 -0
  47. package/client/uploads.d.ts +137 -0
  48. package/client/uploads.js +514 -0
  49. package/client/users.d.ts +29 -0
  50. package/client/users.js +491 -0
  51. package/crypto/AuthKey.d.ts +20 -0
  52. package/crypto/AuthKey.js +76 -0
  53. package/crypto/CTR.d.ts +6 -0
  54. package/crypto/CTR.js +35 -0
  55. package/crypto/Factorizator.d.ts +19 -0
  56. package/crypto/Factorizator.js +74 -0
  57. package/crypto/IGE.d.ts +18 -0
  58. package/crypto/IGE.js +34 -0
  59. package/crypto/RSA.d.ts +15 -0
  60. package/crypto/RSA.js +70 -0
  61. package/crypto/converters.d.ts +19 -0
  62. package/crypto/converters.js +52 -0
  63. package/crypto/crypto.d.ts +27 -0
  64. package/crypto/crypto.js +117 -0
  65. package/crypto/words.d.ts +6 -0
  66. package/crypto/words.js +48 -0
  67. package/define.d.ts +77 -0
  68. package/entityCache.d.ts +7 -0
  69. package/entityCache.js +79 -0
  70. package/errors/Common.d.ts +72 -0
  71. package/errors/Common.js +122 -0
  72. package/errors/RPCBaseErrors.d.ts +84 -0
  73. package/errors/RPCBaseErrors.js +134 -0
  74. package/errors/RPCErrorList.d.ts +37 -0
  75. package/errors/RPCErrorList.js +117 -0
  76. package/errors/index.d.ts +11 -0
  77. package/errors/index.js +29 -0
  78. package/events/Album.d.ts +36 -0
  79. package/events/Album.js +104 -0
  80. package/events/CallbackQuery.d.ts +74 -0
  81. package/events/CallbackQuery.js +193 -0
  82. package/events/DeletedMessage.d.ts +45 -0
  83. package/events/DeletedMessage.js +63 -0
  84. package/events/EditedMessage.d.ts +30 -0
  85. package/events/EditedMessage.js +41 -0
  86. package/events/NewMessage.d.ts +89 -0
  87. package/events/NewMessage.js +182 -0
  88. package/events/Raw.d.ts +29 -0
  89. package/events/Raw.js +43 -0
  90. package/events/common.d.ts +66 -0
  91. package/events/common.js +141 -0
  92. package/events/index.d.ts +2 -0
  93. package/events/index.js +8 -0
  94. package/extensions/AsyncQueue.d.ts +10 -0
  95. package/extensions/AsyncQueue.js +32 -0
  96. package/extensions/BinaryReader.d.ts +100 -0
  97. package/extensions/BinaryReader.js +242 -0
  98. package/extensions/BinaryWriter.d.ts +7 -0
  99. package/extensions/BinaryWriter.js +15 -0
  100. package/extensions/Deferred.d.ts +8 -0
  101. package/extensions/Deferred.js +16 -0
  102. package/extensions/Logger.d.ts +56 -0
  103. package/extensions/Logger.js +107 -0
  104. package/extensions/MessagePacker.d.ts +22 -0
  105. package/extensions/MessagePacker.js +154 -0
  106. package/extensions/PendingState.d.ts +12 -0
  107. package/extensions/PendingState.js +29 -0
  108. package/extensions/PromisedNetSockets.d.ts +25 -0
  109. package/extensions/PromisedNetSockets.js +178 -0
  110. package/extensions/PromisedWebSockets.d.ts +19 -0
  111. package/extensions/PromisedWebSockets.js +124 -0
  112. package/extensions/html.d.ts +5 -0
  113. package/extensions/html.js +213 -0
  114. package/extensions/index.d.ts +7 -0
  115. package/extensions/index.js +17 -0
  116. package/extensions/markdown.d.ts +5 -0
  117. package/extensions/markdown.js +76 -0
  118. package/extensions/markdownv2.d.ts +5 -0
  119. package/extensions/markdownv2.js +51 -0
  120. package/extensions/net.d.ts +1 -0
  121. package/extensions/net.js +13 -0
  122. package/extensions/socks.d.ts +1 -0
  123. package/extensions/socks.js +13 -0
  124. package/index.d.ts +14 -0
  125. package/index.js +48 -0
  126. package/inspect.d.ts +1 -0
  127. package/inspect.js +5 -0
  128. package/network/Authenticator.d.ts +12 -0
  129. package/network/Authenticator.js +193 -0
  130. package/network/MTProtoPlainSender.d.ts +19 -0
  131. package/network/MTProtoPlainSender.js +74 -0
  132. package/network/MTProtoSender.d.ts +291 -0
  133. package/network/MTProtoSender.js +854 -0
  134. package/network/MTProtoState.d.ts +103 -0
  135. package/network/MTProtoState.js +267 -0
  136. package/network/RequestState.d.ts +19 -0
  137. package/network/RequestState.js +35 -0
  138. package/network/connection/Connection.d.ts +71 -0
  139. package/network/connection/Connection.js +157 -0
  140. package/network/connection/TCPAbridged.d.ts +20 -0
  141. package/network/connection/TCPAbridged.js +58 -0
  142. package/network/connection/TCPFull.d.ts +17 -0
  143. package/network/connection/TCPFull.js +61 -0
  144. package/network/connection/TCPMTProxy.d.ts +50 -0
  145. package/network/connection/TCPMTProxy.js +121 -0
  146. package/network/connection/TCPObfuscated.d.ts +19 -0
  147. package/network/connection/TCPObfuscated.js +78 -0
  148. package/network/connection/index.d.ts +4 -0
  149. package/network/connection/index.js +11 -0
  150. package/network/index.d.ts +11 -0
  151. package/network/index.js +23 -0
  152. package/package.json +69 -0
  153. package/requestIter.d.ts +24 -0
  154. package/requestIter.js +107 -0
  155. package/sessions/Abstract.d.ts +103 -0
  156. package/sessions/Abstract.js +6 -0
  157. package/sessions/CacheApiSession.d.ts +18 -0
  158. package/sessions/CacheApiSession.js +99 -0
  159. package/sessions/Memory.d.ts +38 -0
  160. package/sessions/Memory.js +272 -0
  161. package/sessions/StoreSession.d.ts +14 -0
  162. package/sessions/StoreSession.js +77 -0
  163. package/sessions/StringSession.d.ts +33 -0
  164. package/sessions/StringSession.js +116 -0
  165. package/sessions/index.d.ts +4 -0
  166. package/sessions/index.js +13 -0
  167. package/sessions/localStorage.d.ts +1 -0
  168. package/sessions/localStorage.js +4 -0
  169. package/tl/AllTLObjects.d.ts +3 -0
  170. package/tl/AllTLObjects.js +17 -0
  171. package/tl/MTProtoRequest.d.ts +19 -0
  172. package/tl/MTProtoRequest.js +38 -0
  173. package/tl/api.d.ts +31425 -0
  174. package/tl/api.js +507 -0
  175. package/tl/apiTl.d.ts +2 -0
  176. package/tl/apiTl.js +2142 -0
  177. package/tl/core/GZIPPacked.d.ts +16 -0
  178. package/tl/core/GZIPPacked.js +51 -0
  179. package/tl/core/MessageContainer.d.ts +12 -0
  180. package/tl/core/MessageContainer.js +42 -0
  181. package/tl/core/RPCResult.d.ts +15 -0
  182. package/tl/core/RPCResult.js +32 -0
  183. package/tl/core/TLMessage.d.ts +10 -0
  184. package/tl/core/TLMessage.js +14 -0
  185. package/tl/core/index.d.ts +6 -0
  186. package/tl/core/index.js +16 -0
  187. package/tl/custom/button.d.ts +25 -0
  188. package/tl/custom/button.js +78 -0
  189. package/tl/custom/chatGetter.d.ts +30 -0
  190. package/tl/custom/chatGetter.js +114 -0
  191. package/tl/custom/dialog.d.ts +31 -0
  192. package/tl/custom/dialog.js +40 -0
  193. package/tl/custom/draft.d.ts +22 -0
  194. package/tl/custom/draft.js +48 -0
  195. package/tl/custom/file.d.ts +22 -0
  196. package/tl/custom/file.js +68 -0
  197. package/tl/custom/forward.d.ts +16 -0
  198. package/tl/custom/forward.js +47 -0
  199. package/tl/custom/index.d.ts +1 -0
  200. package/tl/custom/index.js +5 -0
  201. package/tl/custom/inlineResult.d.ts +33 -0
  202. package/tl/custom/inlineResult.js +87 -0
  203. package/tl/custom/inlineResults.d.ts +21 -0
  204. package/tl/custom/inlineResults.js +26 -0
  205. package/tl/custom/message.d.ts +428 -0
  206. package/tl/custom/message.js +702 -0
  207. package/tl/custom/messageButton.d.ts +55 -0
  208. package/tl/custom/messageButton.js +152 -0
  209. package/tl/custom/senderGetter.d.ts +29 -0
  210. package/tl/custom/senderGetter.js +55 -0
  211. package/tl/generateModule.d.ts +1 -0
  212. package/tl/generateModule.js +17 -0
  213. package/tl/generationHelpers.d.ts +12 -0
  214. package/tl/generationHelpers.js +289 -0
  215. package/tl/index.d.ts +3 -0
  216. package/tl/index.js +10 -0
  217. package/tl/patched/index.d.ts +2 -0
  218. package/tl/patched/index.js +77 -0
  219. package/tl/schemaTl.d.ts +2 -0
  220. package/tl/schemaTl.js +64 -0
  221. package/tl/types-generator/generate.d.ts +1 -0
  222. package/tl/types-generator/generate.js +84 -0
  223. package/tl/types-generator/template.d.ts +6 -0
  224. package/tl/types-generator/template.js +257 -0
@@ -0,0 +1,428 @@
1
+ /// <reference types="node" />
2
+ import { SenderGetter } from "./senderGetter";
3
+ import type { Entity, EntityLike } from "../../define";
4
+ import { Api } from "../api";
5
+ import type { TelegramClient } from "../..";
6
+ import { Forward } from "./forward";
7
+ import { File } from "./file";
8
+ import { EditMessageParams, SendMessageParams, UpdatePinMessageParams } from "../../client/messages";
9
+ import { DownloadMediaInterface } from "../../client/downloads";
10
+ import bigInt, { BigInteger } from "big-integer";
11
+ import { MessageButton } from "./messageButton";
12
+ import { inspect } from "../../inspect";
13
+ interface MessageBaseInterface {
14
+ id: any;
15
+ peerId?: any;
16
+ date?: any;
17
+ out?: any;
18
+ mentioned?: any;
19
+ mediaUnread?: any;
20
+ silent?: any;
21
+ post?: any;
22
+ fromId?: any;
23
+ replyTo?: any;
24
+ message?: any;
25
+ fwdFrom?: any;
26
+ viaBotId?: any;
27
+ media?: any;
28
+ replyMarkup?: any;
29
+ entities?: any;
30
+ views?: any;
31
+ editDate?: any;
32
+ postAuthor?: any;
33
+ groupedId?: any;
34
+ fromScheduled?: any;
35
+ legacy?: any;
36
+ editHide?: any;
37
+ pinned?: any;
38
+ restrictionReason?: any;
39
+ forwards?: any;
40
+ ttlPeriod?: number;
41
+ replies?: any;
42
+ action?: any;
43
+ reactions?: any;
44
+ noforwards?: any;
45
+ _entities?: Map<string, Entity>;
46
+ }
47
+ /**
48
+ * Interface for clicking a message button.
49
+ * Calls `SendVote` with the specified poll option
50
+ * or `button.click <MessageButton.click>`
51
+ * on the specified button.
52
+ * Does nothing if the message is not a poll or has no buttons.
53
+ * @example
54
+ * ```ts
55
+ * # Click the first button
56
+ * await message.click(0)
57
+ *
58
+ * # Click some row/column
59
+ * await message.click(row, column)
60
+ *
61
+ * # Click by text
62
+ * await message.click({text:'👍'})
63
+ *
64
+ * # Click by data
65
+ * await message.click({data:'payload'})
66
+ *
67
+ * # Click on a button requesting a phone
68
+ * await message.click(0, {share_phone:true})
69
+ * ```
70
+ */
71
+ export interface ButtonClickParam {
72
+ /** Clicks the i'th button or poll option (starting from the index 0).
73
+ For multiple-choice polls, a list with the indices should be used.
74
+ Will ``raise IndexError`` if out of bounds. Example:
75
+
76
+ >>> message = ... # get the message somehow
77
+ >>> # Clicking the 3rd button
78
+ >>> # [button1] [button2]
79
+ >>> # [ button3 ]
80
+ >>> # [button4] [button5]
81
+ >>> await message.click(2) # index
82
+ . */
83
+ i?: number | number[];
84
+ /**
85
+ * Clicks the button at position (i, j), these being the
86
+ * indices for the (row, column) respectively. Example:
87
+
88
+ >>> # Clicking the 2nd button on the 1st row.
89
+ >>> # [button1] [button2]
90
+ >>> # [ button3 ]
91
+ >>> # [button4] [button5]
92
+ >>> await message.click(0, 1) # (row, column)
93
+
94
+ This is equivalent to ``message.buttons[0][1].click()``.
95
+ */
96
+ j?: number;
97
+ /** Clicks the first button or poll option with the text "text". This may
98
+ also be a callable, like a ``new RegExp('foo*').test``,
99
+ and the text will be passed to it.
100
+
101
+ If you need to select multiple options in a poll,
102
+ pass a list of indices to the ``i`` parameter.
103
+ */
104
+ text?: string | Function;
105
+ /** Clicks the first button or poll option for which the callable
106
+ returns `True`. The callable should accept a single
107
+ `MessageButton <messagebutton.MessageButton>`
108
+ or `PollAnswer <PollAnswer>` argument.
109
+ If you need to select multiple options in a poll,
110
+ pass a list of indices to the ``i`` parameter.
111
+ */
112
+ filter?: Function;
113
+ /** This argument overrides the rest and will not search any
114
+ buttons. Instead, it will directly send the request to
115
+ behave as if it clicked a button with said data. Note
116
+ that if the message does not have this data, it will
117
+ ``DATA_INVALID``.
118
+ */
119
+ data?: Buffer;
120
+ /** When clicking on a keyboard button requesting a phone number
121
+ (`KeyboardButtonRequestPhone`), this argument must be
122
+ explicitly set to avoid accidentally sharing the number.
123
+
124
+ It can be `true` to automatically share the current user's
125
+ phone, a string to share a specific phone number, or a contact
126
+ media to specify all details.
127
+
128
+ If the button is pressed without this, `new Error("Value Error")` is raised.
129
+ */
130
+ sharePhone?: boolean | string | Api.InputMediaContact;
131
+ /** When clicking on a keyboard button requesting a geo location
132
+ (`KeyboardButtonRequestGeoLocation`), this argument must
133
+ be explicitly set to avoid accidentally sharing the location.
134
+
135
+ It must be a `list` of `float` as ``(longitude, latitude)``,
136
+ or a :tl:`InputGeoPoint` instance to avoid accidentally using
137
+ the wrong roder.
138
+
139
+ If the button is pressed without this, `ValueError` is raised.
140
+ */
141
+ shareGeo?: [number, number] | Api.InputMediaGeoPoint;
142
+ /**When clicking certain buttons (such as BotFather's confirmation
143
+ button to transfer ownership), if your account has 2FA enabled,
144
+ you need to provide your account's password. Otherwise,
145
+ `PASSWORD_HASH_INVALID` is raised.
146
+ */
147
+ password?: string;
148
+ }
149
+ /**
150
+ * This custom class aggregates both {@link Api.Message} and {@link Api.MessageService} to ease accessing their members.<br/>
151
+ * <br/>
152
+ * Remember that this class implements {@link ChatGetter} and {@link SenderGetter}<br/>
153
+ * which means you have access to all their sender and chat properties and methods.
154
+ */
155
+ export declare class CustomMessage extends SenderGetter {
156
+ static CONSTRUCTOR_ID: number;
157
+ static SUBCLASS_OF_ID: number;
158
+ CONSTRUCTOR_ID: number;
159
+ SUBCLASS_OF_ID: number;
160
+ /**
161
+ * Whether the message is outgoing (i.e. you sent it from
162
+ * another session) or incoming (i.e. someone else sent it).
163
+ * <br/>
164
+ * Note that messages in your own chat are always incoming,
165
+ * but this member will be `true` if you send a message
166
+ * to your own chat. Messages you forward to your chat are
167
+ * **not** considered outgoing, just like official clients
168
+ * display them.
169
+ */
170
+ out?: boolean;
171
+ /**
172
+ * Whether you were mentioned in this message or not.
173
+ * Note that replies to your own messages also count as mentions.
174
+ */
175
+ mentioned?: boolean;
176
+ /** Whether you have read the media in this message
177
+ * or not, e.g. listened to the voice note media.
178
+ */
179
+ mediaUnread?: boolean;
180
+ /**
181
+ * Whether the message should notify people with sound or not.
182
+ * Previously used in channels, but since 9 August 2019, it can
183
+ * also be {@link https://telegram.org/blog/silent-messages-slow-mode|used in private chats}
184
+ */
185
+ silent?: boolean;
186
+ /**
187
+ * Whether this message is a post in a broadcast
188
+ * channel or not.
189
+ */
190
+ post?: boolean;
191
+ /**
192
+ * Whether this message was originated from a previously-scheduled
193
+ * message or not.
194
+ */
195
+ fromScheduled?: boolean;
196
+ /**
197
+ * Whether this is a legacy message or not.
198
+ */
199
+ legacy?: boolean;
200
+ /**
201
+ * Whether the edited mark of this message is edited
202
+ * should be hidden (e.g. in GUI clients) or shown.
203
+ */
204
+ editHide?: boolean;
205
+ /**
206
+ * Whether this message is currently pinned or not.
207
+ */
208
+ pinned?: boolean;
209
+ /**
210
+ * The ID of this message. This field is *always* present.
211
+ * Any other member is optional and may be `undefined`.
212
+ */
213
+ id: number;
214
+ /**
215
+ * The peer who sent this message, which is either
216
+ * {@link Api.PeerUser}, {@link Api.PeerChat} or {@link Api.PeerChannel}.
217
+ * This value will be `undefined` for anonymous messages.
218
+ */
219
+ fromId?: Api.TypePeer;
220
+ /**
221
+ * The peer to which this message was sent, which is either
222
+ * {@link Api.PeerUser}, {@link Api.PeerChat} or {@link Api.PeerChannel}.
223
+ * This will always be present except for empty messages.
224
+ */
225
+ peerId: Api.TypePeer;
226
+ /**
227
+ * The original forward header if this message is a forward.
228
+ * You should probably use the `forward` property instead.
229
+ */
230
+ fwdFrom?: Api.TypeMessageFwdHeader;
231
+ /**
232
+ * The ID of the bot used to send this message
233
+ * through its inline mode (e.g. "via @like").
234
+ */
235
+ viaBotId?: bigInt.BigInteger;
236
+ /**
237
+ * The original reply header if this message is replying to another.
238
+ */
239
+ replyTo?: Api.MessageReplyHeader;
240
+ /**
241
+ * The timestamp indicating when this message was sent.
242
+ * This will always be present except for empty messages.
243
+ */
244
+ date: number;
245
+ /**
246
+ * The string text of the message for {@link Api.Message} instances,
247
+ * which will be `undefined` for other types of messages.
248
+ */
249
+ message: string;
250
+ /**
251
+ * The media sent with this message if any (such as photos, videos, documents, gifs, stickers, etc.).
252
+ *
253
+ * You may want to access the `photo`, `document` etc. properties instead.
254
+ *
255
+ * If the media was not present or it was {@link Api.MessageMediaEmpty},
256
+ * this member will instead be `undefined` for convenience.
257
+ */
258
+ media?: Api.TypeMessageMedia;
259
+ /**
260
+ * The reply markup for this message (which was sent either via a bot or by a bot).
261
+ * You probably want to access `buttons` instead.
262
+ */
263
+ replyMarkup?: Api.TypeReplyMarkup;
264
+ /**
265
+ * The list of markup entities in this message,
266
+ * such as bold, italics, code, hyperlinks, etc.
267
+ */
268
+ entities?: Api.TypeMessageEntity[];
269
+ /**
270
+ * The number of views this message from a broadcast channel has.
271
+ * This is also present in forwards.
272
+ */
273
+ views?: number;
274
+ /**
275
+ * The number of times this message has been forwarded.
276
+ */
277
+ forwards?: number;
278
+ /**
279
+ * The number of times another message has replied to this message.
280
+ */
281
+ replies?: Api.TypeMessageReplies;
282
+ /**
283
+ * The date when this message was last edited.
284
+ */
285
+ editDate?: number;
286
+ /**
287
+ * The display name of the message sender to show in messages sent to broadcast channels.
288
+ */
289
+ postAuthor?: string;
290
+ /**
291
+ * If this message belongs to a group of messages (photo albums or video albums),
292
+ * all of them will have the same value here.
293
+ */
294
+ groupedId?: BigInteger;
295
+ /**
296
+ * An optional list of reasons why this message was restricted.
297
+ * If the list is `undefined`, this message has not been restricted.
298
+ */
299
+ restrictionReason?: Api.TypeRestrictionReason[];
300
+ /**
301
+ * The message action object of the message for {@link Api.MessageService}
302
+ * instances, which will be `undefined` for other types of messages.
303
+ */
304
+ action: Api.TypeMessageAction;
305
+ /**
306
+ * The Time To Live period configured for this message.
307
+ * The message should be erased from wherever it's stored (memory, a
308
+ * local database, etc.) when this threshold is met.
309
+ */
310
+ ttlPeriod?: number;
311
+ reactions?: Api.MessageReactions;
312
+ noforwards?: boolean;
313
+ /** @hidden */
314
+ _actionEntities?: any;
315
+ /** @hidden */
316
+ _client?: TelegramClient;
317
+ /** @hidden */
318
+ _text?: string;
319
+ /** @hidden */
320
+ _file?: File;
321
+ /** @hidden */
322
+ _replyMessage?: Api.Message;
323
+ /** @hidden */
324
+ _buttons?: MessageButton[][];
325
+ /** @hidden */
326
+ _buttonsFlat?: MessageButton[];
327
+ /** @hidden */
328
+ _buttonsCount?: number;
329
+ /** @hidden */
330
+ _viaBot?: EntityLike;
331
+ /** @hidden */
332
+ _viaInputBot?: EntityLike;
333
+ /** @hidden */
334
+ _inputSender?: any;
335
+ /** @hidden */
336
+ _forward?: Forward;
337
+ /** @hidden */
338
+ _sender?: any;
339
+ /** @hidden */
340
+ _entities?: Map<string, Entity>;
341
+ /** @hidden */
342
+ getBytes(): Buffer;
343
+ originalArgs: any;
344
+ patternMatch?: RegExpMatchArray;
345
+ [inspect.custom](): {
346
+ [key: string]: any;
347
+ };
348
+ init({ id, peerId, date, out, mentioned, mediaUnread, silent, post, fromId, replyTo, message, fwdFrom, viaBotId, media, replyMarkup, entities, views, editDate, postAuthor, groupedId, fromScheduled, legacy, editHide, pinned, restrictionReason, forwards, replies, action, reactions, noforwards, ttlPeriod, _entities, }: MessageBaseInterface): void;
349
+ constructor(args: MessageBaseInterface);
350
+ _finishInit(client: TelegramClient, entities: Map<string, Entity>, inputChat?: EntityLike): void;
351
+ get client(): TelegramClient | undefined;
352
+ get text(): string;
353
+ set text(value: string);
354
+ get rawText(): string;
355
+ /**
356
+ * @param {string} value
357
+ */
358
+ set rawText(value: string);
359
+ get isReply(): boolean;
360
+ get forward(): Forward | undefined;
361
+ _refetchSender(): Promise<void>;
362
+ /**
363
+ * Re-fetches this message to reload the sender and chat entities,
364
+ * along with their input versions.
365
+ * @private
366
+ */
367
+ _reloadMessage(): Promise<void>;
368
+ /**
369
+ * Returns a list of lists of `MessageButton <MessageButton>`, if any.
370
+ * Otherwise, it returns `undefined`.
371
+ */
372
+ get buttons(): MessageButton[][] | undefined;
373
+ /**
374
+ * Returns `buttons` when that property fails (this is rarely needed).
375
+ */
376
+ getButtons(): Promise<MessageButton[][] | undefined>;
377
+ get buttonCount(): number;
378
+ get file(): File | undefined;
379
+ get photo(): Api.TypePhoto | undefined;
380
+ get document(): Api.Document | undefined;
381
+ get webPreview(): Api.WebPage | undefined;
382
+ get audio(): Api.Document | undefined;
383
+ get voice(): Api.Document | undefined;
384
+ get video(): Api.Document | undefined;
385
+ get videoNote(): Api.Document | undefined;
386
+ get gif(): Api.Document | undefined;
387
+ get sticker(): Api.Document | undefined;
388
+ get contact(): Api.MessageMediaContact | undefined;
389
+ get game(): Api.Game | undefined;
390
+ get geo(): Api.TypeGeoPoint | undefined;
391
+ get invoice(): Api.MessageMediaInvoice | undefined;
392
+ get poll(): Api.MessageMediaPoll | undefined;
393
+ get venue(): Api.MessageMediaVenue | undefined;
394
+ get dice(): Api.MessageMediaDice | undefined;
395
+ get actionEntities(): any;
396
+ get viaBot(): EntityLike | undefined;
397
+ get viaInputBot(): EntityLike | undefined;
398
+ get replyToMsgId(): number | undefined;
399
+ get toId(): Api.TypePeer;
400
+ getEntitiesText(cls?: Function): any;
401
+ getReplyMessage(): Promise<Api.Message | undefined>;
402
+ respond(params: SendMessageParams): Promise<Api.Message | undefined>;
403
+ reply(params: SendMessageParams): Promise<Api.Message | undefined>;
404
+ forwardTo(entity: EntityLike): Promise<Api.Message[] | undefined>;
405
+ edit(params: Omit<EditMessageParams, "message">): Promise<Api.Message | undefined>;
406
+ delete({ revoke }?: {
407
+ revoke: boolean;
408
+ }): Promise<Api.messages.AffectedMessages[] | undefined>;
409
+ pin(params?: UpdatePinMessageParams): Promise<Api.Message | undefined>;
410
+ unpin(params?: UpdatePinMessageParams): Promise<undefined>;
411
+ downloadMedia(params?: DownloadMediaInterface): Promise<string | Buffer | undefined>;
412
+ markAsRead(): Promise<boolean | undefined>;
413
+ click({ i, j, text, filter, data, sharePhone, shareGeo, password, }: ButtonClickParam): Promise<string | Api.Message | Api.messages.BotCallbackAnswer | Api.TypeUpdates | null | undefined>;
414
+ /**
415
+ * Helper methods to set the buttons given the input sender and chat.
416
+ */
417
+ _setButtons(chat: EntityLike, bot?: EntityLike): void;
418
+ /**
419
+ *Returns the input peer of the bot that's needed for the reply markup.
420
+
421
+ This is necessary for `KeyboardButtonSwitchInline` since we need
422
+ to know what bot we want to start. Raises ``Error`` if the bot
423
+ cannot be found but is needed. Returns `None` if it's not needed.
424
+ */
425
+ _neededMarkupBot(): any;
426
+ _documentByAttribute(kind: Function, condition?: Function): Api.Document | undefined;
427
+ }
428
+ export {};