@telegram.ts/types 1.3.2 → 1.4.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telegram.ts/types",
3
- "version": "1.3.2",
3
+ "version": "1.4.0",
4
4
  "description": "@telegram.ts/types: Comprehensive Type Declarations for Telegram Bot API with telegramsjs",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
@@ -750,6 +750,12 @@ export type ApiMethods<F> = {
750
750
  can_edit_messages?: boolean;
751
751
  /** Pass True if the administrator can delete messages of other users */
752
752
  can_delete_messages?: boolean;
753
+ /** Pass True if the administrator can post stories in the channel; channels only */
754
+ can_post_stories?: boolean;
755
+ /** Pass True if the administrator can edit stories posted by other users; channels only */
756
+ can_edit_stories?: boolean;
757
+ /** Pass True if the administrator can delete stories posted by other users; channels only */
758
+ can_delete_stories?: boolean;
753
759
  /** Pass True if the administrator can manage video chats */
754
760
  can_manage_video_chats?: boolean;
755
761
  /** Pass True if the administrator can restrict, ban or unban chat members */
@@ -1027,6 +1033,11 @@ export type ApiMethods<F> = {
1027
1033
  /** Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) */
1028
1034
  chat_id: number | string;
1029
1035
  }): true;
1036
+ /** Use this method to clear the list of pinned messages in a General forum topic. The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup. Returns True on success. */
1037
+ unpinAllGeneralForumTopicMessages(args: {
1038
+ /** Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) */
1039
+ chat_id: number | string;
1040
+ }): true;
1030
1041
  /** Use this method to send answers to callback queries sent from inline keyboards. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert. On success, True is returned.
1031
1042
 
1032
1043
  Alternatively, the user can be redirected to the specified Game URL. For this option to work, you must first create a game for your bot via @BotFather and accept the terms. Otherwise, you may use links like t.me/your_bot?start=XXXX that open your bot with a parameter. */
