nyx-bot-client 0.0.6 → 0.0.8

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.
@@ -23,4 +23,9 @@ export type AcceptedGiftTypes = {
23
23
  * True, if a Telegram Premium subscription is accepted
24
24
  */
25
25
  premium_subscription: boolean;
26
+
27
+ /**
28
+ * True, if transfers of unique gifts from channels are accepted
29
+ */
30
+ gifts_from_channels: boolean;
26
31
  };
package/@types/Chat.ts CHANGED
@@ -39,5 +39,10 @@ export type Chat = {
39
39
  /**
40
40
  * Optional. True, if the supergroup chat is a forum (has topics enabled)
41
41
  */
42
- is_forum?: boolean;
42
+ is_forum?: true;
43
+
44
+ /**
45
+ * Optional. True, if the chat is the direct messages chat of a channel
46
+ */
47
+ is_direct_messages?: true;
43
48
  };
@@ -81,4 +81,10 @@ export type ChatAdministratorRights = {
81
81
  * Optional. True, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only
82
82
  */
83
83
  can_manage_topics?: boolean;
84
+
85
+ /**
86
+ * Optional. True, if the administrator can manage direct messages of the channel and decline suggested posts; for
87
+ * channels only
88
+ */
89
+ can_manage_direct_messages?: boolean;
84
90
  };
@@ -10,6 +10,8 @@ import type {
10
10
  ChatPhoto,
11
11
  Message,
12
12
  ReactionType,
13
+ UniqueGiftColors,
14
+ UserRating,
13
15
  } from "./";
14
16
 
15
17
  /**
@@ -53,7 +55,12 @@ export type ChatFullInfo = {
53
55
  /**
54
56
  * Optional. True, if the supergroup chat is a forum (has topics enabled)
55
57
  */
56
- is_forum?: boolean;
58
+ is_forum?: true;
59
+
60
+ /**
61
+ * Optional. True, if the chat is the direct messages chat of a channel
62
+ */
63
+ is_direct_messages?: true;
57
64
 
58
65
  /**
59
66
  * Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link
@@ -101,6 +108,11 @@ export type ChatFullInfo = {
101
108
  */
102
109
  personal_chat?: Chat;
103
110
 
111
+ /**
112
+ * Optional. Information about the corresponding channel chat; for direct messages chats only
113
+ */
114
+ parent_chat?: Chat;
115
+
104
116
  /**
105
117
  * Optional. List of available reactions allowed in the chat. If omitted, then all emoji reactions are allowed.
106
118
  */
@@ -257,4 +269,20 @@ export type ChatFullInfo = {
257
269
  * Optional. For supergroups, the location to which the supergroup is connected
258
270
  */
259
271
  location?: ChatLocation;
272
+
273
+ /**
274
+ * Optional. For private chats, the rating of the user if any
275
+ */
276
+ rating?: UserRating;
277
+
278
+ /**
279
+ * Optional. The color scheme based on a unique gift that must be used for the chat's name, message replies and
280
+ * link previews
281
+ */
282
+ unique_gift_colors?: UniqueGiftColors;
283
+
284
+ /**
285
+ * Optional. The number of Telegram Stars a general user have to pay to send a message to the chat
286
+ */
287
+ paid_message_star_count?: number;
260
288
  };
