@telegram.ts/types 1.24.0 → 1.25.1
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 +2 -2
- package/src/apiMethodsTypes.d.ts +207 -153
- package/src/checkListTask.d.ts +4 -2
- package/src/inlineTypes.d.ts +1 -0
- package/src/invoiceTypes.d.ts +80 -27
- package/src/manageTypes.d.ts +93 -50
- package/src/messageTypes.d.ts +13 -5
package/src/messageTypes.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ export declare namespace Message {
|
|
|
29
29
|
interface ServiceMessage {
|
|
30
30
|
/** Unique message identifier inside this chat. In specific instances (e.g., message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately. In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent */
|
|
31
31
|
message_id: number;
|
|
32
|
-
/** Unique identifier of a message thread or
|
|
32
|
+
/** Unique identifier of a message thread or forum topic to which the message belongs; for supergroups and private chats only */
|
|
33
33
|
message_thread_id?: number;
|
|
34
34
|
/** Sender of the message; may be empty for messages sent to channels. For backward compatibility, if the message was sent on behalf of a chat, the field contains a fake sender user in non-channel chats. */
|
|
35
35
|
from?: User;
|
|
@@ -41,7 +41,7 @@ export declare namespace Message {
|
|
|
41
41
|
business_connection_id?: string;
|
|
42
42
|
/** Chat the message belongs to */
|
|
43
43
|
chat: Chat;
|
|
44
|
-
/** True, if the message is sent to a forum
|
|
44
|
+
/** True, if the message is sent to a topic in a forum supergroup or a private chat with the bot */
|
|
45
45
|
is_topic_message?: boolean;
|
|
46
46
|
/** Information about the direct messages chat topic that contains the message */
|
|
47
47
|
direct_messages_topic?: DirectMessagesTopic;
|
|
@@ -101,7 +101,9 @@ export declare namespace Message {
|
|
|
101
101
|
has_media_spoiler?: true;
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
export type TextMessage = CommonMessage &
|
|
104
|
+
export type TextMessage = CommonMessage &
|
|
105
|
+
MsgWith<"text"> &
|
|
106
|
+
Partial<MsgWith<"entities">>;
|
|
105
107
|
export type AudioMessage = CaptionableMessage & MsgWith<"audio">;
|
|
106
108
|
export type DocumentMessage = CaptionableMessage & MsgWith<"document">;
|
|
107
109
|
export type AnimationMessage = DocumentMessage & MsgWith<"animation">;
|
|
@@ -196,6 +198,8 @@ export declare namespace Message {
|
|
|
196
198
|
MsgWith<"giveaway_completed">;
|
|
197
199
|
export type GiftMessage = ServiceMessage & MsgWith<"gift">;
|
|
198
200
|
export type UniqueGiftMessage = ServiceMessage & MsgWith<"unique_gift">;
|
|
201
|
+
export type GiftUpgradeSentMessage = ServiceMessage &
|
|
202
|
+
MsgWith<"gift_upgrade_sent">;
|
|
199
203
|
export type PaidMessagePriceChangedMessage = ServiceMessage &
|
|
200
204
|
MsgWith<"paid_message_price_changed">;
|
|
201
205
|
export type VideoChatScheduledMessage = ServiceMessage &
|
|
@@ -334,6 +338,8 @@ export interface Message extends Message.MediaMessage {
|
|
|
334
338
|
giveaway_completed?: GiveawayCompleted;
|
|
335
339
|
/** Service message: a regular gift was sent or received */
|
|
336
340
|
gift?: GiftInfo;
|
|
341
|
+
/** Service message: upgrade of a gift was purchased after the gift was sent */
|
|
342
|
+
gift_upgrade_sent?: GiftInfo;
|
|
337
343
|
/** Service message: a unique gift was sent or received */
|
|
338
344
|
unique_gift?: UniqueGiftInfo;
|
|
339
345
|
/** Service message: the price for paid messages has changed in the chat */
|
|
@@ -442,7 +448,7 @@ Please note:
|
|
|
442
448
|
- Inside `pre` and `code` entities, all '`' and '\' characters must be escaped with a preceding '\' character.
|
|
443
449
|
- Inside the `(...)` part of the inline link and custom emoji definition, all ')' and '\' must be escaped with a preceding '\' character.
|
|
444
450
|
- In all other places characters '_', '*', '[', ']', '(', ')', '~', '`', '>', '#', '+', '-', '=', '|', '{', '}', '.', '!' must be escaped with the preceding character '\'.
|
|
445
|
-
- In case of ambiguity between `italic` and `underline` entities `__` is always
|
|
451
|
+
- In case of ambiguity between `italic` and `underline` entities `__` is always greedily treated from left to right as beginning or end of an `underline` entity, so instead of `___italic underline___` use `___italic underline_**__`, adding an empty bold entity as a separator.
|
|
446
452
|
- 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.
|
|
447
453
|
- Custom emoji entities can only be used by bots that purchased additional usernames on Fragment.
|
|
448
454
|
|
|
@@ -496,7 +502,7 @@ Please note:
|
|
|
496
502
|
|
|
497
503
|
- Entities must not be nested, use parse mode MarkdownV2 instead.
|
|
498
504
|
- There is no way to specify “underline”, “strikethrough”, “spoiler”, “blockquote”, “expandable_blockquote” and “custom_emoji” entities, use parse mode MarkdownV2 instead.
|
|
499
|
-
- To escape
|
|
505
|
+
- To escape character '_', '*', '`', '[' outside of an entity, prepend the characters '\' before them.
|
|
500
506
|
- Escaping inside entities is not allowed, so entity must be closed first and reopened again: use `_snake_\__case_` for italic `snake_case` and `*2*\**2=4*` for bold `2*2=4`. */
|
|
501
507
|
export type ParseMode = "Markdown" | "MarkdownV2" | "HTML";
|
|
502
508
|
|
|
@@ -1028,6 +1034,8 @@ export interface MessageAutoDeleteTimerChanged {
|
|
|
1028
1034
|
export interface ForumTopicCreated {
|
|
1029
1035
|
/** Name of the topic */
|
|
1030
1036
|
name: string;
|
|
1037
|
+
/** True, if the name of the topic wasn't specified explicitly by its creator and likely needs to be changed by the bot */
|
|
1038
|
+
is_name_implicit?: true;
|
|
1031
1039
|
/** Color of the topic icon in RGB format */
|
|
1032
1040
|
icon_color: number;
|
|
1033
1041
|
/** Unique identifier of the custom emoji shown as the topic icon */
|