@telegram.ts/types 1.21.1 → 1.22.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/README.md +4 -0
- package/package.json +1 -1
- package/src/apiMethodsTypes.d.ts +262 -1
- package/src/index.d.ts +1 -0
- package/src/invoiceTypes.d.ts +185 -7
- package/src/manageTypes.d.ts +53 -2
- package/src/messageTypes.d.ts +11 -0
- package/src/storyTypes.d.ts +103 -0
package/README.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
[](https://core.telegram.org/bots/api)
|
|
2
|
+
[](https://www.npmjs.com/package/@telegram.ts/types)
|
|
3
|
+
[](https://www.npmjs.com/package/@telegram.ts/types)
|
|
4
|
+
|
|
1
5
|
# @telegram.ts/types: Type Declarations for Telegram Bot API
|
|
2
6
|
|
|
3
7
|
The `@telegram.ts/types` package provides comprehensive type declarations for the Telegram Bot API, specifically tailored for use with `telegramsjs`.
|
package/package.json
CHANGED
package/src/apiMethodsTypes.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import type {
|
|
|
6
6
|
InlineQueryResultsButton,
|
|
7
7
|
} from "./inlineTypes";
|
|
8
8
|
import type {
|
|
9
|
+
AcceptedGiftTypes,
|
|
9
10
|
BotCommand,
|
|
10
11
|
BusinessConnection,
|
|
11
12
|
ChatAdministratorRights,
|
|
@@ -44,12 +45,15 @@ import type {
|
|
|
44
45
|
SentWebAppMessage,
|
|
45
46
|
Sticker,
|
|
46
47
|
StickerSet,
|
|
48
|
+
Story,
|
|
47
49
|
} from "./messageTypes";
|
|
48
50
|
import type { PassportElementError } from "./passportTypes";
|
|
49
51
|
import type {
|
|
50
52
|
Gifts,
|
|
51
53
|
LabeledPrice,
|
|
54
|
+
OwnedGifts,
|
|
52
55
|
ShippingOption,
|
|
56
|
+
StarAmount,
|
|
53
57
|
StarTransactions,
|
|
54
58
|
} from "./invoiceTypes";
|
|
55
59
|
import type {
|
|
@@ -59,6 +63,7 @@ import type {
|
|
|
59
63
|
BotShortDescription,
|
|
60
64
|
MenuButton,
|
|
61
65
|
} from "./botCommandTypes";
|
|
66
|
+
import { StoryArea } from "./storyTypes.ts";
|
|
62
67
|
import type { Update } from "./updateTypes";
|
|
63
68
|
|
|
64
69
|
/** Wrapper type to bundle all methods of the Telegram Bot API */
|
|
@@ -867,8 +872,18 @@ export type ApiMethods = {
|
|
|
867
872
|
message_thread_id?: number;
|
|
868
873
|
}): true;
|
|
869
874
|
|
|
875
|
+
/** Marks incoming message as read on behalf of a business account. Requires the can_read_messages business bot right. Returns True on success. */
|
|
876
|
+
readBusinessMessage(args: {
|
|
877
|
+
/** Unique identifier of the business connection on behalf of which to read the message */
|
|
878
|
+
business_connection_id: string;
|
|
879
|
+
/** Unique identifier of the chat in which the message was received. The chat must have been active in the last 24 hours. */
|
|
880
|
+
chat_id: number;
|
|
881
|
+
/** Unique identifier of the message to mark as read */
|
|
882
|
+
message_id: number;
|
|
883
|
+
}): true;
|
|
884
|
+
|
|
870
885
|
/** Use this method to change the chosen reactions on a message. Service messages of some types can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. In albums, bots must react to the first message. Returns True on success. */
|
|
871
|
-
|
|
886
|
+
(args: {
|
|
872
887
|
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
873
888
|
chat_id: number | string;
|
|
874
889
|
/** Identifier of the target message */
|
|
@@ -1438,6 +1453,120 @@ export type ApiMethods = {
|
|
|
1438
1453
|
for_channels?: boolean;
|
|
1439
1454
|
}): ChatAdministratorRights;
|
|
1440
1455
|
|
|
1456
|
+
/** Changes the first and last name of a managed business account. Requires the can_change_name business bot right. Returns True on success. */
|
|
1457
|
+
setBusinessAccountName(args: {
|
|
1458
|
+
/** Unique identifier of the business connection */
|
|
1459
|
+
business_connection_id: string;
|
|
1460
|
+
/** The new value of the first name for the business account; 1-64 characters */
|
|
1461
|
+
first_name: string;
|
|
1462
|
+
/** The new value of the last name for the business account; 0-64 characters */
|
|
1463
|
+
last_name?: string;
|
|
1464
|
+
}): true;
|
|
1465
|
+
|
|
1466
|
+
/** Changes the username of a managed business account. Requires the can_change_username business bot right. Returns True on success. */
|
|
1467
|
+
setBusinessAccountUsername(args: {
|
|
1468
|
+
/** Unique identifier of the business connection */
|
|
1469
|
+
business_connection_id: string;
|
|
1470
|
+
/** The new value of the username for the business account; 0-32 characters */
|
|
1471
|
+
username?: string;
|
|
1472
|
+
}): true;
|
|
1473
|
+
|
|
1474
|
+
/** Changes the bio of a managed business account. Requires the can_change_bio business bot right. Returns True on success. */
|
|
1475
|
+
setBusinessAccountBio(args: {
|
|
1476
|
+
/** Unique identifier of the business connection */
|
|
1477
|
+
business_connection_id: string;
|
|
1478
|
+
/** The new value of the bio for the business account; 0-140 characters */
|
|
1479
|
+
bio?: string;
|
|
1480
|
+
}): true;
|
|
1481
|
+
|
|
1482
|
+
/** Changes the profile photo of a managed business account. Requires the can_edit_profile_photo business bot right. Returns True on success. */
|
|
1483
|
+
setBusinessAccountProfilePhoto(args: {
|
|
1484
|
+
/** Unique identifier of the business connection */
|
|
1485
|
+
business_connection_id: string;
|
|
1486
|
+
/** The new profile photo to set */
|
|
1487
|
+
photo: InputProfilePhoto<F>;
|
|
1488
|
+
/** Pass True to set the public photo, which will be visible even if the main photo is hidden by the business account's privacy settings. An account can have only one public photo. */
|
|
1489
|
+
is_public?: boolean;
|
|
1490
|
+
}): true;
|
|
1491
|
+
|
|
1492
|
+
/** Removes the current profile photo of a managed business account. Requires the can_edit_profile_photo business bot right. Returns True on success. */
|
|
1493
|
+
removeBusinessAccountProfilePhoto(args: {
|
|
1494
|
+
/** Unique identifier of the business connection */
|
|
1495
|
+
business_connection_id: string;
|
|
1496
|
+
/** Pass True to remove the public photo, which is visible even if the main photo is hidden by the business account's privacy settings. After the main photo is removed, the previous profile photo (if present) becomes the main photo. */
|
|
1497
|
+
is_public?: boolean;
|
|
1498
|
+
}): true;
|
|
1499
|
+
|
|
1500
|
+
/** Changes the privacy settings pertaining to incoming gifts in a managed business account. Requires the can_change_gift_settings business bot right. Returns True on success. */
|
|
1501
|
+
setBusinessAccountGiftSettings(args: {
|
|
1502
|
+
/** Unique identifier of the business connection */
|
|
1503
|
+
business_connection_id: string;
|
|
1504
|
+
/** Pass True, if a button for sending a gift to the user or by the business account must always be shown in the input field */
|
|
1505
|
+
show_gift_button: boolean;
|
|
1506
|
+
/** Types of gifts accepted by the business account */
|
|
1507
|
+
accepted_gift_types: AcceptedGiftTypes;
|
|
1508
|
+
}): true;
|
|
1509
|
+
|
|
1510
|
+
/** Returns the amount of Telegram Stars owned by a managed business account. Requires the can_view_gifts_and_stars business bot right. Returns StarAmount on success. */
|
|
1511
|
+
getBusinessAccountStarBalance(args: {
|
|
1512
|
+
/** Unique identifier of the business connection */
|
|
1513
|
+
business_connection_id: string;
|
|
1514
|
+
}): StarAmount;
|
|
1515
|
+
|
|
1516
|
+
/** Returns the gifts received and owned by a managed business account. Requires the can_view_gifts_and_stars business bot right. Returns OwnedGifts on success. */
|
|
1517
|
+
getBusinessAccountGifts(args: {
|
|
1518
|
+
/** Unique identifier of the business connection */
|
|
1519
|
+
business_connection_id: string;
|
|
1520
|
+
/** Pass True to exclude gifts that aren't saved to the account's profile page */
|
|
1521
|
+
exclude_unsaved?: boolean;
|
|
1522
|
+
/** Pass True to exclude gifts that are saved to the account's profile page */
|
|
1523
|
+
exclude_saved?: boolean;
|
|
1524
|
+
/** Pass True to exclude gifts that can be purchased an unlimited number of times */
|
|
1525
|
+
exclude_unlimited?: boolean;
|
|
1526
|
+
/** Pass True to exclude gifts that can be purchased a limited number of times */
|
|
1527
|
+
exclude_limited?: boolean;
|
|
1528
|
+
/** Pass True to exclude unique gifts */
|
|
1529
|
+
exclude_unique?: boolean;
|
|
1530
|
+
/** Pass True to sort results by gift price instead of send date. Sorting is applied before pagination. */
|
|
1531
|
+
sort_by_price?: boolean;
|
|
1532
|
+
/** Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results */
|
|
1533
|
+
offset?: string;
|
|
1534
|
+
/** The maximum number of gifts to be returned; 1-100. Defaults to 100 */
|
|
1535
|
+
limit?: number;
|
|
1536
|
+
}): OwnedGifts;
|
|
1537
|
+
|
|
1538
|
+
/** Converts a given regular gift to Telegram Stars. Requires the can_convert_gifts_to_stars business bot right. Returns True on success. */
|
|
1539
|
+
convertGiftToStars(args: {
|
|
1540
|
+
/** Unique identifier of the business connection */
|
|
1541
|
+
business_connection_id: string;
|
|
1542
|
+
/** Unique identifier of the regular gift that should be converted to Telegram Stars */
|
|
1543
|
+
owned_gift_id: string;
|
|
1544
|
+
}): true;
|
|
1545
|
+
|
|
1546
|
+
/** Upgrades a given regular gift to a unique gift. Requires the can_transfer_and_upgrade_gifts business bot right. Additionally requires the can_transfer_stars business bot right if the upgrade is paid. Returns True on success. */
|
|
1547
|
+
upgradeGift(args: {
|
|
1548
|
+
/** Unique identifier of the business connection */
|
|
1549
|
+
business_connection_id: string;
|
|
1550
|
+
/** Unique identifier of the regular gift that should be upgraded to a unique one */
|
|
1551
|
+
owned_gift_id: string;
|
|
1552
|
+
/** Pass True to keep the original gift text, sender and receiver in the upgraded gift */
|
|
1553
|
+
keep_original_details?: boolean;
|
|
1554
|
+
/** The amount of Telegram Stars that will be paid for the upgrade from the business account balance. If gift.prepaid_upgrade_star_count > 0, then pass 0, otherwise, the can_transfer_stars business bot right is required and gift.upgrade_star_count must be passed. */
|
|
1555
|
+
star_count?: number;
|
|
1556
|
+
}): true;
|
|
1557
|
+
|
|
1558
|
+
/** Transfers an owned unique gift to another user. Requires the can_transfer_and_upgrade_gifts business bot right. Requires can_transfer_stars business bot right if the transfer is paid. Returns True on success. */
|
|
1559
|
+
transferGift(args: {
|
|
1560
|
+
/** Unique identifier of the business connection */
|
|
1561
|
+
business_connection_id: string;
|
|
1562
|
+
/** Unique identifier of the regular gift that should be transferred */
|
|
1563
|
+
owned_gift_id: string;
|
|
1564
|
+
/** Unique identifier of the chat which will own the gift. The chat must be active in the last 24 hours. */
|
|
1565
|
+
new_owner_chat_id: number;
|
|
1566
|
+
/** The amount of Telegram Stars that will be paid for the transfer from the business account balance. If positive, then the can_transfer_stars business bot right is required. */
|
|
1567
|
+
star_count: number;
|
|
1568
|
+
}): true;
|
|
1569
|
+
|
|
1441
1570
|
/** Use this method to edit text and game messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent. */
|
|
1442
1571
|
editMessageText(args: {
|
|
1443
1572
|
/** Unique identifier of the business connection on behalf of which the message to be edited was sent */
|
|
@@ -1549,6 +1678,14 @@ export type ApiMethods = {
|
|
|
1549
1678
|
message_ids: number[];
|
|
1550
1679
|
}): true;
|
|
1551
1680
|
|
|
1681
|
+
/** Delete messages on behalf of a business account. Requires the can_delete_outgoing_messages business bot right to delete messages sent by the bot itself, or the can_delete_all_messages business bot right to delete any message. Returns True on success. */
|
|
1682
|
+
deleteBusinessMessages(args: {
|
|
1683
|
+
/** Unique identifier of the business connection on behalf of which to delete the messages */
|
|
1684
|
+
business_connection_id: string;
|
|
1685
|
+
/** A list of 1-100 identifiers of messages to delete. All messages must be from the same chat. See deleteMessage for limitations on which messages can be deleted */
|
|
1686
|
+
message_ids: number[];
|
|
1687
|
+
}): true;
|
|
1688
|
+
|
|
1552
1689
|
/** Use this method to send static .WEBP, animated .TGS, or video .WEBM stickers. On success, the sent Message is returned. */
|
|
1553
1690
|
sendSticker(args: {
|
|
1554
1691
|
/** Unique identifier of the business connection on behalf of which the message will be sent */
|
|
@@ -1711,6 +1848,54 @@ export type ApiMethods = {
|
|
|
1711
1848
|
custom_emoji_id?: string;
|
|
1712
1849
|
}): true;
|
|
1713
1850
|
|
|
1851
|
+
/** Posts a story on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns Story on success. */
|
|
1852
|
+
postStory(args: {
|
|
1853
|
+
/** Unique identifier of the business connection */
|
|
1854
|
+
business_connection_id: string;
|
|
1855
|
+
/** Content of the story */
|
|
1856
|
+
content: InputStoryContent<F>;
|
|
1857
|
+
/** Period after which the story is moved to the archive, in seconds; must be one of 6 * 3600, 12 * 3600, 86400, or 2 * 86400 */
|
|
1858
|
+
active_period: number;
|
|
1859
|
+
/** Caption of the story, 0-2048 characters after entities parsing */
|
|
1860
|
+
caption?: string;
|
|
1861
|
+
/** Mode for parsing entities in the story caption. See formatting options for more details. */
|
|
1862
|
+
parse_mode?: string;
|
|
1863
|
+
/** A list of special entities that appear in the caption, which can be specified instead of parse_mode */
|
|
1864
|
+
caption_entities?: MessageEntity[];
|
|
1865
|
+
/** A list of clickable areas to be shown on the story */
|
|
1866
|
+
areas?: StoryArea[];
|
|
1867
|
+
/** Pass True to keep the story accessible after it expires */
|
|
1868
|
+
post_to_chat_page?: boolean;
|
|
1869
|
+
/** Pass True if the content of the story must be protected from forwarding and screenshotting */
|
|
1870
|
+
protect_content?: boolean;
|
|
1871
|
+
}): Story;
|
|
1872
|
+
|
|
1873
|
+
/** Edits a story previously posted by the bot on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns Story on success. */
|
|
1874
|
+
editStory(args: {
|
|
1875
|
+
/** Unique identifier of the business connection */
|
|
1876
|
+
business_connection_id: string;
|
|
1877
|
+
/** Unique identifier of the story to edit */
|
|
1878
|
+
story_id: number;
|
|
1879
|
+
/** Content of the story */
|
|
1880
|
+
content: InputStoryContent<F>;
|
|
1881
|
+
/** Caption of the story, 0-2048 characters after entities parsing */
|
|
1882
|
+
caption?: string;
|
|
1883
|
+
/** Mode for parsing entities in the story caption. See formatting options for more details. */
|
|
1884
|
+
parse_mode?: string;
|
|
1885
|
+
/** A list of special entities that appear in the caption, which can be specified instead of parse_mode */
|
|
1886
|
+
caption_entities?: MessageEntity[];
|
|
1887
|
+
/** A list of clickable areas to be shown on the story */
|
|
1888
|
+
areas?: StoryArea;
|
|
1889
|
+
}): Story;
|
|
1890
|
+
|
|
1891
|
+
/** Deletes a story previously posted by the bot on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns True on success. */
|
|
1892
|
+
deleteStory(args: {
|
|
1893
|
+
/** Unique identifier of the business connection */
|
|
1894
|
+
business_connection_id: string;
|
|
1895
|
+
/** Unique identifier of the story to delete */
|
|
1896
|
+
story_id: number;
|
|
1897
|
+
}): true;
|
|
1898
|
+
|
|
1714
1899
|
/** Returns the list of gifts that can be sent by the bot to users and chennel chats. Requires no parameters. Returns a Gifts object. */
|
|
1715
1900
|
getAvailableGifts(): Gifts;
|
|
1716
1901
|
|
|
@@ -1732,6 +1917,30 @@ export type ApiMethods = {
|
|
|
1732
1917
|
text_entities?: MessageEntity[];
|
|
1733
1918
|
}): true;
|
|
1734
1919
|
|
|
1920
|
+
/** Gifts a Telegram Premium subscription to the given user. Returns True on success. */
|
|
1921
|
+
giftPremiumSubscription(args: {
|
|
1922
|
+
/** Unique identifier of the target user who will receive a Telegram Premium subscription */
|
|
1923
|
+
user_id: number;
|
|
1924
|
+
/** Number of months the Telegram Premium subscription will be active for the user; must be one of 3, 6, or 12 */
|
|
1925
|
+
month_count: 3 | 6 | 12;
|
|
1926
|
+
/** Number of Telegram Stars to pay for the Telegram Premium subscription; must be 1000 for 3 months, 1500 for 6 months, and 2500 for 12 months */
|
|
1927
|
+
star_count: 1000 | 1500 | 2500;
|
|
1928
|
+
/** Text that will be shown along with the service message about the subscription; 0-128 characters */
|
|
1929
|
+
text?: string;
|
|
1930
|
+
/** Mode for parsing entities in the text. See formatting options for more details. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, and “custom_emoji” are ignored. */
|
|
1931
|
+
text_parse_mode?: string;
|
|
1932
|
+
/** A list of special entities that appear in the gift text. It can be specified instead of text_parse_mode. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, and “custom_emoji” are ignored. */
|
|
1933
|
+
text_entities?: MessageEntity[];
|
|
1934
|
+
}): true;
|
|
1935
|
+
|
|
1936
|
+
/** Transfers Telegram Stars from the business account balance to the bot's balance. Requires the can_transfer_stars business bot right. Returns True on success. */
|
|
1937
|
+
transferBusinessAccountStars(args: {
|
|
1938
|
+
/** Unique identifier of the business connection */
|
|
1939
|
+
business_connection_id: string;
|
|
1940
|
+
/** Number of Telegram Stars to transfer; 1-10000 */
|
|
1941
|
+
star_count: number;
|
|
1942
|
+
}): true;
|
|
1943
|
+
|
|
1735
1944
|
/** Use this method to send answers to an inline query. On success, True is returned.
|
|
1736
1945
|
No more than 50 results per query are allowed.
|
|
1737
1946
|
|
|
@@ -2205,3 +2414,55 @@ export interface InputPaidMediaVideo {
|
|
|
2205
2414
|
/** Pass True if the uploaded video is suitable for streaming */
|
|
2206
2415
|
supports_streaming?: boolean;
|
|
2207
2416
|
}
|
|
2417
|
+
|
|
2418
|
+
/** This object describes a profile photo to set. Currently, it can be one of
|
|
2419
|
+
- InputProfilePhotoStatic
|
|
2420
|
+
- InputProfilePhotoAnimated */
|
|
2421
|
+
export type InputProfilePhoto =
|
|
2422
|
+
| InputProfilePhotoStatic
|
|
2423
|
+
| InputProfilePhotoAnimated;
|
|
2424
|
+
|
|
2425
|
+
/** A static profile photo in the .JPG format. */
|
|
2426
|
+
export interface InputProfilePhotoStatic {
|
|
2427
|
+
/** Type of the profile photo, must be “static” */
|
|
2428
|
+
type: "static";
|
|
2429
|
+
/** The static profile photo. Profile photos can't be reused and can only be uploaded as a new file, so you can pass “attach://<file_attach_name>” if the photo was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » */
|
|
2430
|
+
photo: Buffer | ReadStream | string;
|
|
2431
|
+
}
|
|
2432
|
+
|
|
2433
|
+
/** An animated profile photo in the MPEG4 format. */
|
|
2434
|
+
export interface InputProfilePhotoAnimated {
|
|
2435
|
+
/** Type of the profile photo, must be “animated” */
|
|
2436
|
+
type: "animated";
|
|
2437
|
+
/** The animated profile photo. Profile photos can't be reused and can only be uploaded as a new file, so you can pass “attach://<file_attach_name>” if the photo was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » */
|
|
2438
|
+
animation: F;
|
|
2439
|
+
/** Timestamp in seconds of the frame that will be used as the static profile photo. Defaults to 0.0. */
|
|
2440
|
+
main_frame_timestamp?: number;
|
|
2441
|
+
}
|
|
2442
|
+
|
|
2443
|
+
/** This object describes the content of a story to post. Currently, it can be one of
|
|
2444
|
+
- InputStoryContentPhoto
|
|
2445
|
+
- InputStoryContentVideo */
|
|
2446
|
+
export type InputStoryContent = InputStoryContentPhoto | InputStoryContentVideo;
|
|
2447
|
+
|
|
2448
|
+
/** Describes a photo to post as a story. */
|
|
2449
|
+
export interface InputStoryContentPhoto {
|
|
2450
|
+
/** Type of the content, must be “photo” */
|
|
2451
|
+
type: "photo";
|
|
2452
|
+
/** The photo to post as a story. The photo must be of the size 1080x1920 and must not exceed 10 MB. The photo can't be reused and can only be uploaded as a new file, so you can pass “attach://<file_attach_name>” if the photo was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » */
|
|
2453
|
+
photo: Buffer | ReadStream | string;
|
|
2454
|
+
}
|
|
2455
|
+
|
|
2456
|
+
/** Describes a video to post as a story. */
|
|
2457
|
+
export interface InputStoryContentVideo {
|
|
2458
|
+
/** Type of the content, must be “video” */
|
|
2459
|
+
type: "video";
|
|
2460
|
+
/** The video to post as a story. The video must be of the size 720x1280, streamable, encoded with H.265 codec, with key frames added each second in the MPEG4 format, and must not exceed 30 MB. The video can't be reused and can only be uploaded as a new file, so you can pass “attach://<file_attach_name>” if the video was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » */
|
|
2461
|
+
video: Buffer | ReadStream | string;
|
|
2462
|
+
/** Precise duration of the video in seconds; 0-60 */
|
|
2463
|
+
duration?: number;
|
|
2464
|
+
/** Timestamp in seconds of the frame that will be used as the static cover for the story. Defaults to 0.0. */
|
|
2465
|
+
cover_frame_timestamp?: number;
|
|
2466
|
+
/** Pass True if the video has no sound */
|
|
2467
|
+
is_animation?: boolean;
|
|
2468
|
+
}
|
package/src/index.d.ts
CHANGED
package/src/invoiceTypes.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Chat, User } from "./manageTypes";
|
|
2
|
-
import type { PaidMedia, Sticker } from "./messageTypes";
|
|
2
|
+
import type { MessageEntity, PaidMedia, Sticker } from "./messageTypes";
|
|
3
3
|
|
|
4
4
|
/** This object represents a portion of the price for goods or services. */
|
|
5
5
|
export interface LabeledPrice {
|
|
@@ -197,20 +197,29 @@ export type TransactionPartner =
|
|
|
197
197
|
export interface TransactionPartnerUser {
|
|
198
198
|
/** Type of the transaction partner, always “user” */
|
|
199
199
|
type: "user";
|
|
200
|
+
/** Type of the transaction, currently one of “invoice_payment” for payments via invoices, “paid_media_payment” for payments for paid media, “gift_purchase” for gifts sent by the bot, “premium_purchase” for Telegram Premium subscriptions gifted by the bot, “business_account_transfer” for direct transfers from managed business accounts */
|
|
201
|
+
transaction_type:
|
|
202
|
+
| "invoice_payment"
|
|
203
|
+
| "paid_media_payment"
|
|
204
|
+
| "gift_purchase"
|
|
205
|
+
| "premium_purchase"
|
|
206
|
+
| "business_account_transfer";
|
|
200
207
|
/** Information about the user */
|
|
201
208
|
user: User;
|
|
202
|
-
/** Information about the affiliate that received a commission via this transaction */
|
|
209
|
+
/** Information about the affiliate that received a commission via this transaction. Can be available only for “invoice_payment” and “paid_media_payment” transactions. */
|
|
203
210
|
affiliate?: AffiliateInfo;
|
|
204
|
-
/** The duration of the paid subscription */
|
|
211
|
+
/** The duration of the paid subscription. Can be available only for “invoice_payment” transactions. */
|
|
205
212
|
subscription_period?: number;
|
|
206
|
-
/** Bot-specified invoice payload */
|
|
213
|
+
/** Bot-specified invoice payload. Can be available only for “invoice_payment” transactions. */
|
|
207
214
|
invoice_payload?: string;
|
|
208
|
-
/** Information about the paid media bought by the user */
|
|
215
|
+
/** Information about the paid media bought by the user. Can be available only for “invoice_payment” transactions. */
|
|
209
216
|
paid_media?: PaidMedia[];
|
|
210
|
-
/** Bot-specified paid media payload */
|
|
217
|
+
/** Bot-specified paid media payload. Can be available only for “invoice_payment” transactions. */
|
|
211
218
|
paid_media_payload?: string;
|
|
212
|
-
/** The gift sent to the user by the bot */
|
|
219
|
+
/** The gift sent to the user by the bot; for “gift_purchase” transactions only */
|
|
213
220
|
gift?: Gift;
|
|
221
|
+
/** Number of months the gifted Telegram Premium subscription will be active for; for “premium_purchase” transactions only */
|
|
222
|
+
premium_subscription_duration?: number;
|
|
214
223
|
}
|
|
215
224
|
|
|
216
225
|
/** Describes a transaction with a chat. */
|
|
@@ -312,3 +321,172 @@ export interface Gifts {
|
|
|
312
321
|
/** The list of gifts */
|
|
313
322
|
gifts: Gift[];
|
|
314
323
|
}
|
|
324
|
+
|
|
325
|
+
/** This object describes the model of a unique gift. */
|
|
326
|
+
export interface UniqueGiftModel {
|
|
327
|
+
/** Name of the model */
|
|
328
|
+
name: string;
|
|
329
|
+
/** The sticker that represents the unique gift */
|
|
330
|
+
sticker: Sticker;
|
|
331
|
+
/** The number of unique gifts that receive this model for every 1000 gifts upgraded */
|
|
332
|
+
rarity_per_mille: number;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
/** This object describes the symbol shown on the pattern of a unique gift. */
|
|
336
|
+
export interface UniqueGiftSymbol {
|
|
337
|
+
/** Name of the symbol */
|
|
338
|
+
name: string;
|
|
339
|
+
/** The sticker that represents the unique gift */
|
|
340
|
+
sticker: Sticker;
|
|
341
|
+
/** The number of unique gifts that receive this model for every 1000 gifts upgraded */
|
|
342
|
+
rarity_per_mille: number;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
/** This object describes the colors of the backdrop of a unique gift. */
|
|
346
|
+
export interface UniqueGiftBackdropColors {
|
|
347
|
+
/** The color in the center of the backdrop in RGB format */
|
|
348
|
+
center_color: number;
|
|
349
|
+
/** The color on the edges of the backdrop in RGB format */
|
|
350
|
+
edge_color: number;
|
|
351
|
+
/** The color to be applied to the symbol in RGB format */
|
|
352
|
+
symbol_color: number;
|
|
353
|
+
/** The color for the text on the backdrop in RGB format */
|
|
354
|
+
text_color: number;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
/** This object describes the backdrop of a unique gift. */
|
|
358
|
+
export interface UniqueGiftBackdrop {
|
|
359
|
+
/** Name of the backdrop */
|
|
360
|
+
name: string;
|
|
361
|
+
/** Colors of the backdrop */
|
|
362
|
+
colors: UniqueGiftBackdropColors;
|
|
363
|
+
/** The number of unique gifts that receive this backdrop for every 1000 gifts upgraded */
|
|
364
|
+
rarity_per_mille: number;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
/** This object describes a unique gift that was upgraded from a regular gift. */
|
|
368
|
+
export interface UniqueGift {
|
|
369
|
+
/** Human-readable name of the regular gift from which this unique gift was upgraded */
|
|
370
|
+
base_name: string;
|
|
371
|
+
/** Unique name of the gift. This name can be used in https://t.me/nft/... links and story areas */
|
|
372
|
+
name: string;
|
|
373
|
+
/** Unique number of the upgraded gift among gifts upgraded from the same regular gift */
|
|
374
|
+
number: number;
|
|
375
|
+
/** Model of the gift */
|
|
376
|
+
model: UniqueGiftModel;
|
|
377
|
+
/** Symbol of the gift */
|
|
378
|
+
symbol: UniqueGiftSymbol;
|
|
379
|
+
/** Backdrop of the gift */
|
|
380
|
+
backdrop: UniqueGiftBackdrop;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
/** Describes a service message about a regular gift that was sent or received. */
|
|
384
|
+
export interface GiftInfo {
|
|
385
|
+
/** Information about the gift */
|
|
386
|
+
gift: Gift;
|
|
387
|
+
/** Unique identifier of the received gift for the bot; only present for gifts received on behalf of business accounts */
|
|
388
|
+
owned_gift_id?: string;
|
|
389
|
+
/** Number of Telegram Stars that can be claimed by the receiver by converting the gift; omitted if conversion to Telegram Stars is impossible */
|
|
390
|
+
convert_star_count?: number;
|
|
391
|
+
/** Number of Telegram Stars that were prepaid by the sender for the ability to upgrade the gift */
|
|
392
|
+
prepaid_upgrade_star_count?: number;
|
|
393
|
+
/** True, if the gift can be upgraded to a unique gift */
|
|
394
|
+
can_be_upgraded?: true;
|
|
395
|
+
/** Text of the message that was added to the gift */
|
|
396
|
+
text?: string;
|
|
397
|
+
/** Special entities that appear in the text */
|
|
398
|
+
entities?: MessageEntity[];
|
|
399
|
+
/** True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them */
|
|
400
|
+
is_private?: true;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
/** Describes a service message about a unique gift that was sent or received. */
|
|
404
|
+
export interface UniqueGiftInfo {
|
|
405
|
+
/** Information about the gift */
|
|
406
|
+
gift: UniqueGift;
|
|
407
|
+
/** Origin of the gift. Currently, either “upgrade” or “transfer” */
|
|
408
|
+
origin: "upgrade" | "transfer";
|
|
409
|
+
/** Unique identifier of the received gift for the bot; only present for gifts received on behalf of business accounts */
|
|
410
|
+
owned_gift_id?: string;
|
|
411
|
+
/** Number of Telegram Stars that must be paid to transfer the gift; omitted if the bot cannot transfer the gift */
|
|
412
|
+
transfer_star_count?: number;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
/** Describes a service message about a change in the price of paid messages within a chat. */
|
|
416
|
+
export interface PaidMessagePriceChanged {
|
|
417
|
+
/** The new number of Telegram Stars that must be paid by non-administrator users of the supergroup chat for each sent message */
|
|
418
|
+
paid_message_star_count: number;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
/** Describes an amount of Telegram Stars. */
|
|
422
|
+
export interface StarAmount {
|
|
423
|
+
/** Integer amount of Telegram Stars, rounded to 0; can be negative */
|
|
424
|
+
amount: number;
|
|
425
|
+
/** The number of 1/1000000000 shares of Telegram Stars; from -999999999 to 999999999; can be negative if amount is negative */
|
|
426
|
+
nanostar_amount?: number;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
/** This object describes a gift received and owned by a user or a chat. Currently, it can be one of
|
|
430
|
+
- OwnedGiftRegular
|
|
431
|
+
- OwnedGiftUnique */
|
|
432
|
+
export type OwnedGift = OwnedGiftRegular | OwnedGiftUnique;
|
|
433
|
+
|
|
434
|
+
/** Describes a regular gift owned by a user or a chat. */
|
|
435
|
+
export interface OwnedGiftRegular {
|
|
436
|
+
/** Type of the gift, always “regular” */
|
|
437
|
+
type: "regular";
|
|
438
|
+
/** Information about the regular gift */
|
|
439
|
+
gift: Gift;
|
|
440
|
+
/** Unique identifier of the gift for the bot; for gifts received on behalf of business accounts only */
|
|
441
|
+
owned_gift_id?: string;
|
|
442
|
+
/** Sender of the gift if it is a known user */
|
|
443
|
+
sender_user?: User;
|
|
444
|
+
/** Date the gift was sent in Unix time */
|
|
445
|
+
send_date: number;
|
|
446
|
+
/** Text of the message that was added to the gift */
|
|
447
|
+
text?: string;
|
|
448
|
+
/** Special entities that appear in the text */
|
|
449
|
+
entities?: MessageEntity[];
|
|
450
|
+
/** True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them */
|
|
451
|
+
is_private?: true;
|
|
452
|
+
/** True, if the gift is displayed on the account's profile page; for gifts received on behalf of business accounts only */
|
|
453
|
+
is_saved?: true;
|
|
454
|
+
/** True, if the gift can be upgraded to a unique gift; for gifts received on behalf of business accounts only */
|
|
455
|
+
can_be_upgraded?: true;
|
|
456
|
+
/** True, if the gift was refunded and isn't available anymore */
|
|
457
|
+
was_refunded?: true;
|
|
458
|
+
/** Number of Telegram Stars that can be claimed by the receiver instead of the gift; omitted if the gift cannot be converted to Telegram Stars */
|
|
459
|
+
convert_star_count?: number;
|
|
460
|
+
/** Number of Telegram Stars that were paid by the sender for the ability to upgrade the gift */
|
|
461
|
+
prepaid_upgrade_star_count?: number;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
/** Describes a unique gift received and owned by a user or a chat. */
|
|
465
|
+
export interface OwnedGiftUnique {
|
|
466
|
+
/** Type of the gift, always “unique” */
|
|
467
|
+
type: "unique";
|
|
468
|
+
/** Information about the unique gift */
|
|
469
|
+
gift: UniqueGift;
|
|
470
|
+
/** Unique identifier of the received gift for the bot; for gifts received on behalf of business accounts only */
|
|
471
|
+
owned_gift_id?: string;
|
|
472
|
+
/** Sender of the gift if it is a known user */
|
|
473
|
+
sender_user?: User;
|
|
474
|
+
/** Date the gift was sent in Unix time */
|
|
475
|
+
send_date: number;
|
|
476
|
+
/** True, if the gift is displayed on the account's profile page; for gifts received on behalf of business accounts only */
|
|
477
|
+
is_saved?: true;
|
|
478
|
+
/** True, if the gift can be transferred to another owner; for gifts received on behalf of business accounts only */
|
|
479
|
+
can_be_transferred?: true;
|
|
480
|
+
/** Number of Telegram Stars that must be paid to transfer the gift; omitted if the bot cannot transfer the gift */
|
|
481
|
+
transfer_star_count?: number;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
/** Contains the list of gifts received and owned by a user or a chat. */
|
|
485
|
+
export interface OwnedGifts {
|
|
486
|
+
/** The total number of gifts owned by the user or the chat */
|
|
487
|
+
total_count: number;
|
|
488
|
+
/** The list of gifts */
|
|
489
|
+
gifts: OwnedGift[];
|
|
490
|
+
/** Offset for the next request. If empty, then there are no more results */
|
|
491
|
+
next_offset?: string;
|
|
492
|
+
}
|
package/src/manageTypes.d.ts
CHANGED
|
@@ -30,6 +30,18 @@ export interface WebhookInfo {
|
|
|
30
30
|
allowed_updates?: Array<Exclude<keyof Update, "update_id">>;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
/** This object describes the types of gifts that can be gifted to a user or a chat. */
|
|
34
|
+
export interface AcceptedGiftTypes {
|
|
35
|
+
/** True, if unlimited regular gifts are accepted */
|
|
36
|
+
unlimited_gifts: boolean;
|
|
37
|
+
/** True, if limited regular gifts are accepted */
|
|
38
|
+
limited_gifts: boolean;
|
|
39
|
+
/** True, if unique gifts or gifts that can be upgraded to unique for free are accepted */
|
|
40
|
+
unique_gifts: boolean;
|
|
41
|
+
/** True, if a Telegram Premium subscription is accepted */
|
|
42
|
+
premium_subscription: boolean;
|
|
43
|
+
}
|
|
44
|
+
|
|
33
45
|
/** This object represents a Telegram user or bot. */
|
|
34
46
|
export interface User {
|
|
35
47
|
/** Unique identifier for this user or bot. */
|
|
@@ -209,6 +221,8 @@ export declare namespace ChatFullInfo {
|
|
|
209
221
|
pinned_message?: Message;
|
|
210
222
|
/** Default chat member permissions, for groups and supergroups */
|
|
211
223
|
permissions?: undefined;
|
|
224
|
+
/** Information about types of gifts that are accepted by the chat or by the corresponding user for private chats */
|
|
225
|
+
accepted_gift_types: AcceptedGiftTypes;
|
|
212
226
|
/** For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds */
|
|
213
227
|
slow_mode_delay?: undefined;
|
|
214
228
|
/** For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions */
|
|
@@ -300,6 +314,8 @@ export declare namespace ChatFullInfo {
|
|
|
300
314
|
pinned_message?: Message;
|
|
301
315
|
/** Default chat member permissions, for groups and supergroups */
|
|
302
316
|
permissions?: ChatPermissions;
|
|
317
|
+
/** True, if gifts can be sent to the chat */
|
|
318
|
+
can_send_gift?: true;
|
|
303
319
|
/** For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds */
|
|
304
320
|
slow_mode_delay?: undefined;
|
|
305
321
|
/** For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions */
|
|
@@ -391,6 +407,8 @@ export declare namespace ChatFullInfo {
|
|
|
391
407
|
pinned_message?: Message;
|
|
392
408
|
/** Default chat member permissions, for groups and supergroups */
|
|
393
409
|
permissions?: ChatPermissions;
|
|
410
|
+
/** True, if gifts can be sent to the chat */
|
|
411
|
+
can_send_gift?: true;
|
|
394
412
|
/** For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds */
|
|
395
413
|
slow_mode_delay?: number;
|
|
396
414
|
/** For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions */
|
|
@@ -482,6 +500,8 @@ export declare namespace ChatFullInfo {
|
|
|
482
500
|
pinned_message?: Message;
|
|
483
501
|
/** Default chat member permissions, for groups and supergroups */
|
|
484
502
|
permissions?: undefined;
|
|
503
|
+
/** True, if gifts can be sent to the chat */
|
|
504
|
+
can_send_gift?: true;
|
|
485
505
|
/** For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds */
|
|
486
506
|
slow_mode_delay?: undefined;
|
|
487
507
|
/** For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions */
|
|
@@ -955,6 +975,37 @@ export interface UserChatBoosts {
|
|
|
955
975
|
boosts: ChatBoost[];
|
|
956
976
|
}
|
|
957
977
|
|
|
978
|
+
export interface BusinessBotRights {
|
|
979
|
+
/** True, if the bot can send and edit messages in the private chats that had incoming messages in the last 24 hours */
|
|
980
|
+
can_reply?: true;
|
|
981
|
+
/** True, if the bot can mark incoming private messages as read */
|
|
982
|
+
can_read_messages?: true;
|
|
983
|
+
/** True, if the bot can delete messages sent by the bot */
|
|
984
|
+
can_delete_outgoing_messages?: true;
|
|
985
|
+
/** True, if the bot can delete all private messages in managed chats */
|
|
986
|
+
can_delete_all_messages?: true;
|
|
987
|
+
/** True, if the bot can edit the first and last name of the business account */
|
|
988
|
+
can_edit_name?: true;
|
|
989
|
+
/** True, if the bot can edit the bio of the business account */
|
|
990
|
+
can_edit_bio?: true;
|
|
991
|
+
/** True, if the bot can edit the profile photo of the business account */
|
|
992
|
+
can_edit_profile_photo?: true;
|
|
993
|
+
/** True, if the bot can edit the username of the business account */
|
|
994
|
+
can_edit_username?: true;
|
|
995
|
+
/** True, if the bot can change the privacy settings pertaining to gifts for the business account */
|
|
996
|
+
can_change_gift_settings?: true;
|
|
997
|
+
/** True, if the bot can view gifts and the amount of Telegram Stars owned by the business account */
|
|
998
|
+
can_view_gifts_and_stars?: true;
|
|
999
|
+
/** True, if the bot can convert regular gifts owned by the business account to Telegram Stars */
|
|
1000
|
+
can_convert_gifts_to_stars?: true;
|
|
1001
|
+
/** True, if the bot can transfer and upgrade gifts owned by the business account */
|
|
1002
|
+
can_transfer_and_upgrade_gifts?: true;
|
|
1003
|
+
/** True, if the bot can transfer Telegram Stars received by the business account to its own account, or use them to upgrade and transfer gifts */
|
|
1004
|
+
can_transfer_stars?: true;
|
|
1005
|
+
/** True, if the bot can send, edit and delete stories on behalf of the business account */
|
|
1006
|
+
can_manage_stories?: true;
|
|
1007
|
+
}
|
|
1008
|
+
|
|
958
1009
|
/** Describes the connection of the bot with a business account. */
|
|
959
1010
|
export interface BusinessConnection {
|
|
960
1011
|
/** Unique identifier of the business connection */
|
|
@@ -965,8 +1016,8 @@ export interface BusinessConnection {
|
|
|
965
1016
|
user_chat_id: number;
|
|
966
1017
|
/** Date the connection was established in Unix time */
|
|
967
1018
|
date: number;
|
|
968
|
-
/**
|
|
969
|
-
|
|
1019
|
+
/** Rights of the business bot */
|
|
1020
|
+
rights?: BusinessBotRights;
|
|
970
1021
|
/** True, if the connection is active */
|
|
971
1022
|
is_enabled: boolean;
|
|
972
1023
|
}
|
package/src/messageTypes.d.ts
CHANGED
|
@@ -2,9 +2,12 @@ import type { Chat, User } from "./manageTypes";
|
|
|
2
2
|
import type { InlineKeyboardMarkup } from "./markupTypes";
|
|
3
3
|
import type { PassportData } from "./passportTypes";
|
|
4
4
|
import type {
|
|
5
|
+
GiftInfo,
|
|
5
6
|
Invoice,
|
|
7
|
+
PaidMessagePriceChanged,
|
|
6
8
|
RefundedPayment,
|
|
7
9
|
SuccessfulPayment,
|
|
10
|
+
UniqueGiftInfo,
|
|
8
11
|
} from "./invoiceTypes";
|
|
9
12
|
|
|
10
13
|
type MsgWith<P extends keyof Message> = Record<P, NonNullable<Message[P]>>;
|
|
@@ -61,6 +64,8 @@ export declare namespace Message {
|
|
|
61
64
|
link_preview_options?: LinkPreviewOptions;
|
|
62
65
|
/** Unique identifier of the message effect added to the message */
|
|
63
66
|
effect_id?: string;
|
|
67
|
+
/** The number of Telegram Stars that were paid by the sender of the message to send it */
|
|
68
|
+
paid_star_count?: number;
|
|
64
69
|
/** Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons. */
|
|
65
70
|
reply_markup?: InlineKeyboardMarkup;
|
|
66
71
|
}
|
|
@@ -267,6 +272,12 @@ export interface Message extends Message.MediaMessage {
|
|
|
267
272
|
giveaway_winners?: GiveawayWinners;
|
|
268
273
|
/** Service message: a giveaway without public winners was completed */
|
|
269
274
|
giveaway_completed?: GiveawayCompleted;
|
|
275
|
+
/** Service message: a regular gift was sent or received */
|
|
276
|
+
gift?: GiftInfo;
|
|
277
|
+
/** Service message: a unique gift was sent or received */
|
|
278
|
+
unique_gift?: UniqueGiftInfo;
|
|
279
|
+
/** Service message: the price for paid messages has changed in the chat */
|
|
280
|
+
paid_message_price_changed?: PaidMessagePriceChanged;
|
|
270
281
|
/** Service message: video chat scheduled */
|
|
271
282
|
video_chat_scheduled?: VideoChatScheduled;
|
|
272
283
|
/** Service message: video chat started */
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import type { ReactionType } from "./message.ts";
|
|
2
|
+
|
|
3
|
+
/** Describes the position of a clickable area within a story. */
|
|
4
|
+
export interface StoryAreaPosition {
|
|
5
|
+
/** The abscissa of the area's center, as a percentage of the media width */
|
|
6
|
+
x_percentage: number;
|
|
7
|
+
/** The ordinate of the area's center, as a percentage of the media height */
|
|
8
|
+
y_percentage: number;
|
|
9
|
+
/** The width of the area's rectangle, as a percentage of the media width */
|
|
10
|
+
width_percentage: number;
|
|
11
|
+
/** The height of the area's rectangle, as a percentage of the media height */
|
|
12
|
+
height_percentage: number;
|
|
13
|
+
/** The clockwise rotation angle of the rectangle, in degrees; 0-360 */
|
|
14
|
+
rotation_angle: number;
|
|
15
|
+
/** The radius of the rectangle corner rounding, as a percentage of the media width */
|
|
16
|
+
corner_radius_percentage: number;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** Describes the physical address of a location. */
|
|
20
|
+
export interface LocationAddress {
|
|
21
|
+
/** The two-letter ISO 3166-1 alpha-2 country code of the country where the location is located */
|
|
22
|
+
country_code: string;
|
|
23
|
+
/** State of the location */
|
|
24
|
+
state?: string;
|
|
25
|
+
/** City of the location */
|
|
26
|
+
city?: string;
|
|
27
|
+
/** Street address of the location */
|
|
28
|
+
street?: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** Describes the type of a clickable area on a story. Currently, it can be one of
|
|
32
|
+
|
|
33
|
+
- StoryAreaTypeLocation
|
|
34
|
+
- StoryAreaTypeSuggestedReaction
|
|
35
|
+
- StoryAreaTypeLink
|
|
36
|
+
- StoryAreaTypeWeather
|
|
37
|
+
- StoryAreaTypeUniqueGift */
|
|
38
|
+
export type StoryAreaType =
|
|
39
|
+
| StoryAreaTypeLocation
|
|
40
|
+
| StoryAreaTypeSuggestedReaction
|
|
41
|
+
| StoryAreaTypeLink
|
|
42
|
+
| StoryAreaTypeWeather
|
|
43
|
+
| StoryAreaTypeUniqueGift;
|
|
44
|
+
|
|
45
|
+
/** Describes a story area pointing to a location. Currently, a story can have up to 10 location areas. */
|
|
46
|
+
export interface StoryAreaTypeLocation {
|
|
47
|
+
/** Type of the area, always “location” */
|
|
48
|
+
type: "location";
|
|
49
|
+
/** Location latitude in degrees */
|
|
50
|
+
latitude: number;
|
|
51
|
+
/** Location longitude in degrees */
|
|
52
|
+
longitude: number;
|
|
53
|
+
/** Address of the location */
|
|
54
|
+
address?: LocationAddress;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** Describes a story area pointing to a suggested reaction. Currently, a story can have up to 5 suggested reaction areas. */
|
|
58
|
+
export interface StoryAreaTypeSuggestedReaction {
|
|
59
|
+
/** Type of the area, always “suggested_reaction” */
|
|
60
|
+
type: "suggested_reaction";
|
|
61
|
+
/** Type of the reaction */
|
|
62
|
+
reaction_type: ReactionType;
|
|
63
|
+
/** Pass True if the reaction area has a dark background */
|
|
64
|
+
is_dark?: boolean;
|
|
65
|
+
/** Pass True if reaction area corner is flipped */
|
|
66
|
+
is_flipped?: boolean;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/** Describes a story area pointing to an HTTP or tg:// link. Currently, a story can have up to 3 link areas. */
|
|
70
|
+
export interface StoryAreaTypeLink {
|
|
71
|
+
/** Type of the area, always “link” */
|
|
72
|
+
type: "link";
|
|
73
|
+
/** HTTP or tg:// URL to be opened when the area is clicked */
|
|
74
|
+
url: string;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** Describes a story area containing weather information. Currently, a story can have up to 3 weather areas. */
|
|
78
|
+
export interface StoryAreaTypeWeather {
|
|
79
|
+
/** Type of the area, always “weather” */
|
|
80
|
+
type: "weather";
|
|
81
|
+
/** Temperature, in degree Celsius */
|
|
82
|
+
temperature: number;
|
|
83
|
+
/** Emoji representing the weather */
|
|
84
|
+
emoji: string;
|
|
85
|
+
/** A color of the area background in the ARGB format */
|
|
86
|
+
background_color: number;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/** Describes a story area pointing to a unique gift. Currently, a story can have at most 1 unique gift area. */
|
|
90
|
+
export interface StoryAreaTypeUniqueGift {
|
|
91
|
+
/** Type of the area, always “unique_gift” */
|
|
92
|
+
type: "unique_gift";
|
|
93
|
+
/** Unique name of the gift */
|
|
94
|
+
name: string;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/** Describes a clickable area on a story media. */
|
|
98
|
+
export interface StoryArea {
|
|
99
|
+
/** Position of the area */
|
|
100
|
+
position: StoryAreaPosition;
|
|
101
|
+
/** Type of the area */
|
|
102
|
+
type: StoryAreaType;
|
|
103
|
+
}
|