nyx-bot-client 1.0.1 → 1.0.2

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.
Files changed (54) hide show
  1. package/@types/BackgroundFillSolid.ts +1 -1
  2. package/@types/BackgroundTypePattern.ts +2 -2
  3. package/@types/BackgroundTypeWallpaper.ts +2 -2
  4. package/@types/BotAccessSettings.ts +18 -0
  5. package/@types/ChatMemberRestricted.ts +5 -0
  6. package/@types/ChatPermissions.ts +8 -1
  7. package/@types/ExternalReplyInfo.ts +6 -0
  8. package/@types/ForumTopic.ts +1 -1
  9. package/@types/ForumTopicCreated.ts +1 -1
  10. package/@types/Giveaway.ts +2 -2
  11. package/@types/GiveawayCompleted.ts +3 -3
  12. package/@types/InlineQueryResultArticle.ts +3 -3
  13. package/@types/InlineQueryResultGif.ts +1 -1
  14. package/@types/InlineQueryResultMpeg4Gif.ts +1 -1
  15. package/@types/InlineQueryResultVenue.ts +5 -0
  16. package/@types/InputInvoiceMessageContent.ts +1 -1
  17. package/@types/InputMedia.ts +4 -1
  18. package/@types/InputMediaLivePhoto.ts +54 -0
  19. package/@types/InputMediaLocation.ts +26 -0
  20. package/@types/InputMediaSticker.ts +26 -0
  21. package/@types/InputMediaVenue.ts +52 -0
  22. package/@types/InputPaidMedia.ts +6 -1
  23. package/@types/InputPaidMediaLivePhoto.ts +29 -0
  24. package/@types/InputPollMedia.ts +33 -0
  25. package/@types/InputPollOption.ts +6 -1
  26. package/@types/InputPollOptionMedia.ts +30 -0
  27. package/@types/KeyboardButtonRequestChat.ts +2 -2
  28. package/@types/LivePhoto.ts +51 -0
  29. package/@types/Message.ts +25 -0
  30. package/@types/MessageReactionUpdated.ts +2 -2
  31. package/@types/OrderInfo.ts +1 -1
  32. package/@types/OwnedGiftUnique.ts +2 -2
  33. package/@types/PaidMedia.ts +8 -2
  34. package/@types/PaidMediaLivePhoto.ts +18 -0
  35. package/@types/PaidMediaVideo.ts +1 -1
  36. package/@types/PaidMessagePriceChanged.ts +4 -8
  37. package/@types/Poll.ts +23 -1
  38. package/@types/PollAnswer.ts +2 -2
  39. package/@types/PollMedia.ts +63 -0
  40. package/@types/PollOption.ts +6 -1
  41. package/@types/ReplyKeyboardMarkup.ts +1 -1
  42. package/@types/ReplyParameters.ts +2 -2
  43. package/@types/SentGuestMessage.ts +11 -0
  44. package/@types/SentWebAppMessage.ts +1 -1
  45. package/@types/SwitchInlineQueryChosenChat.ts +1 -1
  46. package/@types/TextQuote.ts +2 -2
  47. package/@types/Update.ts +6 -0
  48. package/@types/User.ts +6 -2
  49. package/@types/WebhookInfo.ts +1 -1
  50. package/@types/index.ts +12 -0
  51. package/biome.json +1 -1
  52. package/bun.lock +20 -20
  53. package/package.json +7 -7
  54. package/utils/methods.ts +140 -0
