@grammyjs/types 2.4.6 → 2.5.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.
package/message.d.ts CHANGED
@@ -212,13 +212,13 @@ export interface MessageId {
212
212
  message_id: number;
213
213
  }
214
214
 
215
- /** The Bot API supports basic formatting for messages. You can use bold, italic, underlined and strikethrough text, as well as inline links and pre-formatted code in your bots' messages. Telegram clients will render them accordingly. You can use either markdown-style or HTML-style formatting.
215
+ /** The Bot API supports basic formatting for messages. You can use bold, italic, underlined, strikethrough, and spoiler text, as well as inline links and pre-formatted code in your bots' messages. Telegram clients will render them accordingly. You can use either markdown-style or HTML-style formatting.
216
216
 
217
217
  Note that Telegram clients will display an **alert** to the user before opening an inline link ('Open this link?' together with the full URL).
218
218
 
219
219
  Message entities can be nested, providing following restrictions are met:
220
220
  - If two entities have common characters then one of them is fully contained inside another.
221
- - bold, italic, underline and strikethrough entities can contain and to be contained in any other entities, except pre and code.
221
+ - bold, italic, underline, strikethrough, and spoiler entities can contain and can be part of any other entities, except pre and code.
222
222
  - All other entities can't contain each other.
223
223
 
224
224
  Links `tg://user?id=<user_id>` can be used to mention a user by their ID without using a username. Please note:
@@ -234,7 +234,8 @@ To use this mode, pass *MarkdownV2* in the *parse_mode* field. Use the following
234
234
  _italic \*text_
235
235
  __underline__
236
236
  ~strikethrough~
237
- *bold _italic bold ~italic bold strikethrough~ __underline italic bold___ bold*
237
+ ||spoiler||
238
+ *bold _italic bold ~italic bold strikethrough ||italic bold strikethrough spoiler||~ __underline italic bold___ bold*
238
239
  [inline URL](http://www.example.com/)
239
240
  [inline mention of a user](tg://user?id=123456789)
240
241
  `inline fixed-width code`
@@ -261,7 +262,8 @@ To use this mode, pass *HTML* in the *parse_mode* field. The following tags are
261
262
  <i>italic</i>, <em>italic</em>
262
263
  <u>underline</u>, <ins>underline</ins>
263
264
  <s>strikethrough</s>, <strike>strikethrough</strike>, <del>strikethrough</del>
264
- <b>bold <i>italic bold <s>italic bold strikethrough</s> <u>underline italic bold</u></i> bold</b>
265
+ <span class="tg-spoiler">spoiler</span>
266
+ <b>bold <i>italic bold <s>italic bold strikethrough <span class="tg-spoiler">italic bold strikethrough spoiler</span></s> <u>underline italic bold</u></i> bold</b>
265
267
  <a href="http://www.example.com/">inline URL</a>
266
268
  <a href="tg://user?id=123456789">inline mention of a user</a>
267
269
  <code>inline fixed-width code</code>
@@ -303,7 +305,7 @@ export type ParseMode = "Markdown" | "MarkdownV2" | "HTML";
303
305
 
304
306
  export namespace MessageEntity {
305
307
  interface AbstractMessageEntity {
306
- /** Type of the entity. Can be “mention” (@username), “hashtag” (#hashtag), “cashtag” ($USD), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” (do-not-reply@telegram.org), “phone_number” (+1-212-555-0123), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames) */
308
+ /** Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag), “cashtag” ($USD), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” (do-not-reply@telegram.org), “phone_number” (+1-212-555-0123), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames) */
307
309
  type: string;
308
310
  /** Offset in UTF-16 code units to the start of the entity */
309
311
  offset: number;
@@ -323,6 +325,7 @@ export namespace MessageEntity {
323
325
  | "italic"
324
326
  | "underline"
325
327
  | "strikethrough"
328
+ | "spoiler"
326
329
  | "code";
327
330
  }