@@ -83,22 +83,28 @@ export type ChatMemberAdministrator = {
83
83
  * Optional. True, if the administrator can post messages in the channel, or access channel statistics; for channels
84
84
  * only
85
85
  */
86
- can_post_messages: boolean;
86
+ can_post_messages?: boolean;
87
87
 
88
88
  /**
89
89
  * Optional. True, if the administrator can edit messages of other users and can pin messages; for channels only
90
90
  */
91
- can_edit_messages: boolean;
91
+ can_edit_messages?: boolean;
92
92
 
93
93
  /**
94
94
  * Optional. True, if the user is allowed to pin messages; for groups and supergroups only
95
95
  */
96
- can_pin_messages: boolean;
96
+ can_pin_messages?: boolean;
97
97
 
98
98
  /**
99
99
  * Optional. True, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only
100
100
  */
101
- can_manage_topics: boolean;
101
+ can_manage_topics?: boolean;
102
+
103
+ /**
104
+ * Optional. True, if the administrator can manage direct messages of the channel and decline suggested posts; for
105
+ * channels only
106
+ */
107
+ can_manage_direct_messages?: boolean;
102
108
 
103
109
  /**
104
110
  * Optional. Custom title for this user
@@ -1,4 +1,4 @@
1
- import type { MessageEntity, User } from "./";
1
+ import type { Chat, MessageEntity, User } from "./";
2
2
 
3
3
  /**
4
4
  * ## ChecklistTask
@@ -22,10 +22,15 @@ export type ChecklistTask = {
22
22
  text_entities?: MessageEntity[];
23
23
 
24
24
  /**
25
- * Optional. User that completed the task; omitted if the task wasn't completed
25
+ * Optional. User that completed the task; omitted if the task wasn't completed by a user
26
26
  */
27
27
  completed_by_user?: User;
28
28
 
29
+ /**
30
+ * Optional. Chat that completed the task; omitted if the task wasn't completed by a chat
31
+ */
32
+ completed_by_chat?: Chat;
33
+
29
34
  /**
30
35
  * Optional. Point in time (Unix timestamp) when the task was completed; 0 if the task wasn't completed
31
36
  */
@@ -0,0 +1,20 @@
1
+ import type { User } from "./User";
2
+
3
+ /**
4
+ * ## DirectMessagesTopic
5
+ * Describes a topic of a direct messages chat.
6
+ * @see https://core.telegram.org/bots/api#directmessagestopic
7
+ */
8
+ export type DirectMessagesTopic = {
9
+ /**
10
+ * Unique identifier of the topic. This number may have more than 32 significant bits and some programming languages
11
+ * may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer
12
+ * or double-precision float type are safe for storing this identifier.
13
+ */
14
+ topic_id: number;
15
+
16
+ /**
17
+ * Optional. Information about the user that created the topic. Currently, it is always present
18
+ */
19
+ user?: User;
20
+ };
@@ -23,4 +23,10 @@ export type ForumTopic = {
23
23
  * Optional. Unique identifier of the custom emoji shown as the topic icon
24
24
  */
25
25
  icon_custom_emoji_id?: string;
26
+
27
+ /**
28
+ * Optional. True, if the name of the topic wasn't specified explicitly by its creator and likely needs to be changed
29
+ * by the bot
30
+ */
31
+ is_name_implicit?: true;
26
32
  };
@@ -18,4 +18,10 @@ export type ForumTopicCreated = {
18
18
  * Optional. Unique identifier of the custom emoji shown as the topic icon
19
19
  */
20
20
  icon_custom_emoji_id: string;
21
+
22
+ /**
23
+ * Optional. True, if the name of the topic wasn't specified explicitly by its creator and likely needs to be changed
24
+ * by the bot
25
+ */
26
+ is_name_implicit?: true;
21
27
  };
package/@types/Gift.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Sticker } from "./";
1
+ import type { Chat, GiftBackground, Sticker } from "./";
2
2
 
3
3
  /**
4
4
  * ## Gift
@@ -26,6 +26,16 @@ export type Gift = {
26
26
  */
27
27
  upgrade_star_count?: number;
28
28
 
29
+ /**
30
+ * Optional. True, if the gift can only be purchased by Telegram Premium subscribers
31
+ */
32
+ is_premium?: true;
33
+
34
+ /**
35
+ * Optional. True, if the gift can be used (after being upgraded) to customize a user's appearance
36
+ */
37
+ has_colors?: true;
38
+
29
39
  /**
30
40
  * Optional. The total number of the gifts of this type that can be sent; for limited gifts only
31
41
  */
