nyx-bot-client 0.0.5 → 0.0.7
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/@types/AcceptedGiftTypes.ts +5 -0
- package/@types/Chat.ts +6 -1
- package/@types/ChatAdministratorRights.ts +6 -0
- package/@types/ChatFullInfo.ts +29 -1
- package/@types/ChatMemberAdministrator.ts +10 -4
- package/@types/ChecklistTask.ts +7 -2
- package/@types/DirectMessagesTopic.ts +20 -0
- package/@types/ForumTopic.ts +6 -0
- package/@types/ForumTopicCreated.ts +6 -0
- package/@types/Gift.ts +36 -1
- package/@types/GiftBackground.ts +21 -0
- package/@types/GiftInfo.ts +10 -0
- package/@types/Message.ts +111 -18
- package/@types/OwnedGiftRegular.ts +11 -0
- package/@types/ReplyParameters.ts +6 -0
- package/@types/Sticker.ts +5 -0
- package/@types/SuggestedPostApprovalFailed.ts +20 -0
- package/@types/SuggestedPostApproved.ts +24 -0
- package/@types/SuggestedPostDeclined.ts +19 -0
- package/@types/SuggestedPostInfo.ts +24 -0
- package/@types/SuggestedPostPaid.ts +30 -0
- package/@types/SuggestedPostParameters.ts +20 -0
- package/@types/SuggestedPostPrice.ts +18 -0
- package/@types/SuggestedPostRefunded.ts +20 -0
- package/@types/UniqueGift.ts +33 -1
- package/@types/UniqueGiftColors.ts +37 -0
- package/@types/UniqueGiftInfo.ts +10 -3
- package/@types/User.ts +5 -0
- package/@types/UserRating.ts +27 -0
- package/@types/index.ts +11 -0
- package/biome.json +1 -1
- package/bun.lock +20 -21
- package/nyx-client.ts +12 -9
- package/package.json +6 -6
- package/utils/methods.ts +114 -0
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?:
|
|
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
|
};
|
package/@types/ChatFullInfo.ts
CHANGED
|
@@ -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?:
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
package/@types/ChecklistTask.ts
CHANGED
|
@@ -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
|
+
};
|
package/@types/ForumTopic.ts
CHANGED
|
@@ -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
|
+
};
|
package/@types/GiftInfo.ts
CHANGED
|
@@ -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
|
|
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
|
|
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?:
|
|
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?:
|
|
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
|
-
"
|
|
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
|
-
"
|
|
583
|
-
"
|
|
584
|
-
"
|
|
585
|
-
"
|
|
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
|
@@ -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
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { SuggestedPostPrice } from "./";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## SuggestedPostParameters
|
|
5
|
+
* Contains parameters of a post that is being suggested by the bot.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#suggestedpostparameters
|
|
7
|
+
*/
|
|
8
|
+
export type SuggestedPostParameters = {
|
|
9
|
+
/**
|
|
10
|
+
* Optional. Proposed price for the post. If the field is omitted, then the post is unpaid.
|
|
11
|
+
*/
|
|
12
|
+
price?: SuggestedPostPrice;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Optional. Proposed send date of the post. If specified, then the date must be between 300 second and 2678400
|
|
16
|
+
* seconds (30 days) in the future. If the field is omitted, then the post can be published at any time within 30 days
|
|
17
|
+
* at the sole discretion of the user who approves it.
|
|
18
|
+
*/
|
|
19
|
+
send_date?: number;
|
|
20
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## SuggestedPostPrice
|
|
3
|
+
* Describes the price of a suggested post.
|
|
4
|
+
* @see https://core.telegram.org/bots/api#suggestedpostprice
|
|
5
|
+
*/
|
|
6
|
+
export type SuggestedPostPrice = {
|
|
7
|
+
/**
|
|
8
|
+
* Currency in which the post will be paid. Currently, must be one of “XTR” for Telegram Stars or “TON” for toncoins
|
|
9
|
+
*/
|
|
10
|
+
currency: "XTR" | "TON";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The amount of the currency that will be paid for the post in the smallest units of the currency, i.e. Telegram
|
|
14
|
+
* Stars or nanotoncoins. Currently, price in Telegram Stars must be between 5 and 100000, and price in nanotoncoins
|
|
15
|
+
* must be between 10000000 and 10000000000000.
|
|
16
|
+
*/
|
|
17
|
+
amount: number;
|
|
18
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Message } from "./";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## SuggestedPostRefunded
|
|
5
|
+
* Describes a service message about a payment refund for a suggested post.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#suggestedpostrefunded
|
|
7
|
+
*/
|
|
8
|
+
export type SuggestedPostRefunded = {
|
|
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
|
+
* Reason for the refund. Currently, one of “post_deleted” if the post was deleted within 24 hours of being posted or
|
|
17
|
+
* removed from scheduled messages without being posted, or “payment_refunded” if the payer refunded their payment.
|
|
18
|
+
*/
|
|
19
|
+
reason: string;
|
|
20
|
+
};
|
package/@types/UniqueGift.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
Chat,
|
|
3
|
+
UniqueGiftBackdrop,
|
|
4
|
+
UniqueGiftColors,
|
|
5
|
+
UniqueGiftModel,
|
|
6
|
+
UniqueGiftSymbol,
|
|
7
|
+
} from "./";
|
|
2
8
|
|
|
3
9
|
/**
|
|
4
10
|
* ## UniqueGift
|
|
@@ -6,6 +12,11 @@ import type { UniqueGiftBackdrop, UniqueGiftModel, UniqueGiftSymbol } from "./";
|
|
|
6
12
|
* @see https://core.telegram.org/bots/api#uniquegift
|
|
7
13
|
*/
|
|
8
14
|
export type UniqueGift = {
|
|
15
|
+
/**
|
|
16
|
+
* Identifier of the regular gift from which the gift was upgraded
|
|
17
|
+
*/
|
|
18
|
+
gift_id: string;
|
|
19
|
+
|
|
9
20
|
/**
|
|
10
21
|
* Human-readable name of the regular gift from which this unique gift was upgraded
|
|
11
22
|
*/
|
|
@@ -35,4 +46,25 @@ export type UniqueGift = {
|
|
|
35
46
|
* Backdrop of the gift
|
|
36
47
|
*/
|
|
37
48
|
backdrop: UniqueGiftBackdrop;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Optional. True, if the original regular gift was exclusively purchaseable by Telegram Premium subscribers
|
|
52
|
+
*/
|
|
53
|
+
is_premium?: true;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Optional. True, if the gift is assigned from the TON blockchain and can't be resold or transferred in Telegram
|
|
57
|
+
*/
|
|
58
|
+
is_from_blockchain?: true;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Optional. The color scheme that can be used by the gift's owner for the chat's name, replies to messages and
|
|
62
|
+
* link previews; for business account gifts and gifts that are currently on sale only
|
|
63
|
+
*/
|
|
64
|
+
colors?: UniqueGiftColors;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Optional. Information about the chat that published the gift
|
|
68
|
+
*/
|
|
69
|
+
publisher_chat?: Chat;
|
|
38
70
|
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## UniqueGiftColors
|
|
3
|
+
* This object contains information about the color scheme for a user's name,
|
|
4
|
+
* message replies and link previews based on a unique gift.
|
|
5
|
+
* @see https://core.telegram.org/bots/api#uniquegiftcolors
|
|
6
|
+
*/
|
|
7
|
+
export type UniqueGiftColors = {
|
|
8
|
+
/**
|
|
9
|
+
* Custom emoji identifier of the unique gift's model
|
|
10
|
+
*/
|
|
11
|
+
model_custom_emoji_id: string;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Custom emoji identifier of the unique gift's symbol
|
|
15
|
+
*/
|
|
16
|
+
symbol_custom_emoji_id: string;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Main color used in light themes; RGB format
|
|
20
|
+
*/
|
|
21
|
+
light_theme_main_color: number;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* List of 1-3 additional colors used in light themes; RGB format
|
|
25
|
+
*/
|
|
26
|
+
light_theme_other_colors: number[];
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Main color used in dark themes; RGB format
|
|
30
|
+
*/
|
|
31
|
+
dark_theme_main_color: number;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* List of 1-3 additional colors used in dark themes; RGB format
|
|
35
|
+
*/
|
|
36
|
+
dark_theme_other_colors: number[];
|
|
37
|
+
};
|
package/@types/UniqueGiftInfo.ts
CHANGED
|
@@ -13,14 +13,21 @@ export type UniqueGiftInfo = {
|
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Origin of the gift. Currently, either "upgrade" for gifts upgraded from regular gifts, "transfer" for gifts
|
|
16
|
-
* transferred from other users or channels,
|
|
16
|
+
* transferred from other users or channels, "resale" for gifts bought from other users, "gifted_upgrade" for
|
|
17
|
+
* upgrades purchased after the gift was sent, or "offer" for gifts bought or sold through gift purchase offers
|
|
17
18
|
*/
|
|
18
19
|
origin: string;
|
|
19
20
|
|
|
20
21
|
/**
|
|
21
|
-
* Optional. For gifts bought from other users, the
|
|
22
|
+
* Optional. For gifts bought from other users, the currency in which the payment for the gift was done.
|
|
23
|
+
* Currently, one of "XTR" for Telegram Stars or "TON" for toncoins.
|
|
22
24
|
*/
|
|
23
|
-
|
|
25
|
+
last_resale_currency?: string;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Optional. For gifts bought from other users, the price paid for the gift in either Telegram Stars or nanotoncoins
|
|
29
|
+
*/
|
|
30
|
+
last_resale_amount?: number;
|
|
24
31
|
|
|
25
32
|
/**
|
|
26
33
|
* Optional. Unique identifier of the received gift for the bot; only present for gifts received on behalf of
|
package/@types/User.ts
CHANGED
|
@@ -71,4 +71,9 @@ export type User = {
|
|
|
71
71
|
* Optional. True, if the bot has a main Web App. Returned only in getMe.
|
|
72
72
|
*/
|
|
73
73
|
has_main_web_app?: boolean;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Optional. True, if the bot has forum topic mode enabled in private chats. Returned only in getMe.
|
|
77
|
+
*/
|
|
78
|
+
has_topics_enabled?: boolean;
|
|
74
79
|
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## UserRating
|
|
3
|
+
* This object describes the rating of a user based on their Telegram Star spendings.
|
|
4
|
+
* @see https://core.telegram.org/bots/api#userrating
|
|
5
|
+
*/
|
|
6
|
+
export type UserRating = {
|
|
7
|
+
/**
|
|
8
|
+
* Current level of the user, indicating their reliability when purchasing digital goods and services.
|
|
9
|
+
* A higher level suggests a more trustworthy customer; a negative level is likely reason for concern.
|
|
10
|
+
*/
|
|
11
|
+
level: number;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Numerical value of the user's rating; the higher the rating, the better
|
|
15
|
+
*/
|
|
16
|
+
rating: number;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* The rating value required to get the current level
|
|
20
|
+
*/
|
|
21
|
+
current_level_rating: number;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Optional. The rating value required to get to the next level; omitted if the maximum level was reached
|
|
25
|
+
*/
|
|
26
|
+
next_level_rating?: number;
|
|
27
|
+
};
|
package/@types/index.ts
CHANGED
|
@@ -68,6 +68,7 @@ export * from "./Contact";
|
|
|
68
68
|
export * from "./CopyTextButton";
|
|
69
69
|
export * from "./Dice";
|
|
70
70
|
export * from "./DirectMessagePriceChanged";
|
|
71
|
+
export * from "./DirectMessagesTopic";
|
|
71
72
|
export * from "./Document";
|
|
72
73
|
export * from "./EncryptedCredentials";
|
|
73
74
|
export * from "./EncryptedPassportElement";
|
|
@@ -84,6 +85,7 @@ export * from "./GameHighScore";
|
|
|
84
85
|
export * from "./GeneralForumTopicHidden";
|
|
85
86
|
export * from "./GeneralForumTopicUnhidden";
|
|
86
87
|
export * from "./Gift";
|
|
88
|
+
export * from "./GiftBackground";
|
|
87
89
|
export * from "./GiftInfo";
|
|
88
90
|
export * from "./Gifts";
|
|
89
91
|
export * from "./Giveaway";
|
|
@@ -235,6 +237,13 @@ export * from "./StoryAreaTypeSuggestedReaction";
|
|
|
235
237
|
export * from "./StoryAreaTypeUniqueGift";
|
|
236
238
|
export * from "./StoryAreaTypeWeather";
|
|
237
239
|
export * from "./SuccessfulPayment";
|
|
240
|
+
export * from "./SuggestedPostApprovalFailed";
|
|
241
|
+
export * from "./SuggestedPostDeclined";
|
|
242
|
+
export * from "./SuggestedPostInfo";
|
|
243
|
+
export * from "./SuggestedPostPaid";
|
|
244
|
+
export * from "./SuggestedPostParameters";
|
|
245
|
+
export * from "./SuggestedPostPrice";
|
|
246
|
+
export * from "./SuggestedPostRefunded";
|
|
238
247
|
export * from "./SwitchInlineQueryChosenChat";
|
|
239
248
|
export * from "./TextQuote";
|
|
240
249
|
export * from "./TransactionPartner";
|
|
@@ -248,12 +257,14 @@ export * from "./TransactionPartnerUser";
|
|
|
248
257
|
export * from "./UniqueGift";
|
|
249
258
|
export * from "./UniqueGiftBackdrop";
|
|
250
259
|
export * from "./UniqueGiftBackdropColors";
|
|
260
|
+
export * from "./UniqueGiftColors";
|
|
251
261
|
export * from "./UniqueGiftInfo";
|
|
252
262
|
export * from "./UniqueGiftModel";
|
|
253
263
|
export * from "./UniqueGiftSymbol";
|
|
254
264
|
export * from "./Update";
|
|
255
265
|
export * from "./User";
|
|
256
266
|
export * from "./UserProfilePhotos";
|
|
267
|
+
export * from "./UserRating";
|
|
257
268
|
export * from "./UsersShared";
|
|
258
269
|
export * from "./Venue";
|
|
259
270
|
export * from "./Video";
|
package/biome.json
CHANGED
package/bun.lock
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"lockfileVersion": 1,
|
|
3
|
+
"configVersion": 0,
|
|
3
4
|
"workspaces": {
|
|
4
5
|
"": {
|
|
5
6
|
"name": "nyx-bot-client",
|
|
6
7
|
"dependencies": {
|
|
7
|
-
"@biomejs/biome": "^2.3.
|
|
8
|
-
"@types/node": "^
|
|
8
|
+
"@biomejs/biome": "^2.3.12",
|
|
9
|
+
"@types/node": "^25.0.10",
|
|
9
10
|
"dotenv": "^17.2.3",
|
|
10
|
-
"kysely": "^0.28.
|
|
11
|
-
"mysql2": "^3.
|
|
11
|
+
"kysely": "^0.28.10",
|
|
12
|
+
"mysql2": "^3.16.1",
|
|
12
13
|
"ts-debounce": "^4.0.0",
|
|
13
|
-
"zod": "^4.
|
|
14
|
+
"zod": "^4.3.6",
|
|
14
15
|
},
|
|
15
16
|
"devDependencies": {
|
|
16
17
|
"@types/bun": "latest",
|
|
@@ -21,27 +22,27 @@
|
|
|
21
22
|
},
|
|
22
23
|
},
|
|
23
24
|
"packages": {
|
|
24
|
-
"@biomejs/biome": ["@biomejs/biome@2.3.
|
|
25
|
+
"@biomejs/biome": ["@biomejs/biome@2.3.12", "", { "optionalDependencies": { "@biomejs/cli-darwin-arm64": "2.3.12", "@biomejs/cli-darwin-x64": "2.3.12", "@biomejs/cli-linux-arm64": "2.3.12", "@biomejs/cli-linux-arm64-musl": "2.3.12", "@biomejs/cli-linux-x64": "2.3.12", "@biomejs/cli-linux-x64-musl": "2.3.12", "@biomejs/cli-win32-arm64": "2.3.12", "@biomejs/cli-win32-x64": "2.3.12" }, "bin": { "biome": "bin/biome" } }, "sha512-AR7h4aSlAvXj7TAajW/V12BOw2EiS0AqZWV5dGozf4nlLoUF/ifvD0+YgKSskT0ylA6dY1A8AwgP8kZ6yaCQnA=="],
|
|
25
26
|
|
|
26
|
-
"@biomejs/cli-darwin-arm64": ["@biomejs/cli-darwin-arm64@2.3.
|
|
27
|
+
"@biomejs/cli-darwin-arm64": ["@biomejs/cli-darwin-arm64@2.3.12", "", { "os": "darwin", "cpu": "arm64" }, "sha512-cO6fn+KiMBemva6EARDLQBxeyvLzgidaFRJi8G7OeRqz54kWK0E+uSjgFaiHlc3DZYoa0+1UFE8mDxozpc9ieg=="],
|
|
27
28
|
|
|
28
|
-
"@biomejs/cli-darwin-x64": ["@biomejs/cli-darwin-x64@2.3.
|
|
29
|
+
"@biomejs/cli-darwin-x64": ["@biomejs/cli-darwin-x64@2.3.12", "", { "os": "darwin", "cpu": "x64" }, "sha512-/fiF/qmudKwSdvmSrSe/gOTkW77mHHkH8Iy7YC2rmpLuk27kbaUOPa7kPiH5l+3lJzTUfU/t6x1OuIq/7SGtxg=="],
|
|
29
30
|
|
|
30
|
-
"@biomejs/cli-linux-arm64": ["@biomejs/cli-linux-arm64@2.3.
|
|
31
|
+
"@biomejs/cli-linux-arm64": ["@biomejs/cli-linux-arm64@2.3.12", "", { "os": "linux", "cpu": "arm64" }, "sha512-nbOsuQROa3DLla5vvsTZg+T5WVPGi9/vYxETm9BOuLHBJN3oWQIg3MIkE2OfL18df1ZtNkqXkH6Yg9mdTPem7A=="],
|
|
31
32
|
|
|
32
|
-
"@biomejs/cli-linux-arm64-musl": ["@biomejs/cli-linux-arm64-musl@2.3.
|
|
33
|
+
"@biomejs/cli-linux-arm64-musl": ["@biomejs/cli-linux-arm64-musl@2.3.12", "", { "os": "linux", "cpu": "arm64" }, "sha512-aqkeSf7IH+wkzFpKeDVPSXy9uDjxtLpYA6yzkYsY+tVjwFFirSuajHDI3ul8en90XNs1NA0n8kgBrjwRi5JeyA=="],
|
|
33
34
|
|
|
34
|
-
"@biomejs/cli-linux-x64": ["@biomejs/cli-linux-x64@2.3.
|
|
35
|
+
"@biomejs/cli-linux-x64": ["@biomejs/cli-linux-x64@2.3.12", "", { "os": "linux", "cpu": "x64" }, "sha512-CQtqrJ+qEEI8tgRSTjjzk6wJAwfH3wQlkIGsM5dlecfRZaoT+XCms/mf7G4kWNexrke6mnkRzNy6w8ebV177ow=="],
|
|
35
36
|
|
|
36
|
-
"@biomejs/cli-linux-x64-musl": ["@biomejs/cli-linux-x64-musl@2.3.
|
|
37
|
+
"@biomejs/cli-linux-x64-musl": ["@biomejs/cli-linux-x64-musl@2.3.12", "", { "os": "linux", "cpu": "x64" }, "sha512-kVGWtupRRsOjvw47YFkk5mLiAdpCPMWBo1jOwAzh+juDpUb2sWarIp+iq+CPL1Wt0LLZnYtP7hH5kD6fskcxmg=="],
|
|
37
38
|
|
|
38
|
-
"@biomejs/cli-win32-arm64": ["@biomejs/cli-win32-arm64@2.3.
|
|
39
|
+
"@biomejs/cli-win32-arm64": ["@biomejs/cli-win32-arm64@2.3.12", "", { "os": "win32", "cpu": "arm64" }, "sha512-Re4I7UnOoyE4kHMqpgtG6UvSBGBbbtvsOvBROgCCoH7EgANN6plSQhvo2W7OCITvTp7gD6oZOyZy72lUdXjqZg=="],
|
|
39
40
|
|
|
40
|
-
"@biomejs/cli-win32-x64": ["@biomejs/cli-win32-x64@2.3.
|
|
41
|
+
"@biomejs/cli-win32-x64": ["@biomejs/cli-win32-x64@2.3.12", "", { "os": "win32", "cpu": "x64" }, "sha512-qqGVWqNNek0KikwPZlOIoxtXgsNGsX+rgdEzgw82Re8nF02W+E2WokaQhpF5TdBh/D/RQ3TLppH+otp6ztN0lw=="],
|
|
41
42
|
|
|
42
43
|
"@types/bun": ["@types/bun@1.2.17", "", { "dependencies": { "bun-types": "1.2.17" } }, "sha512-l/BYs/JYt+cXA/0+wUhulYJB6a6p//GTPiJ7nV+QHa8iiId4HZmnu/3J/SowP5g0rTiERY2kfGKXEK5Ehltx4Q=="],
|
|
43
44
|
|
|
44
|
-
"@types/node": ["@types/node@
|
|
45
|
+
"@types/node": ["@types/node@25.0.10", "", { "dependencies": { "undici-types": "~7.16.0" } }, "sha512-zWW5KPngR/yvakJgGOmZ5vTBemDoSqF3AcV/LrO5u5wTWyEAVVh+IT39G4gtyAkh3CtTZs8aX/yRM82OfzHJRg=="],
|
|
45
46
|
|
|
46
47
|
"aws-ssl-profiles": ["aws-ssl-profiles@1.1.2", "", {}, "sha512-NZKeq9AfyQvEeNlN0zSYAaWrmBffJh3IELMZfRpJVWgrpEbtEpnjvzqBPf+mxoI287JohRDoa+/nsfqqiZmF6g=="],
|
|
47
48
|
|
|
@@ -57,17 +58,15 @@
|
|
|
57
58
|
|
|
58
59
|
"is-property": ["is-property@1.0.2", "", {}, "sha512-Ks/IoX00TtClbGQr4TWXemAnktAQvYB7HzcCxDGqEZU6oCmb2INHuOoKxbtR+HFkmYWBKv/dOZtGRiAjDhj92g=="],
|
|
59
60
|
|
|
60
|
-
"kysely": ["kysely@0.28.
|
|
61
|
+
"kysely": ["kysely@0.28.10", "", {}, "sha512-ksNxfzIW77OcZ+QWSAPC7yDqUSaIVwkTWnTPNiIy//vifNbwsSgQ57OkkncHxxpcBHM3LRfLAZVEh7kjq5twVA=="],
|
|
61
62
|
|
|
62
63
|
"long": ["long@5.3.2", "", {}, "sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA=="],
|
|
63
64
|
|
|
64
|
-
"lru-cache": ["lru-cache@7.18.3", "", {}, "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA=="],
|
|
65
|
-
|
|
66
65
|
"lru.min": ["lru.min@1.1.2", "", {}, "sha512-Nv9KddBcQSlQopmBHXSsZVY5xsdlZkdH/Iey0BlcBYggMd4two7cZnKOK9vmy3nY0O5RGH99z1PCeTpPqszUYg=="],
|
|
67
66
|
|
|
68
|
-
"mysql2": ["mysql2@3.
|
|
67
|
+
"mysql2": ["mysql2@3.16.1", "", { "dependencies": { "aws-ssl-profiles": "^1.1.1", "denque": "^2.1.0", "generate-function": "^2.3.1", "iconv-lite": "^0.7.0", "long": "^5.2.1", "lru.min": "^1.0.0", "named-placeholders": "^1.1.6", "seq-queue": "^0.0.5", "sqlstring": "^2.3.2" } }, "sha512-b75qsDB3ieYEzMsT1uRGsztM/sy6vWPY40uPZlVVl8eefAotFCoS7jaDB5DxDNtlW5kdVGd9jptSpkvujNxI2A=="],
|
|
69
68
|
|
|
70
|
-
"named-placeholders": ["named-placeholders@1.1.
|
|
69
|
+
"named-placeholders": ["named-placeholders@1.1.6", "", { "dependencies": { "lru.min": "^1.1.0" } }, "sha512-Tz09sEL2EEuv5fFowm419c1+a/jSMiBjI9gHxVLrVdbUkkNUUfjsVYs9pVZu5oCon/kmRh9TfLEObFtkVxmY0w=="],
|
|
71
70
|
|
|
72
71
|
"safer-buffer": ["safer-buffer@2.1.2", "", {}, "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="],
|
|
73
72
|
|
|
@@ -81,7 +80,7 @@
|
|
|
81
80
|
|
|
82
81
|
"undici-types": ["undici-types@7.16.0", "", {}, "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw=="],
|
|
83
82
|
|
|
84
|
-
"zod": ["zod@4.
|
|
83
|
+
"zod": ["zod@4.3.6", "", {}, "sha512-rftlrkhHZOcjDwkGlnUtZZkvaPHCsDATp4pGpuOOMDaTdDDXF91wuVDJoWoPsKX/3YPQ5fHuF3STjcYyKr+Qhg=="],
|
|
85
84
|
|
|
86
85
|
"bun-types/@types/node": ["@types/node@24.0.4", "", { "dependencies": { "undici-types": "~7.8.0" } }, "sha512-ulyqAkrhnuNq9pB76DRBTkcS6YsmDALy6Ua63V8OhrOBgbcYt6IOdzpw5P1+dyRIyMerzLkeYWBeOXPpA9GMAA=="],
|
|
87
86
|
|
package/nyx-client.ts
CHANGED
|
@@ -21,6 +21,7 @@ type NyxConfig = {
|
|
|
21
21
|
redis?: {
|
|
22
22
|
host?: string;
|
|
23
23
|
port?: number;
|
|
24
|
+
skip?: boolean;
|
|
24
25
|
};
|
|
25
26
|
};
|
|
26
27
|
|
|
@@ -34,10 +35,6 @@ class NyxClient {
|
|
|
34
35
|
private redis: RedisClient | undefined;
|
|
35
36
|
|
|
36
37
|
public async initialize(config: NyxConfig) {
|
|
37
|
-
this.redis = new RedisClient(
|
|
38
|
-
`redis://${config.redis?.host ?? "127.0.0.1"}:${config.redis?.port ?? 6379}`,
|
|
39
|
-
);
|
|
40
|
-
|
|
41
38
|
this.botConfig = z
|
|
42
39
|
.object({
|
|
43
40
|
username: z.string().nonempty(),
|
|
@@ -50,11 +47,17 @@ class NyxClient {
|
|
|
50
47
|
this.injections = config.injections;
|
|
51
48
|
this.benchmark = config.benchmark;
|
|
52
49
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
50
|
+
if (!config.redis?.skip) {
|
|
51
|
+
this.redis = new RedisClient(
|
|
52
|
+
`redis://${config.redis?.host ?? "127.0.0.1"}:${config.redis?.port ?? 6379}`,
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
await this.redis.connect();
|
|
56
|
+
this.redis.subscribe(
|
|
57
|
+
this.botConfig.username,
|
|
58
|
+
this.handleUpdateRequest.bind(this),
|
|
59
|
+
);
|
|
60
|
+
}
|
|
58
61
|
|
|
59
62
|
config.onStartup?.();
|
|
60
63
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nyx-bot-client",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"module": "index.ts",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"devDependencies": {
|
|
@@ -10,12 +10,12 @@
|
|
|
10
10
|
"typescript": "^5"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@biomejs/biome": "^2.3.
|
|
14
|
-
"@types/node": "^
|
|
13
|
+
"@biomejs/biome": "^2.3.12",
|
|
14
|
+
"@types/node": "^25.0.10",
|
|
15
15
|
"dotenv": "^17.2.3",
|
|
16
|
-
"kysely": "^0.28.
|
|
17
|
-
"mysql2": "^3.
|
|
16
|
+
"kysely": "^0.28.10",
|
|
17
|
+
"mysql2": "^3.16.1",
|
|
18
18
|
"ts-debounce": "^4.0.0",
|
|
19
|
-
"zod": "^4.
|
|
19
|
+
"zod": "^4.3.6"
|
|
20
20
|
}
|
|
21
21
|
}
|
package/utils/methods.ts
CHANGED
|
@@ -18,6 +18,7 @@ import type {
|
|
|
18
18
|
InlineKeyboardMarkup,
|
|
19
19
|
InlineQueryResult,
|
|
20
20
|
InlineQueryResultsButton,
|
|
21
|
+
InputChecklist,
|
|
21
22
|
InputFile,
|
|
22
23
|
InputMedia,
|
|
23
24
|
InputMediaAudio,
|
|
@@ -34,6 +35,7 @@ import type {
|
|
|
34
35
|
Message,
|
|
35
36
|
MessageEntity,
|
|
36
37
|
MessageId,
|
|
38
|
+
OwnedGifts,
|
|
37
39
|
PassportElementError,
|
|
38
40
|
Poll,
|
|
39
41
|
ReactionType,
|
|
@@ -42,6 +44,7 @@ import type {
|
|
|
42
44
|
ReplyParameters,
|
|
43
45
|
SentWebAppMessage,
|
|
44
46
|
ShippingOption,
|
|
47
|
+
StarAmount,
|
|
45
48
|
StarTransaction,
|
|
46
49
|
Sticker,
|
|
47
50
|
StickerSet,
|
|
@@ -1962,3 +1965,114 @@ export const getGameHighScores = (
|
|
|
1962
1965
|
params: getGameHighScoresParams,
|
|
1963
1966
|
): APIResponse<GameHighScore[]> =>
|
|
1964
1967
|
requestTelegramAPI("getGameHighScores", params);
|
|
1968
|
+
|
|
1969
|
+
export type sendChecklistParams = {
|
|
1970
|
+
business_connection_id: string;
|
|
1971
|
+
chat_id: number;
|
|
1972
|
+
checklist: InputChecklist;
|
|
1973
|
+
disable_notification?: boolean;
|
|
1974
|
+
protect_content?: boolean;
|
|
1975
|
+
message_effect_id?: string;
|
|
1976
|
+
reply_parameters?: ReplyParameters;
|
|
1977
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
1978
|
+
} & methodParams;
|
|
1979
|
+
|
|
1980
|
+
export const sendChecklist = (
|
|
1981
|
+
params: sendChecklistParams,
|
|
1982
|
+
): APIResponse<Message> => requestTelegramAPI("sendChecklist", params);
|
|
1983
|
+
|
|
1984
|
+
export type editMessageChecklistParams = {
|
|
1985
|
+
business_connection_id: string;
|
|
1986
|
+
chat_id: number;
|
|
1987
|
+
message_id: number;
|
|
1988
|
+
checklist: InputChecklist;
|
|
1989
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
1990
|
+
} & methodParams;
|
|
1991
|
+
|
|
1992
|
+
export const editMessageChecklist = (
|
|
1993
|
+
params: editMessageChecklistParams,
|
|
1994
|
+
): APIResponse<Message> => requestTelegramAPI("editMessageChecklist", params);
|
|
1995
|
+
|
|
1996
|
+
export type getMyStarBalanceParams = {} & methodParams;
|
|
1997
|
+
|
|
1998
|
+
export const getMyStarBalance = (
|
|
1999
|
+
params: getMyStarBalanceParams,
|
|
2000
|
+
): APIResponse<StarAmount> => requestTelegramAPI("getMyStarBalance", params);
|
|
2001
|
+
|
|
2002
|
+
export type approveSuggestedPostParams = {
|
|
2003
|
+
chat_id: number;
|
|
2004
|
+
message_id: number;
|
|
2005
|
+
send_date?: number;
|
|
2006
|
+
} & methodParams;
|
|
2007
|
+
|
|
2008
|
+
export const approveSuggestedPost = (
|
|
2009
|
+
params: approveSuggestedPostParams,
|
|
2010
|
+
): APIResponse => requestTelegramAPI("approveSuggestedPost", params);
|
|
2011
|
+
|
|
2012
|
+
export type declineSuggestedPostParams = {
|
|
2013
|
+
chat_id: number;
|
|
2014
|
+
message_id: number;
|
|
2015
|
+
comment?: string;
|
|
2016
|
+
} & methodParams;
|
|
2017
|
+
|
|
2018
|
+
export const declineSuggestedPost = (
|
|
2019
|
+
params: declineSuggestedPostParams,
|
|
2020
|
+
): APIResponse => requestTelegramAPI("declineSuggestedPost", params);
|
|
2021
|
+
|
|
2022
|
+
export type repostStoryParams = {
|
|
2023
|
+
business_connection_id: string;
|
|
2024
|
+
from_chat_id: number;
|
|
2025
|
+
from_story_id: number;
|
|
2026
|
+
active_period: number;
|
|
2027
|
+
post_to_chat_page?: boolean;
|
|
2028
|
+
protect_content?: boolean;
|
|
2029
|
+
} & methodParams;
|
|
2030
|
+
|
|
2031
|
+
export const repostStory = (params: repostStoryParams): APIResponse<Story> =>
|
|
2032
|
+
requestTelegramAPI("repostStory", params);
|
|
2033
|
+
|
|
2034
|
+
export type getUserGiftsParams = {
|
|
2035
|
+
user_id: number;
|
|
2036
|
+
exclude_unlimited?: boolean;
|
|
2037
|
+
exclude_limited_upgradable?: boolean;
|
|
2038
|
+
exclude_limited_non_upgradable?: boolean;
|
|
2039
|
+
exclude_from_blockchain?: boolean;
|
|
2040
|
+
exclude_unique?: boolean;
|
|
2041
|
+
sort_by_price?: boolean;
|
|
2042
|
+
offset?: string;
|
|
2043
|
+
limit?: number;
|
|
2044
|
+
} & methodParams;
|
|
2045
|
+
|
|
2046
|
+
export const getUserGifts = (
|
|
2047
|
+
params: getUserGiftsParams,
|
|
2048
|
+
): APIResponse<OwnedGifts> => requestTelegramAPI("getUserGifts", params);
|
|
2049
|
+
|
|
2050
|
+
export type getChatGiftsParams = {
|
|
2051
|
+
user_id: number;
|
|
2052
|
+
exclude_unsaved?: boolean;
|
|
2053
|
+
exclude_saved?: boolean;
|
|
2054
|
+
exclude_unlimited?: boolean;
|
|
2055
|
+
exclude_limited_upgradable?: boolean;
|
|
2056
|
+
exclude_limited_non_upgradable?: boolean;
|
|
2057
|
+
exclude_from_blockchain?: boolean;
|
|
2058
|
+
exclude_unique?: boolean;
|
|
2059
|
+
sort_by_price?: boolean;
|
|
2060
|
+
offset?: string;
|
|
2061
|
+
limit?: number;
|
|
2062
|
+
} & methodParams;
|
|
2063
|
+
|
|
2064
|
+
export const getChatGifts = (
|
|
2065
|
+
params: getChatGiftsParams,
|
|
2066
|
+
): APIResponse<OwnedGifts> => requestTelegramAPI("getChatGifts", params);
|
|
2067
|
+
|
|
2068
|
+
export type sendMessageDraftParams = {
|
|
2069
|
+
chat_id: string;
|
|
2070
|
+
message_thread_id?: string;
|
|
2071
|
+
draft_id: number;
|
|
2072
|
+
text: string;
|
|
2073
|
+
parse_mode?: string;
|
|
2074
|
+
entities?: MessageEntity[];
|
|
2075
|
+
} & methodParams;
|
|
2076
|
+
|
|
2077
|
+
export const sendMessageDraft = (params: sendMessageDraftParams): APIResponse =>
|
|
2078
|
+
requestTelegramAPI("sendMessageDraft", params);
|