package/utils/methods.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import type {
2
+ BotAccessSettings,
2
3
  BotCommand,
3
4
  BotCommandScope,
4
5
  BotDescription,
@@ -26,6 +27,7 @@ import type {
26
27
  InputMediaPhoto,
27
28
  InputMediaVideo,
28
29
  InputPaidMedia,
30
+ InputPollMedia,
29
31
  InputPollOption,
30
32
  InputProfilePhoto,
31
33
  InputSticker,
@@ -45,6 +47,7 @@ import type {
45
47
  ReplyKeyboardMarkup,
46
48
  ReplyKeyboardRemove,
47
49
  ReplyParameters,
50
+ SentGuestMessage,
48
51
  SentWebAppMessage,
49
52
  ShippingOption,
50
53
  StarAmount,
@@ -53,6 +56,7 @@ import type {
53
56
  Sticker,
54
57
  StickerSet,
55
58
  Story,
59
+ SuggestedPostParameters,
56
60
  Update,
57
61
  User,
58
62
  UserProfilePhotos,
@@ -100,6 +104,8 @@ export type sendMessageParams = {
100
104
  protect_content?: boolean;
101
105
  allow_paid_broadcast?: boolean;
102
106
  message_effect_id?: string;
107
+ suggested_post_parameters?: SuggestedPostParameters;
108
+ direct_messages_topic_id?: number;
103
109
  reply_parameters?: ReplyParameters;
104
110
  reply_markup?:
105
111
  | InlineKeyboardMarkup
@@ -170,6 +176,8 @@ export type forwardMessageParams = {
170
176
  video_start_timestamp?: number;
171
177
  disable_notification?: boolean;
172
178
  protect_content?: boolean;
179
+ suggested_post_parameters?: SuggestedPostParameters;
180
+ direct_messages_topic_id?: number;
173
181
  } & methodParams;
174
182
 
175
183
  export const forwardMessage = (
@@ -183,6 +191,7 @@ export type forwardMessagesParams = {
183
191
  message_thread_id?: number;
184
192
  disable_notification?: boolean;
185
193
  protect_content?: boolean;
194
+ direct_messages_topic_id?: number;
186
195
  } & methodParams;
187
196
 
188
197
  export const forwardMessages = (
@@ -202,6 +211,8 @@ export type copyMessageParams = {
202
211
  disable_notification?: boolean;
203
212
  protect_content?: boolean;
204
213
  allow_paid_broadcast?: boolean;
214
+ suggested_post_parameters?: SuggestedPostParameters;
215
+ direct_messages_topic_id?: number;
205
216
  reply_parameters?: ReplyParameters;
206
217
  reply_markup?:
207
218
  | InlineKeyboardMarkup
@@ -226,6 +237,7 @@ export type copyMessagesParams = {
226
237
  disable_notification?: boolean;
227
238
  protect_content?: boolean;
228
239
  remove_caption?: boolean;
240
+ direct_messages_topic_id?: number;
229
241
  } & methodParams;
230
242
 
231
243
  export const copyMessages = (
@@ -246,6 +258,8 @@ export type sendPhotoParams = {
246
258
  protect_content?: boolean;
247
259
  allow_paid_broadcast?: boolean;
248
260
  message_effect_id?: string;
261
+ suggested_post_parameters?: SuggestedPostParameters;
262
+ direct_messages_topic_id?: number;
249
263
  reply_parameters?: ReplyParameters;
250
264
  reply_markup?:
251
265
  | InlineKeyboardMarkup
@@ -276,6 +290,8 @@ export type sendAudioParams = {
276
290
  protect_content?: boolean;
277
291
  allow_paid_broadcast?: boolean;
278
292
  message_effect_id?: string;
293
+ suggested_post_parameters?: SuggestedPostParameters;
294
+ direct_messages_topic_id?: number;
279
295
  reply_parameters?: ReplyParameters;
280
296
  reply_markup?:
281
297
  | InlineKeyboardMarkup
@@ -304,6 +320,8 @@ export type sendDocumentParams = {
304
320
  protect_content?: boolean;
305
321
  allow_paid_broadcast?: boolean;
306
322
  message_effect_id?: string;
323
+ suggested_post_parameters?: SuggestedPostParameters;
324
+ direct_messages_topic_id?: number;
307
325
  reply_parameters?: ReplyParameters;
308
326
  reply_markup?:
309
327
  | InlineKeyboardMarkup
@@ -341,6 +359,8 @@ export type sendVideoParams = {
341
359
  protect_content?: boolean;
342
360
  allow_paid_broadcast?: boolean;
343
361
  message_effect_id?: string;
362
+ suggested_post_parameters?: SuggestedPostParameters;
363
+ direct_messages_topic_id?: number;
344
364
  reply_parameters?: ReplyParameters;
345
365
  reply_markup?:
346
366
  | InlineKeyboardMarkup
@@ -373,6 +393,8 @@ export type sendAnimationParams = {
373
393
  protect_content?: boolean;
374
394
  allow_paid_broadcast?: boolean;
375
395
  message_effect_id?: string;
396
+ suggested_post_parameters?: SuggestedPostParameters;
397
+ direct_messages_topic_id?: number;
376
398
  reply_parameters?: ReplyParameters;
377
399
  reply_markup?:
378
400
  | InlineKeyboardMarkup
@@ -402,6 +424,8 @@ export type sendVoiceParams = {
402
424
  protect_content?: boolean;
403
425
  allow_paid_broadcast?: boolean;
404
426
  message_effect_id?: string;
427
+ suggested_post_parameters?: SuggestedPostParameters;
428
+ direct_messages_topic_id?: number;
405
429
  reply_parameters?: ReplyParameters;
406
430
  reply_markup?:
407
431
  | InlineKeyboardMarkup
@@ -428,6 +452,8 @@ export type sendVideoNoteParams = {
428
452
  protect_content?: boolean;
429
453
  allow_paid_broadcast?: boolean;
430
454
  message_effect_id?: string;
455
+ suggested_post_parameters?: SuggestedPostParameters;
456
+ direct_messages_topic_id?: number;
431
457
  reply_parameters?: ReplyParameters;
432
458
  reply_markup?:
433
459
  | InlineKeyboardMarkup
@@ -455,6 +481,8 @@ export type sendPaidMediaParams = {
455
481
  protect_content?: boolean;
456
482
  allow_paid_broadcast?: boolean;
457
483
  message_effect_id?: string;
484
+ suggested_post_parameters?: SuggestedPostParameters;
485
+ direct_messages_topic_id?: number;
458
486
  reply_parameters?: ReplyParameters;
459
487
  reply_markup?:
460
488
  | InlineKeyboardMarkup
@@ -484,6 +512,7 @@ export type sendMediaGroupParams = {
484
512
  protect_content?: boolean;
485
513
  allow_paid_broadcast?: boolean;
486
514
  message_effect_id?: string;
515
+ direct_messages_topic_id?: number;
487
516
  reply_parameters?: ReplyParameters;
488
517
  reply_markup?:
489
518
  | InlineKeyboardMarkup
@@ -510,6 +539,8 @@ export type sendLocationParams = {
510
539
  protect_content?: boolean;
511
540
  allow_paid_broadcast?: boolean;
512
541
  message_effect_id?: string;
542
+ suggested_post_parameters?: SuggestedPostParameters;
543
+ direct_messages_topic_id?: number;
513
544
  reply_parameters?: ReplyParameters;
514
545
  reply_markup?:
515
546
  | InlineKeyboardMarkup
@@ -538,6 +569,8 @@ export type sendVenueParams = {
538
569
  protect_content?: boolean;
539
570
  allow_paid_broadcast?: boolean;
540
571
  message_effect_id?: string;
572
+ suggested_post_parameters?: SuggestedPostParameters;
573
+ direct_messages_topic_id?: number;
541
574
  reply_parameters?: ReplyParameters;
542
575
  reply_markup?:
543
576
  | InlineKeyboardMarkup
@@ -561,6 +594,8 @@ export type sendContactParams = {
561
594
  protect_content?: boolean;
562
595
  allow_paid_broadcast?: boolean;
563
596
  message_effect_id?: string;
597
+ suggested_post_parameters?: SuggestedPostParameters;
598
+ direct_messages_topic_id?: number;
564
599
  reply_parameters?: ReplyParameters;
565
600
  reply_markup?:
566
601
  | InlineKeyboardMarkup
@@ -595,6 +630,10 @@ export type sendPollParams = {
595
630
  allow_paid_broadcast?: boolean;
596
631
  message_effect_id?: string;
597
632
  reply_parameters?: ReplyParameters;
633
+ media?: InputPollMedia;
634
+ explanation_media?: InputPollMedia;
635
+ members_only?: boolean;
636
+ country_codes?: string[];
598
637
  reply_markup?:
599
638
  | InlineKeyboardMarkup
600
639
  | ReplyKeyboardMarkup
@@ -621,6 +660,8 @@ export type sendDiceParams = {
621
660
  protect_content?: boolean;
622
661
  allow_paid_broadcast?: boolean;
623
662
  message_effect_id?: string;
663
+ suggested_post_parameters?: SuggestedPostParameters;
664
+ direct_messages_topic_id?: number;
624
665
  reply_parameters?: ReplyParameters;
625
666
  reply_markup?:
626
667
  | InlineKeyboardMarkup
@@ -935,6 +976,7 @@ export const getChat = (params: getChatParams): APIResponse<ChatFullInfo> =>
935
976
 
936
977
  export type getChatAdministratorsParams = {
937
978
  chat_id: string | number;
979
+ return_bots?: boolean;
938
980
  } & methodParams;
939
981
 
940
982
  export const getChatAdministrators = (
@@ -1617,6 +1659,8 @@ export type sendStickerParams = {
1617
1659
  protect_content?: boolean;
1618
1660
  allow_paid_broadcast?: boolean;
1619
1661
  message_effect_id?: string;
1662
+ suggested_post_parameters?: SuggestedPostParameters;
1663
+ direct_messages_topic_id?: number;
1620
1664
  reply_parameters?: ReplyParameters;
1621
1665
  reply_markup?:
1622
1666
  | InlineKeyboardMarkup
@@ -1833,6 +1877,8 @@ export type sendInvoiceParams = {
1833
1877
  protect_content?: boolean;
1834
1878
  allow_paid_broadcast?: boolean;
1835
1879
  message_effect_id?: string;
1880
+ suggested_post_parameters?: SuggestedPostParameters;
1881
+ direct_messages_topic_id?: number;
1836
1882
  reply_parameters?: ReplyParameters;
1837
1883
  reply_markup?: InlineKeyboardMarkup;
1838
1884
  } & methodParams;
@@ -2132,3 +2178,97 @@ export const savePreparedKeyboardButton = (
2132
2178
  params: savePreparedKeyboardButtonParams,
2133
2179
  ): APIResponse<PreparedKeyboardButton> =>
2134
2180
  requestTelegramAPI("savePreparedKeyboardButton", params);
2181
+
2182
+ export type answerGuestQueryParams = {
2183
+ guest_query_id: string;
2184
+ result: InlineQueryResult;
2185
+ } & methodParams;
2186
+
2187
+ export const answerGuestQuery = (
2188
+ params: answerGuestQueryParams,
2189
+ ): APIResponse<SentGuestMessage> =>
2190
+ requestTelegramAPI("answerGuestQuery", params);
2191
+
2192
+ export type deleteAllMessageReactionsParams = {
2193
+ chat_id: string | number;
2194
+ user_id?: number;
2195
+ actor_chat_id?: number;
2196
+ } & methodParams;
2197
+
2198
+ export const deleteAllMessageReactions = (
2199
+ params: deleteAllMessageReactionsParams,
2200
+ ): APIResponse => requestTelegramAPI("deleteAllMessageReactions", params);
2201
+
2202
+ export type deleteMessageReactionParams = {
2203
+ chat_id: string | number;
2204
+ message_id: number;
2205
+ user_id?: number;
2206
+ actor_chat_id?: number;
2207
+ } & methodParams;
2208
+
2209
+ export const deleteMessageReaction = (
2210
+ params: deleteMessageReactionParams,
2211
+ ): APIResponse => requestTelegramAPI("deleteMessageReaction", params);
2212
+
2213
+ export type sendLivePhotoParams = {
2214
+ chat_id: string | number;
2215
+ live_photo: InputFile | string;
2216
+ photo: InputFile | string;
2217
+ caption?: string;
2218
+ caption_entities?: MessageEntity[];
2219
+ show_caption_above_media?: boolean;
2220
+ has_spoiler?: boolean;
2221
+ business_connection_id?: string;
2222
+ message_thread_id?: number;
2223
+ disable_notification?: boolean;
2224
+ protect_content?: boolean;
2225
+ allow_paid_broadcast?: boolean;
2226
+ message_effect_id?: string;
2227
+ parse_mode?: string;
2228
+ suggested_post_parameters?: SuggestedPostParameters;
2229
+ direct_messages_topic_id?: number;
2230
+ reply_parameters?: ReplyParameters;
2231
+ reply_markup?:
2232
+ | InlineKeyboardMarkup
2233
+ | ReplyKeyboardMarkup
2234
+ | ReplyKeyboardRemove
2235
+ | ForceReply;
2236
+ } & methodParams;
2237
+
2238
+ export const sendLivePhoto = (
2239
+ params: sendLivePhotoParams,
2240
+ ): APIResponse<Message> => {
2241
+ params.parse_mode =
2242
+ params.parse_mode ?? (params.parse_mode === "none" ? undefined : "HTML");
2243
+
2244
+ return requestTelegramAPI("sendLivePhoto", params);
2245
+ };
2246
+
2247
+ export type getManagedBotAccessSettingsParams = {
2248
+ user_id: number;
2249
+ } & methodParams;
2250
+
2251
+ export const getManagedBotAccessSettings = (
2252
+ params: getManagedBotAccessSettingsParams,
2253
+ ): APIResponse<BotAccessSettings> =>
2254
+ requestTelegramAPI("getManagedBotAccessSettings", params);
2255
+
2256
+ export type setManagedBotAccessSettingsParams = {
2257
+ user_id: number;
2258
+ is_access_restricted: boolean;
2259
+ added_user_ids?: number[];
2260
+ } & methodParams;
2261
+
2262
+ export const setManagedBotAccessSettings = (
2263
+ params: setManagedBotAccessSettingsParams,
2264
+ ): APIResponse => requestTelegramAPI("setManagedBotAccessSettings", params);
2265
+
2266
+ export type getUserPersonalChatMessagesParams = {
2267
+ user_id: number;
2268
+ limit: number;
2269
+ } & methodParams;
2270
+
2271
+ export const getUserPersonalChatMessages = (
2272
+ params: getUserPersonalChatMessagesParams,
2273
+ ): APIResponse<Message[]> =>
2274
+ requestTelegramAPI("getUserPersonalChatMessages", params);