@@ -35,4 +45,29 @@ export type Gift = {
35
45
  * Optional. The number of remaining gifts of this type that can be sent; for limited gifts only
36
46
  */
37
47
  remaining_count?: number;
48
+
49
+ /**
50
+ * Optional. The total number of gifts of this type that can be sent by the bot; for limited gifts only
51
+ */
52
+ personal_total_count?: number;
53
+
54
+ /**
55
+ * Optional. The number of remaining gifts of this type that can be sent by the bot; for limited gifts only
56
+ */
57
+ personal_remaining_count?: number;
58
+
59
+ /**
60
+ * Optional. Background of the gift
61
+ */
62
+ background?: GiftBackground;
63
+
64
+ /**
65
+ * Optional. The total number of different unique gifts that can be obtained by upgrading the gift
66
+ */
67
+ unique_gift_variant_count?: number;
68
+
69
+ /**
70
+ * Optional. Information about the chat that published the gift
71
+ */
72
+ publisher_chat?: Chat;
38
73
  };
@@ -0,0 +1,21 @@
1
+ /**
2
+ * ## GiftBackground
3
+ * This object describes the background of a gift.
4
+ * @see https://core.telegram.org/bots/api#giftbackground
5
+ */
6
+ export type GiftBackground = {
7
+ /**
8
+ * Center color of the background in RGB format
9
+ */
10
+ center_color: number;
11
+
12
+ /**
13
+ * Edge color of the background in RGB format
14
+ */
15
+ edge_color: number;
16
+
17
+ /**
18
+ * Text color of the background in RGB format
19
+ */
20
+ text_color: number;
21
+ };
@@ -29,6 +29,11 @@ export type GiftInfo = {
29
29
  */
30
30
  prepaid_upgrade_star_count?: number;
31
31
 
32
+ /**
33
+ * Optional. True, if the gift's upgrade was purchased after the gift was sent
34
+ */
35
+ is_upgrade_separate?: true;
36
+
32
37
  /**
33
38
  * Optional. True, if the gift can be upgraded to a unique gift
34
39
  */
@@ -49,4 +54,9 @@ export type GiftInfo = {
49
54
  * receiver; otherwise, everyone will be able to see them
50
55
  */
51
56
  is_private?: true;
57
+
58
+ /**
59
+ * Optional. Unique number reserved for this gift when upgraded. See the number field in UniqueGift
60
+ */
61
+ unique_gift_number?: number;
52
62
  };
package/@types/Message.ts CHANGED
@@ -11,6 +11,7 @@ import type {
11
11
  Contact,
12
12
  Dice,
13
13
  DirectMessagePriceChanged,
14
+ DirectMessagesTopic,
14
15
  Document,
15
16
  ExternalReplyInfo,
16
17
  ForumTopicClosed,
@@ -43,6 +44,11 @@ import type {
43
44
  Sticker,
44
45
  Story,
45
46
  SuccessfulPayment,
47
+ SuggestedPostApprovalFailed,
48
+ SuggestedPostDeclined,
49
+ SuggestedPostInfo,
50
+ SuggestedPostPaid,
51
+ SuggestedPostRefunded,
46
52
  TextQuote,
47
53
  UniqueGiftInfo,
48
54
  User,
@@ -71,10 +77,16 @@ export type Message = {
71
77
  message_id: number;
72
78
 
73
79
  /**
74
- * Optional. Unique identifier of a message thread to which the message belongs; for supergroups only
80
+ * Optional. Unique identifier of a message thread or forum topic to which the message belongs; for supergroups and
81
+ * private chats only
75
82
  */
76
83
  message_thread_id?: number;
77
84
 
85
+ /**
86
+ * Optional. Information about the direct messages chat topic that contains the message
87
+ */
88
+ direct_messages_topic?: DirectMessagesTopic;
89
+
78
90
  /**
79
91
  * Optional. Sender of the message; may be empty for messages sent to channels. For backward compatibility, if the
80
92
  * message was sent on behalf of a chat, the field contains a fake sender user in non-channel chats
@@ -123,7 +135,7 @@ export type Message = {
123
135
  forward_origin?: MessageOrigin;
124
136
 
125
137
  /**
126
- * Optional. True, if the message is sent to a forum topic
138
+ * Optional. True, if the message is sent to a topic in a forum supergroup or a private chat with the bot
127
139
  */
128
140
  is_topic_message?: boolean;
129
141
 
@@ -153,6 +165,11 @@ export type Message = {
153
165
  */
154
166
  reply_to_story?: Story;
155
167
 
168
+ /**
169
+ * Optional. Identifier of the specific checklist task that is being replied to
170
+ */
171
+ reply_to_checklist_task_id?: number;
172
+
156
173
  /**
157
174
  * Optional. Bot through which the message was sent
158
175
  */
@@ -166,13 +183,19 @@ export type Message = {
166
183
  /**
167
184
  * Optional. True, if the message can't be forwarded
168
185
  */
169
- has_protected_content?: boolean;
186
+ has_protected_content?: true;
170
187
 
171
188
  /**
172
189
  * Optional. True, if the message was sent by an implicit action, for example, as an away or a greeting business
173
190
  * message, or as a scheduled message
174
191
  */
175
- is_from_offline?: boolean;
192
+ is_from_offline?: true;
193
+
194
+ /**
195
+ * Optional. True, if the message is a paid post. Note that such posts must not be deleted for 24 hours to receive the
196
+ * payment and can't be edited.
197
+ */
198
+ is_paid_post?: true;
176
199
 
177
200
  /**
178
201
  * Optional. The unique identifier of a media message group this message belongs to
@@ -206,6 +229,12 @@ export type Message = {
206
229
  */
207
230
  link_preview_options?: LinkPreviewOptions;
208
231
 
232
+ /**
233
+ * Optional. Information about suggested post parameters if the message is a suggested post in a channel direct
234
+ * messages chat. If the message is an approved or declined suggested post, then it can't be edited.
235
+ */
236
+ suggested_post_info?: SuggestedPostInfo;
237
+
209
238
  /**
210
239
  * Optional. Unique identifier of the message effect added to the message
211
240
  */
@@ -426,6 +455,11 @@ export type Message = {
426
455
  */
427
456
  unique_gift?: UniqueGiftInfo;
428
457
 
458
+ /**
459
+ * Optional. Service message: upgrade of a gift was purchased after the gift was sent
460
+ */
461
+ gift_upgrade_sent?: GiftInfo;
462
+
429
463
  /**
430
464
  * Optional. The domain name of the website on which the user has logged in. [More about Telegram Login](https://core.telegram.org/widgets/login)
431
465
  */
@@ -530,6 +564,31 @@ export type Message = {
530
564
  */
531
565
  paid_message_price_changed?: PaidMessagePriceChanged;
532
566
 
567
+ /**
568
+ * Optional. Service message: a suggested post was approved
569
+ */
570
+ suggested_post_approved?: SuggestedPostInfo;
571
+
572
+ /**
573
+ * Optional. Service message: approval of a suggested post has failed
574
+ */
575
+ suggested_post_approval_failed?: SuggestedPostApprovalFailed;
576
+
577
+ /**
578
+ * Optional. Service message: a suggested post was declined
579
+ */
580
+ suggested_post_declined?: SuggestedPostDeclined;
581
+
582
+ /**
583
+ * Optional. Service message: payment for a suggested post was received
584
+ */
585
+ suggested_post_paid?: SuggestedPostPaid;
586
+
587
+ /**
588
+ * Optional. Service message: payment for a suggested post was refunded
589
+ */
590
+ suggested_post_refunded?: SuggestedPostRefunded;
591
+
533
592
  /**
534
593
  * Optional. Service message: video chat scheduled
535
594
  */
@@ -563,35 +622,69 @@ export type Message = {
563
622
 
564
623
  export const messageTypes = [
565
624
  "text",
625
+ "suggested_post_info",
566
626
  "animation",
567
627
  "audio",
568
- "contact",
569
- "dice",
570
628
  "document",
571
- "game",
572
- "invoice",
573
- "location",
574
- "passport_data",
629
+ "paid_media",
575
630
  "photo",
576
- "pinned_message",
577
- "poll",
578
631
  "sticker",
632
+ "story",
579
633
  "video",
580
634
  "video_note",
581
635
  "voice",
582
- "successful_payment",
583
- "refunded_payment",
584
- "migrate_from_chat_id",
585
- "migrate_to_chat_id",
636
+ "checklist",
637
+ "contact",
638
+ "dice",
639
+ "game",
640
+ "poll",
641
+ "venue",
642
+ "location",
586
643
  "new_chat_members",
587
- "new_chat_photo",
588
- "new_chat_title",
589
644
  "left_chat_member",
645
+ "new_chat_title",
646
+ "new_chat_photo",
590
647
  "delete_chat_photo",
591
648
  "group_chat_created",
592
649
  "supergroup_chat_created",
593
650
  "channel_chat_created",
594
651
  "message_auto_delete_timer_changed",
652
+ "migrate_to_chat_id",
653
+ "migrate_from_chat_id",
654
+ "pinned_message",
655
+ "invoice",
656
+ "successful_payment",
657
+ "refunded_payment",
658
+ "users_shared",
659
+ "chat_shared",
660
+ "gift",
661
+ "unique_gift",
662
+ "gift_upgrade_sent",
663
+ "connected_website",
664
+ "write_access_allowed",
665
+ "passport_data",
666
+ "proximity_alert_triggered",
667
+ "boost_added",
668
+ "chat_background_set",
669
+ "checklist_tasks_done",
670
+ "checklist_tasks_added",
671
+ "direct_message_price_changed",
672
+ "forum_topic_created",
673
+ "forum_topic_edited",
674
+ "forum_topic_closed",
675
+ "forum_topic_reopened",
676
+ "general_forum_topic_hidden",
677
+ "general_forum_topic_unhidden",
678
+ "giveaway_created",
679
+ "giveaway",
680
+ "giveaway_winners",
681
+ "giveaway_completed",
682
+ "paid_message_price_changed",
683
+ "suggested_post_approved",
684
+ "suggested_post_approval_failed",
685
+ "suggested_post_declined",
686
+ "suggested_post_paid",
687
+ "suggested_post_refunded",
595
688
  "video_chat_scheduled",
596
689
  "video_chat_started",
597
690
  "video_chat_ended",
@@ -74,4 +74,15 @@ export type OwnedGiftRegular = {
74
74
  * Optional. Number of Telegram Stars that were paid by the sender for the ability to upgrade the gift
75
75
  */
76
76
  prepaid_upgrade_star_count?: number;
77
+
78
+ /**
79
+ * Optional. True, if the gift's upgrade was purchased after the gift was sent; for gifts received on behalf of
80
+ * business accounts only
81
+ */
82
+ is_upgrade_separate?: true;
83
+
84
+ /**
85
+ * Optional. Unique number reserved for this gift when upgraded. See the number field in UniqueGift
86
+ */
87
+ unique_gift_number?: number;
77
88
  };
@@ -41,8 +41,14 @@ export type ReplyParameters = {
41
41
  * quote_parse_mode.
42
42
  */
43
43
  quote_entities?: string; // todo: JSON Array of MessageEntity
44
+
44
45
  /**
45
46
  * Optional. Position of the quote in the original message in UTF-16 code units
46
47
  */
47
48
  quote_position?: number;
49
+
50
+ /**
51
+ * Optional. Identifier of the specific checklist task to be replied to
52
+ */
53
+ checklist_task_id?: number;
48
54
  };
package/@types/Sticker.ts CHANGED
@@ -38,6 +38,11 @@ export type Sticker = {
38
38
  */
39
39
  is_animated: boolean;
40
40
 
41
+ /**
42
+ * True, if the sticker is a video sticker
43
+ */
44
+ is_video: boolean;
45
+
41
46
  /**
42
47
  * True, if the sticker is a video sticker
43
48
  */
@@ -0,0 +1,20 @@
1
+ import type { Message, SuggestedPostPrice } from "./";
2
+
3
+ /**
4
+ * ## SuggestedPostApprovalFailed
5
+ * Describes a service message about the failed approval of a suggested post. Currently, only caused by insufficient
6
+ * user funds at the time of approval.
7
+ * @see https://core.telegram.org/bots/api#suggestedpostapprovalfailed
8
+ */
9
+ export type SuggestedPostApprovalFailed = {
10
+ /**
11
+ * Optional. Message containing the suggested post whose approval has failed. Note that the Message object in this
12
+ * field will not contain the reply_to_message field even if it itself is a reply.
13
+ */
14
+ suggested_post_message?: Message;
15
+
16
+ /**
17
+ * Expected price of the post
18
+ */
19
+ price?: SuggestedPostPrice;
20
+ };
@@ -0,0 +1,24 @@
1
+ import type { Message, SuggestedPostPrice } from "./";
2
+
3
+ /**
4
+ * ## SuggestedPostApproved
5
+ * Describes a service message about the approval of a suggested post.
6
+ * @see https://core.telegram.org/bots/api#suggestedpostapproved
7
+ */
8
+ export type SuggestedPostApproved = {
9
+ /**
10
+ * Optional. Message containing the suggested post. Note that the Message object in this field will not contain the
11
+ * reply_to_message field even if it itself is a reply.
12
+ */
13
+ suggested_post_message?: Message;
14
+
15
+ /**
16
+ * Optional. Amount paid for the post
17
+ */
18
+ price?: SuggestedPostPrice;
19
+
20
+ /**
21
+ * Date when the post will be published
22
+ */
23
+ send_date: number;
24
+ };
@@ -0,0 +1,19 @@
1
+ import type { Message } from "./";
2
+
3
+ /**
4
+ * ## SuggestedPostDeclined
5
+ * Describes a service message about the rejection of a suggested post.
6
+ * @see https://core.telegram.org/bots/api#suggestedpostdeclined
7
+ */
8
+ export type SuggestedPostDeclined = {
9
+ /**
10
+ * Optional. Message containing the suggested post. Note that the Message object in this field will not contain the
11
+ * reply_to_message field even if it itself is a reply.
12
+ */
13
+ suggested_post_message?: Message;
14
+
15
+ /**
16
+ * Optional. Comment with which the post was declined
17
+ */
18
+ comment?: string;
19
+ };
@@ -0,0 +1,24 @@
1
+ import type { SuggestedPostPrice } from "./";
2
+
3
+ /**
4
+ * ## SuggestedPostInfo
5
+ * Contains information about a suggested post.
6
+ * @see https://core.telegram.org/bots/api#suggestedpostinfo
7
+ */
8
+ export type SuggestedPostInfo = {
9
+ /**
10
+ * State of the suggested post. Currently, it can be one of “pending”, “approved”, “declined”.
11
+ */
12
+ state: "pending" | "approved" | "declined";
13
+
14
+ /**
15
+ * Optional. Proposed price of the post. If the field is omitted, then the post is unpaid.
16
+ */
17
+ price?: SuggestedPostPrice;
18
+
19
+ /**
20
+ * Optional. Proposed send date of the post. If the field is omitted, then the post can be published at any time
21
+ * within 30 days at the sole discretion of the user or administrator who approves it.
22
+ */
23
+ send_date?: number;
24
+ };
@@ -0,0 +1,30 @@
1
+ import type { Message, StarAmount } from "./";
2
+
3
+ /**
4
+ * ## SuggestedPostPaid
5
+ * Describes a service message about a successful payment for a suggested post.
6
+ * @see https://core.telegram.org/bots/api#suggestedpostpaid
7
+ */
8
+ export type SuggestedPostPaid = {
9
+ /**
10
+ * Optional. Message containing the suggested post. Note that the Message object in this field will not contain the
11
+ * reply_to_message field even if it itself is a reply.
12
+ */
13
+ suggested_post_message: Message;
14
+
15
+ /**
16
+ * Currency in which the payment was made. Currently, one of “XTR” for Telegram Stars or “TON” for toncoins
17
+ */
18
+ currency: "XTR" | "TON";
19
+
20
+ /**
21
+ * Optional. The amount of the currency that was received by the channel in nanotoncoins; for payments in toncoins
22
+ * only
23
+ */
24
+ amount?: number;
25
+
26
+ /**
27
+ * Optional. The amount of Telegram Stars that was received by the channel; for payments in Telegram Stars only
28
+ */
29
+ star_amount?: StarAmount;
30
+ };