328
331
  export interface TextLinkMessageEntity extends AbstractMessageEntity {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grammyjs/types",
3
- "version": "2.4.6",
3
+ "version": "2.5.0",
4
4
  "description": "Telegram Bot API type declarations for grammY",
5
5
  "main": "index.js",
6
6
  "repository": {
package/proxied.d.ts CHANGED
@@ -124,6 +124,8 @@ export interface InputFileProxy<F> {
124
124
  disable_web_page_preview?: boolean;
125
125
  /** Sends the message silently. Users will receive a notification with no sound. */
126
126
  disable_notification?: boolean;
127
+ /** Protects the contents of sent messages from forwarding and saving */
128
+ protect_content?: boolean;
127
129
  /** If the message is a reply, ID of the original message */
128
130
  reply_to_message_id?: number;
129
131
  /** Pass True, if the message should be sent even if the specified replied-to message is not found */
@@ -144,6 +146,8 @@ export interface InputFileProxy<F> {
144
146
  from_chat_id: number | string;
145
147
  /** Sends the message silently. Users will receive a notification with no sound. */
146
148
  disable_notification?: boolean;
149
+ /** Protects the contents of the forwarded message from forwarding and saving */
150
+ protect_content?: boolean;
147
151
  /** Message identifier in the chat specified in from_chat_id */
148
152
  message_id: number;
149
153
  }): Message;
@@ -164,6 +168,8 @@ export interface InputFileProxy<F> {
164
168
  caption_entities?: MessageEntity[];
165
169
  /** Sends the message silently. Users will receive a notification with no sound. */
166
170
  disable_notification?: boolean;
171
+ /** Protects the contents of the sent message from forwarding and saving */
172
+ protect_content?: boolean;
167
173
  /** If the message is a reply, ID of the original message */
168
174
  reply_to_message_id?: number;
169
175
  /** Pass True, if the message should be sent even if the specified replied-to message is not found */
@@ -190,6 +196,8 @@ export interface InputFileProxy<F> {
190
196
  caption_entities?: MessageEntity[];
191
197
  /** Sends the message silently. Users will receive a notification with no sound. */
192
198
  disable_notification?: boolean;
199
+ /** Protects the contents of the sent message from forwarding and saving */
200
+ protect_content?: boolean;
193
201
  /** If the message is a reply, ID of the original message */
194
202
  reply_to_message_id?: number;
195
203
  /** Pass True, if the message should be sent even if the specified replied-to message is not found */
@@ -226,6 +234,8 @@ export interface InputFileProxy<F> {
226
234
  thumb?: F;
227
235
  /** Sends the message silently. Users will receive a notification with no sound. */
228
236
  disable_notification?: boolean;
237
+ /** Protects the contents of the sent message from forwarding and saving */
238
+ protect_content?: boolean;
229
239
  /** If the message is a reply, ID of the original message */
230
240
  reply_to_message_id?: number;
231
241
  /** Pass True, if the message should be sent even if the specified replied-to message is not found */
@@ -256,6 +266,8 @@ export interface InputFileProxy<F> {
256
266
  disable_content_type_detection?: boolean;
257
267
  /** Sends the message silently. Users will receive a notification with no sound. */
258
268
  disable_notification?: boolean;
269
+ /** Protects the contents of the sent message from forwarding and saving */
270
+ protect_content?: boolean;
259
271
  /** If the message is a reply, ID of the original message */
260
272
  reply_to_message_id?: number;
261
273
  /** Pass True, if the message should be sent even if the specified replied-to message is not found */
@@ -292,6 +304,8 @@ export interface InputFileProxy<F> {
292
304
  supports_streaming?: boolean;
293
305
  /** Sends the message silently. Users will receive a notification with no sound. */
294
306
  disable_notification?: boolean;
307
+ /** Protects the contents of the sent message from forwarding and saving */
308
+ protect_content?: boolean;
295
309
  /** If the message is a reply, ID of the original message */
296
310
  reply_to_message_id?: number;
297
311
  /** Pass True, if the message should be sent even if the specified replied-to message is not found */
@@ -326,6 +340,8 @@ export interface InputFileProxy<F> {
326
340
  caption_entities?: MessageEntity[];
327
341
  /** Sends the message silently. Users will receive a notification with no sound. */
328
342
  disable_notification?: boolean;
343
+ /** Protects the contents of the sent message from forwarding and saving */
344
+ protect_content?: boolean;
329
345
  /** If the message is a reply, ID of the original message */
330
346
  reply_to_message_id?: number;
331
347
  /** Pass True, if the message should be sent even if the specified replied-to message is not found */
@@ -354,6 +370,8 @@ export interface InputFileProxy<F> {
354
370
  duration?: number;
355
371
  /** Sends the message silently. Users will receive a notification with no sound. */
356
372
  disable_notification?: boolean;
373
+ /** Protects the contents of the sent message from forwarding and saving */
374
+ protect_content?: boolean;
357
375
  /** If the message is a reply, ID of the original message */
358
376
  reply_to_message_id?: number;
359
377
  /** Pass True, if the message should be sent even if the specified replied-to message is not found */
@@ -381,6 +399,8 @@ export interface InputFileProxy<F> {
381
399
  thumb?: F;
382
400
  /** Sends the message silently. Users will receive a notification with no sound. */
383
401
  disable_notification?: boolean;
402
+ /** Protects the contents of the sent message from forwarding and saving */
403
+ protect_content?: boolean;
384
404
  /** If the message is a reply, ID of the original message */
385
405
  reply_to_message_id?: number;
386
406
  /** Pass True, if the message should be sent even if the specified replied-to message is not found */
@@ -406,6 +426,8 @@ export interface InputFileProxy<F> {
406
426
  >;
407
427
  /** Sends the messages silently. Users will receive a notification with no sound. */
408
428
  disable_notification?: boolean;
429
+ /** Protects the contents of the sent messages from forwarding and saving */
430
+ protect_content?: boolean;
409
431
  /** If messages are a reply, ID of the original message */
410
432
  reply_to_message_id?: number;
411
433
  /** Pass True, if the message should be sent even if the specified replied-to message is not found */
@@ -435,6 +457,8 @@ export interface InputFileProxy<F> {
435
457
  proximity_alert_radius?: number;
436
458
  /** Sends the message silently. Users will receive a notification with no sound. */
437
459
  disable_notification?: boolean;
460
+ /** Protects the contents of the sent message from forwarding and saving */
461
+ protect_content?: boolean;
438
462
  /** If the message is a reply, ID of the original message */
439
463
  reply_to_message_id?: number;
440
464
  /** Pass True, if the message should be sent even if the specified replied-to message is not found */
@@ -503,6 +527,8 @@ export interface InputFileProxy<F> {
503
527
  google_place_type?: string;
504
528
  /** Sends the message silently. Users will receive a notification with no sound. */
505
529
  disable_notification?: boolean;
530
+ /** Protects the contents of the sent message from forwarding and saving */
531
+ protect_content?: boolean;
506
532
  /** If the message is a reply, ID of the original message */
507
533
  reply_to_message_id?: number;
508
534
  /** Pass True, if the message should be sent even if the specified replied-to message is not found */
@@ -529,6 +555,8 @@ export interface InputFileProxy<F> {
529
555
  vcard?: string;
530
556
  /** Sends the message silently. Users will receive a notification with no sound. */
531
557
  disable_notification?: boolean;
558
+ /** Protects the contents of the sent message from forwarding and saving */
559
+ protect_content?: boolean;
532
560
  /** If the message is a reply, ID of the original message */
533
561
  reply_to_message_id?: number;
534
562
  /** Pass True, if the message should be sent even if the specified replied-to message is not found */
@@ -571,6 +599,8 @@ export interface InputFileProxy<F> {
571
599
  is_closed?: boolean;
572
600
  /** Sends the message silently. Users will receive a notification with no sound. */
573
601
  disable_notification?: boolean;
602
+ /** Protects the contents of the sent message from forwarding and saving */
603
+ protect_content?: boolean;
574
604
  /** If the message is a reply, ID of the original message */
575
605
  reply_to_message_id?: number;
576
606
  /** Pass True, if the message should be sent even if the specified replied-to message is not found */
@@ -591,6 +621,8 @@ export interface InputFileProxy<F> {
591
621
  emoji?: string;
592
622
  /** Sends the message silently. Users will receive a notification with no sound. */
593
623
  disable_notification?: boolean;
624
+ /** Protects the contents of the sent message from forwarding */
625
+ protect_content?: boolean;
594
626
  /** If the message is a reply, ID of the original message */
595
627
  reply_to_message_id?: number;
596
628
  /** Pass True, if the message should be sent even if the specified replied-to message is not found */
@@ -1060,6 +1092,8 @@ export interface InputFileProxy<F> {
1060
1092
  sticker: F | string;
1061
1093
  /** Sends the message silently. Users will receive a notification with no sound. */
1062
1094
  disable_notification?: boolean;
1095
+ /** Protects the contents of the sent message from forwarding and saving */
1096
+ protect_content?: boolean;
1063
1097
  /** If the message is a reply, ID of the original message */
1064
1098
  reply_to_message_id?: number;
1065
1099
  /** Pass True, if the message should be sent even if the specified replied-to message is not found */
@@ -1215,6 +1249,8 @@ export interface InputFileProxy<F> {
1215
1249
  is_flexible?: boolean;
1216
1250
  /** Sends the message silently. Users will receive a notification with no sound. */
1217
1251
  disable_notification?: boolean;
1252
+ /** Protects the contents of the sent message from forwarding and saving */
1253
+ protect_content?: boolean;
1218
1254
  /** If the message is a reply, ID of the original message */
1219
1255
  reply_to_message_id?: number;
1220
1256
  /** Pass True, if the message should be sent even if the specified replied-to message is not found */
@@ -1263,6 +1299,8 @@ export interface InputFileProxy<F> {
1263
1299
  game_short_name: string;
1264
1300
  /** Sends the message silently. Users will receive a notification with no sound. */
1265
1301
  disable_notification?: boolean;
1302
+ /** Protects the contents of the sent message from forwarding and saving */
1303
+ protect_content?: boolean;
1266
1304
  /** If the message is a reply, ID of the original message */
1267
1305
  reply_to_message_id?: number;
1268
1306
  /** Pass True, if the message should be sent even if the specified replied-to message is not found */