@@ -139,6 +139,8 @@ export interface InlineQueryResultGif {
139
139
  caption?: string;
140
140
  /** Mode for parsing entities in the caption. See formatting options for more details. */
141
141
  parse_mode?: ParseMode;
142
+ /** List of special entities that appear in the caption, which can be specified instead of parse_mode */
143
+ caption_entities?: MessageEntity[];
142
144
  /** Inline keyboard attached to the message */
143
145
  reply_markup?: InlineKeyboardMarkup;
144
146
  /** Content of the message to be sent instead of the GIF animation */
@@ -168,6 +170,8 @@ export interface InlineQueryResultMpeg4Gif {
168
170
  caption?: string;
169
171
  /** Mode for parsing entities in the caption. See formatting options for more details. */
170
172
  parse_mode?: ParseMode;
173
+ /** List of special entities that appear in the caption, which can be specified instead of parse_mode */
174
+ caption_entities?: MessageEntity[];
171
175
  /** Inline keyboard attached to the message */
172
176
  reply_markup?: InlineKeyboardMarkup;
173
177
  /** Content of the message to be sent instead of the video animation */
@@ -251,6 +255,8 @@ export interface InlineQueryResultVoice {
251
255
  caption?: string;
252
256
  /** Mode for parsing entities in the voice message caption. See formatting options for more details. */
253
257
  parse_mode?: ParseMode;
258
+ /** List of special entities that appear in the caption, which can be specified instead of parse_mode */
259
+ caption_entities?: MessageEntity[];
254
260
  /** Recording duration in seconds */
255
261
  voice_duration?: number;
256
262
  /** Inline keyboard attached to the message */
@@ -309,9 +315,9 @@ export interface InlineQueryResultLocation {
309
315
  horizontal_accuracy?: number;
310
316
  /** Period in seconds for which the location can be updated, should be between 60 and 86400. */
311
317
  live_period?: number;
312
- /** The direction in which user is moving, in degrees; 1-360. For active live locations only. */
318
+ /** For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified. */
313
319
  heading?: number;
314
- /** The maximum distance for proximity alerts about approaching another chat member, in meters. For sent live locations only. */
320
+ /** For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified. */
315
321
  proximity_alert_radius?: number;
316
322
  /** Inline keyboard attached to the message */
317
323
  reply_markup?: InlineKeyboardMarkup;
@@ -436,6 +442,8 @@ export interface InlineQueryResultCachedGif {
436
442
  caption?: string;
437
443
  /** Mode for parsing entities in the caption. See formatting options for more details. */
438
444
  parse_mode?: ParseMode;
445
+ /** List of special entities that appear in the caption, which can be specified instead of parse_mode */
446
+ caption_entities?: MessageEntity[];
439
447
  /** Inline keyboard attached to the message */
440
448
  reply_markup?: InlineKeyboardMarkup;
441
449
  /** Content of the message to be sent instead of the GIF animation */
@@ -455,6 +463,8 @@ export interface InlineQueryResultCachedMpeg4Gif {
455
463
  caption?: string;
456
464
  /** Mode for parsing entities in the caption. See formatting options for more details. */
457
465
  parse_mode?: ParseMode;
466
+ /** List of special entities that appear in the caption, which can be specified instead of parse_mode */
467
+ caption_entities?: MessageEntity[];
458
468
  /** Inline keyboard attached to the message */
459
469
  reply_markup?: InlineKeyboardMarkup;
460
470
  /** Content of the message to be sent instead of the video animation */
@@ -540,6 +550,8 @@ export interface InlineQueryResultCachedVoice {
540
550
  caption?: string;
541
551
  /** Mode for parsing entities in the voice message caption. See formatting options for more details. */
542
552
  parse_mode?: ParseMode;
553
+ /** List of special entities that appear in the caption, which can be specified instead of parse_mode */
554
+ caption_entities?: MessageEntity[];
543
555
  /** Inline keyboard attached to the message */
544
556
  reply_markup?: InlineKeyboardMarkup;
545
557
  /** Content of the message to be sent instead of the voice message */
@@ -136,6 +136,8 @@ export declare namespace Chat {
136
136
  GetChat {
137
137
  /** Custom emoji identifier of emoji status of the other party in a private chat. Returned only in getChat. */
138
138
  emoji_status_custom_emoji_id?: string;
139
+ /** Expiration date of the emoji status of the other party in a private chat, if any. Returned only in getChat. */
140
+ emoji_status_expiration_date?: number;
139
141
  /** Bio of the other party in a private chat. Returned only in getChat. */
140
142
  bio?: string;
141
143
  /** True, if privacy settings of the other party in the private chat allows to use tg://user?id=<user_id> links only in chats with the user. Returned only in getChat. */
@@ -246,6 +248,12 @@ export interface ChatAdministratorRights {
246
248
  can_edit_messages?: boolean;
247
249
  /** True, if the user is allowed to pin messages; groups and supergroups only */
248
250
  can_pin_messages?: boolean;
251
+ /** True, if the administrator can post stories in the channel; channels only */
252
+ can_post_stories?: boolean;
253
+ /** True, if the administrator can edit stories posted by other users; channels only */
254
+ can_edit_stories?: boolean;
255
+ /** True, if the administrator can delete stories posted by other users; channels only */
256
+ can_delete_stories?: boolean;
249
257
  /** True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only */
250
258
  can_manage_topics?: boolean;
251
259
  }
@@ -304,6 +312,12 @@ export interface ChatMemberAdministrator {
304
312
  can_edit_messages?: boolean;
305
313
  /** True, if the user is allowed to pin messages; groups and supergroups only */
306
314
  can_pin_messages?: boolean;
315
+ /** True, if the administrator can post stories in the channel; channels only */
316
+ can_post_stories?: boolean;
317
+ /** True, if the administrator can edit stories posted by other users; channels only */
318
+ can_edit_stories?: boolean;
319
+ /** True, if the administrator can delete stories posted by other users; channels only */
320
+ can_delete_stories?: boolean;
307
321
  /** True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only */
308
322
  can_manage_topics?: boolean;
309
323
  /** Custom title for this user */
@@ -66,6 +66,7 @@ export declare namespace Message {
66
66
  export type AnimationMessage = DocumentMessage & MsgWith<"animation">;
67
67
  export type PhotoMessage = MediaMessage & MsgWith<"photo">;
68
68
  export type StickerMessage = CommonMessage & MsgWith<"sticker">;
69
+ export type StoryMessage = CommonMessage & MsgWith<"story">;
69
70
  export type VideoMessage = MediaMessage & MsgWith<"video">;
70
71
  export type VideoNoteMessage = CommonMessage & MsgWith<"video_note">;
71
72
  export type VoiceMessage = CaptionableMessage & MsgWith<"voice">;
@@ -175,6 +176,8 @@ export interface Message extends Message.MediaMessage {
175
176
  new_chat_title?: string;
176
177
  /** A chat photo was change to this value */
177
178
  new_chat_photo?: PhotoSize[];
179
+ /** Message is a forwarded story */
180
+ story?: Story;
178
181
  /** Service message: the chat photo was deleted */
179
182
  delete_chat_photo?: true;
180
183
  /** Service message: the group has been created */
@@ -540,9 +543,11 @@ export interface PollOption {
540
543
  export interface PollAnswer {
541
544
  /** Unique poll identifier */
542
545
  poll_id: string;
543
- /** The user, who changed the answer to the poll */
544
- user: User;
545
- /** 0-based identifiers of answer options, chosen by the user. May be empty if the user retracted their vote. */
546
+ /** The chat that changed the answer to the poll, if the voter is anonymous */
547
+ voter_chat?: Chat;
548
+ /** The user that changed the answer to the poll, if the voter isn't anonymous */
549
+ user?: User;
550
+ /** 0-based identifiers of chosen answer options. May be empty if the vote was retracted. */
546
551
  option_ids: number[];
547
552
  }
548
553
  /** This object contains information about a poll. */
@@ -606,6 +611,8 @@ export interface Venue {
606
611
  /** Google Places type of the venue. (See supported types.) */
607
612
  google_place_type?: string;
608
613
  }
614
+ /** This object represents a message about a forwarded story in the chat. Currently holds no information. */
615
+ export interface Story {}
609
616
  /** This object represents the content of a service message, sent whenever a user in the chat triggers a proximity alert set by another user. */
610
617
  export interface ProximityAlertTriggered {
611
618
  /** User that triggered the alert */
@@ -660,8 +667,12 @@ export interface ChatShared {
660
667
  }
661
668
  /** This object represents a service message about a user allowing a bot to write messages after adding the bot to the attachment menu or launching a Web App from a link. */
662
669
  export interface WriteAccessAllowed {
670
+ /** True, if the access was granted after the user accepted an explicit request from a Web App sent by the method requestWriteAccess */
671
+ from_request?: boolean;
663
672
  /** Name of the Web App which was launched from a link */
664
673
  web_app_name?: string;
674
+ /** True, if the access was granted when the bot was added to the attachment or side menu */
675
+ from_attachment_menu?: boolean;
665
676
  }
666
677
  /** This object represents a service message about a video chat scheduled in the chat. */
667
678
  export interface VideoChatScheduled {