@grammyjs/types 3.1.3 → 3.2.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/manage.d.ts CHANGED
@@ -130,6 +130,8 @@ export declare namespace Chat {
130
130
  interface PrivateGetChat extends PrivateChat, NonGroupGetChat, GetChat {
131
131
  /** Custom emoji identifier of emoji status of the other party in a private chat. Returned only in getChat. */
132
132
  emoji_status_custom_emoji_id?: string;
133
+ /** Expiration date of the emoji status of the other party in a private chat, if any. Returned only in getChat. */
134
+ emoji_status_expiration_date?: number;
133
135
  /** Bio of the other party in a private chat. Returned only in getChat. */
134
136
  bio?: string;
135
137
  /** 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. */
package/markup.d.ts CHANGED
@@ -27,9 +27,7 @@ export declare namespace InlineKeyboardButton {
27
27
  login_url: LoginUrl;
28
28
  }
29
29
  interface SwitchInlineButton extends AbstractInlineKeyboardButton {
30
- /** If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. Can be empty, in which case just the bot's username will be inserted.
31
-
32
- Note: This offers an easy way for users to start using your bot in inline mode when they are currently in a private chat with it. Especially useful when combined with switch_pm... actions – in this case the user will be automatically returned to the chat they switched from, skipping the chat selection screen. */
30
+ /** If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. Can be empty, in which case just the bot's username will be inserted. */
33
31
  switch_inline_query: string;
34
32
  }
35
33
  interface SwitchInlineCurrentChatButton extends AbstractInlineKeyboardButton {
package/message.d.ts CHANGED
@@ -66,6 +66,7 @@ export declare namespace Message {
66
66
  type AnimationMessage = DocumentMessage & MsgWith<"animation">;
67
67
  type PhotoMessage = MediaMessage & MsgWith<"photo">;
68
68
  type StickerMessage = CommonMessage & MsgWith<"sticker">;
69
+ type StoryMessage = CommonMessage & MsgWith<"story">;
69
70
  type VideoMessage = MediaMessage & MsgWith<"video">;
70
71
  type VideoNoteMessage = CommonMessage & MsgWith<"video_note">;
71
72
  type VoiceMessage = CaptionableMessage & MsgWith<"voice">;
@@ -125,6 +126,8 @@ export interface Message extends Message.MediaMessage {
125
126
  photo?: PhotoSize[];
126
127
  /** Message is a sticker, information about the sticker */
127
128
  sticker?: Sticker;
129
+ /** Message is a forwarded story */
130
+ story?: Story;
128
131
  /** Message is a video, information about the video */
129
132
  video?: Video;
130
133
  /** Message is a video note, information about the video message */
@@ -255,11 +258,11 @@ Please note:
255
258
 
256
259
  - Any character with code between 1 and 126 inclusively can be escaped anywhere with a preceding '\' character, in which case it is treated as an ordinary character and not a part of the markup. This implies that '\' character usually must be escaped with a preceding '\' character.
257
260
  - Inside `pre` and `code` entities, all '`' and '\' characters must be escaped with a preceding '\' character.
258
- - Inside `(...)` part of inline link definition, all ')' and '\' must be escaped with a preceding '\' character.
259
- - A valid emoji must be provided as an alternative value for the custom emoji. The emoji will be shown instead of the custom emoji in places where a custom emoji cannot be displayed (e.g., system notifications) or if the message is forwarded by a non-premium user. It is recommended to use the emoji from the emoji field of the custom emoji sticker.
260
- - Custom emoji entities can only be used by bots that purchased additional usernames on Fragment.
261
+ - Inside the `(...)` part of the inline link and custom emoji definition, all ')' and '\' must be escaped with a preceding '\' character.
261
262
  - In all other places characters '_', '*', '[', ']', '(', ')', '~', '`', '>', '#', '+', '-', '=', '|', '{', '}', '.', '!' must be escaped with the preceding character '\'.
262
263
  - In case of ambiguity between `italic` and `underline` entities `__` is always greadily treated from left to right as beginning or end of `underline` entity, so instead of `___italic underline___` use `___italic underline_\r__`, where `\r` is a character with code 13, which will be ignored.
264
+ - A valid emoji must be provided as an alternative value for the custom emoji. The emoji will be shown instead of the custom emoji in places where a custom emoji cannot be displayed (e.g., system notifications) or if the message is forwarded by a non-premium user. It is recommended to use the emoji from the emoji field of the custom emoji sticker.
265
+ - Custom emoji entities can only be used by bots that purchased additional usernames on Fragment.
263
266
 
264
267
  #### HTML style
265
268
  To use this mode, pass *HTML* in the *parse_mode* field. The following tags are currently supported:
@@ -497,9 +500,11 @@ export interface PollOption {
497
500
  export interface PollAnswer {
498
501
  /** Unique poll identifier */
499
502
  poll_id: string;
500
- /** The user, who changed the answer to the poll */
501
- user: User;
502
- /** 0-based identifiers of answer options, chosen by the user. May be empty if the user retracted their vote. */
503
+ /** The chat that changed the answer to the poll, if the voter is anonymous */
504
+ voter_chat?: Chat;
505
+ /** The user that changed the answer to the poll, if the voter isn't anonymous */
506
+ user?: User;
507
+ /** 0-based identifiers of chosen answer options. May be empty if the vote was retracted. */
503
508
  option_ids: number[];
504
509
  }
505
510
  /** This object contains information about a poll. */
@@ -563,6 +568,9 @@ export interface Venue {
563
568
  /** Google Places type of the venue. (See supported types.) */
564
569
  google_place_type?: string;
565
570
  }
571
+ /** This object represents a message about a forwarded story in the chat. Currently holds no information. */
572
+ export interface Story {
573
+ }
566
574
  /** This object represents the content of a service message, sent whenever a user in the chat triggers a proximity alert set by another user. */
567
575
  export interface ProximityAlertTriggered {
568
576
  /** User that triggered the alert */
package/methods.d.ts CHANGED
@@ -903,6 +903,11 @@ export type ApiMethods<F> = {
903
903
  /** Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) */
904
904
  chat_id: number | string;
905
905
  }): true;
906
+ /** 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. */
907
+ unpinAllGeneralForumTopicMessages(args: {
908
+ /** Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) */
909
+ chat_id: number | string;
910
+ }): true;
906
911
  /** 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.
907
912
 
908
913
  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. */
@@ -1226,7 +1231,7 @@ export type ApiMethods<F> = {
1226
1231
  results: readonly InlineQueryResult[];
1227
1232
  /** The maximum amount of time in seconds that the result of the inline query may be cached on the server. Defaults to 300. */
1228
1233
  cache_time?: number;
1229
- /** Pass True if results may be cached on the server side only for the user that sent the query. By default, results may be returned to any user who sends the same query */
1234
+ /** Pass True if results may be cached on the server side only for the user that sent the query. By default, results may be returned to any user who sends the same query. */
1230
1235
  is_personal?: boolean;
1231
1236
  /** Pass the offset that a client should send in the next query with the same text to receive more results. Pass an empty string if there are no more results or if you don't support pagination. Offset length can't exceed 64 bytes. */
1232
1237
  next_offset?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grammyjs/types",
3
- "version": "3.1.3",
3
+ "version": "3.2.0",
4
4
  "description": "Telegram Bot API type declarations for grammY",
5
5
  "main": "mod.js",
6
6
  "repository": {