nyx-bot-client 0.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 (288) hide show
  1. package/.env.sample +4 -0
  2. package/.vscode/extensions.json +11 -0
  3. package/.vscode/settings.json +17 -0
  4. package/.zed/settings.json +20 -0
  5. package/@types/AcceptedGiftTypes.ts +26 -0
  6. package/@types/AffiliateInfo.ts +35 -0
  7. package/@types/Animation.ts +56 -0
  8. package/@types/Audio.ts +56 -0
  9. package/@types/BackgroundFill.ts +18 -0
  10. package/@types/BackgroundFillFreeformGradient.ts +16 -0
  11. package/@types/BackgroundFillGradient.ts +26 -0
  12. package/@types/BackgroundFillSolid.ts +16 -0
  13. package/@types/BackgroundType.ts +21 -0
  14. package/@types/BackgroundTypeChatTheme.ts +16 -0
  15. package/@types/BackgroundTypeFill.ts +23 -0
  16. package/@types/BackgroundTypePattern.ts +40 -0
  17. package/@types/BackgroundTypeWallpaper.ts +33 -0
  18. package/@types/Birthdate.ts +21 -0
  19. package/@types/BotCommand.ts +16 -0
  20. package/@types/BotCommandScope.ts +30 -0
  21. package/@types/BotCommandScopeAllChatAdministrators.ts +11 -0
  22. package/@types/BotCommandScopeAllGroupChats.ts +11 -0
  23. package/@types/BotCommandScopeAllPrivateChats.ts +11 -0
  24. package/@types/BotCommandScopeChat.ts +16 -0
  25. package/@types/BotCommandScopeChatAdministrators.ts +16 -0
  26. package/@types/BotCommandScopeChatMember.ts +21 -0
  27. package/@types/BotCommandScopeDefault.ts +12 -0
  28. package/@types/BotDescription.ts +11 -0
  29. package/@types/BotName.ts +11 -0
  30. package/@types/BotShortDescription.ts +11 -0
  31. package/@types/BusinessBotRights.ts +65 -0
  32. package/@types/BusinessConnection.ts +41 -0
  33. package/@types/BusinessIntro.ts +23 -0
  34. package/@types/BusinessLocation.ts +18 -0
  35. package/@types/BusinessMessagesDeleted.ts +24 -0
  36. package/@types/BusinessOpeningHours.ts +18 -0
  37. package/@types/BusinessOpeningHoursInterval.ts +18 -0
  38. package/@types/CallbackGame.ts +6 -0
  39. package/@types/CallbackQuery.ts +49 -0
  40. package/@types/Chat.ts +43 -0
  41. package/@types/ChatAdministratorRights.ts +84 -0
  42. package/@types/ChatBackground.ts +13 -0
  43. package/@types/ChatBoost.ts +29 -0
  44. package/@types/ChatBoostAdded.ts +11 -0
  45. package/@types/ChatBoostRemoved.ts +28 -0
  46. package/@types/ChatBoostSource.ts +18 -0
  47. package/@types/ChatBoostSourceGiftCode.ts +19 -0
  48. package/@types/ChatBoostSourceGiveaway.ts +35 -0
  49. package/@types/ChatBoostSourcePremium.ts +19 -0
  50. package/@types/ChatBoostUpdated.ts +18 -0
  51. package/@types/ChatFullInfo.ts +260 -0
  52. package/@types/ChatInviteLink.ts +66 -0
  53. package/@types/ChatJoinRequest.ts +42 -0
  54. package/@types/ChatLocation.ts +16 -0
  55. package/@types/ChatMember.ts +28 -0
  56. package/@types/ChatMemberAdministrator.ts +107 -0
  57. package/@types/ChatMemberBanned.ts +23 -0
  58. package/@types/ChatMemberLeft.ts +18 -0
  59. package/@types/ChatMemberMember.ts +23 -0
  60. package/@types/ChatMemberOwner.ts +28 -0
  61. package/@types/ChatMemberRestricted.ts +99 -0
  62. package/@types/ChatMemberUpdated.ts +49 -0
  63. package/@types/ChatPermissions.ts +78 -0
  64. package/@types/ChatPhoto.ts +30 -0
  65. package/@types/ChatShared.ts +36 -0
  66. package/@types/Checklist.ts +33 -0
  67. package/@types/ChecklistTask.ts +33 -0
  68. package/@types/ChecklistTasksAdded.ts +19 -0
  69. package/@types/ChecklistTasksDone.ts +24 -0
  70. package/@types/ChosenInlineResult.ts +34 -0
  71. package/@types/Contact.ts +33 -0
  72. package/@types/CopyTextButton.ts +11 -0
  73. package/@types/Dice.ts +17 -0
  74. package/@types/DirectMessagePriceChanged.ts +17 -0
  75. package/@types/Document.ts +41 -0
  76. package/@types/EncryptedCredentials.ts +23 -0
  77. package/@types/EncryptedPassportElement.ts +357 -0
  78. package/@types/ExternalReplyInfo.ts +159 -0
  79. package/@types/File.ts +33 -0
  80. package/@types/ForceReply.ts +26 -0
  81. package/@types/ForumTopic.ts +26 -0
  82. package/@types/ForumTopicClosed.ts +6 -0
  83. package/@types/ForumTopicCreated.ts +21 -0
  84. package/@types/ForumTopicEdited.ts +17 -0
  85. package/@types/ForumTopicReopened.ts +6 -0
  86. package/@types/Game.ts +41 -0
  87. package/@types/GameHighScore.ts +23 -0
  88. package/@types/GeneralForumTopicHidden.ts +7 -0
  89. package/@types/GeneralForumTopicUnhidden.ts +7 -0
  90. package/@types/Gift.ts +38 -0
  91. package/@types/GiftInfo.ts +52 -0
  92. package/@types/Gifts.ts +13 -0
  93. package/@types/Giveaway.ts +55 -0
  94. package/@types/GiveawayCompleted.ts +29 -0
  95. package/@types/GiveawayCreated.ts +11 -0
  96. package/@types/GiveawayWinners.ts +68 -0
  97. package/@types/InaccessibleMessage.ts +23 -0
  98. package/@types/InlineKeyboardButton.ts +88 -0
  99. package/@types/InlineKeyboardMarkup.ts +13 -0
  100. package/@types/InlineQuery.ts +41 -0
  101. package/@types/InlineQueryResult.ts +70 -0
  102. package/@types/InlineQueryResultArticle.ts +58 -0
  103. package/@types/InlineQueryResultAudio.ts +69 -0
  104. package/@types/InlineQueryResultCachedAudio.ts +55 -0
  105. package/@types/InlineQueryResultCachedDocument.ts +65 -0
  106. package/@types/InlineQueryResultCachedGif.ts +65 -0
  107. package/@types/InlineQueryResultCachedMpeg4Gif.ts +65 -0
  108. package/@types/InlineQueryResultCachedPhoto.ts +70 -0
  109. package/@types/InlineQueryResultCachedSticker.ts +34 -0
  110. package/@types/InlineQueryResultCachedVideo.ts +70 -0
  111. package/@types/InlineQueryResultCachedVoice.ts +60 -0
  112. package/@types/InlineQueryResultContact.ts +64 -0
  113. package/@types/InlineQueryResultDocument.ts +85 -0
  114. package/@types/InlineQueryResultGame.ts +29 -0
  115. package/@types/InlineQueryResultGif.ts +91 -0
  116. package/@types/InlineQueryResultLocation.ts +82 -0
  117. package/@types/InlineQueryResultMpeg4Gif.ts +91 -0
  118. package/@types/InlineQueryResultPhoto.ts +84 -0
  119. package/@types/InlineQueryResultVenue.ts +80 -0
  120. package/@types/InlineQueryResultVideo.ts +98 -0
  121. package/@types/InlineQueryResultVoice.ts +65 -0
  122. package/@types/InlineQueryResultsButton.ts +34 -0
  123. package/@types/InputChecklist.ts +39 -0
  124. package/@types/InputChecklistTask.ts +30 -0
  125. package/@types/InputContactMessageContent.ts +27 -0
  126. package/@types/InputFile.ts +10 -0
  127. package/@types/InputInvoiceMessageContent.ts +120 -0
  128. package/@types/InputLocationMessageContent.ts +39 -0
  129. package/@types/InputMedia.ts +24 -0
  130. package/@types/InputMediaAnimation.ts +68 -0
  131. package/@types/InputMediaAudio.ts +58 -0
  132. package/@types/InputMediaDocument.ts +49 -0
  133. package/@types/InputMediaPhoto.ts +45 -0
  134. package/@types/InputMediaVideo.ts +85 -0
  135. package/@types/InputMessageContent.ts +25 -0
  136. package/@types/InputPaidMedia.ts +11 -0
  137. package/@types/InputPaidMediaPhoto.ts +21 -0
  138. package/@types/InputPaidMediaVideo.ts +64 -0
  139. package/@types/InputPollOption.ts +25 -0
  140. package/@types/InputProfilePhoto.ts +10 -0
  141. package/@types/InputProfilePhotoAnimated.ts +23 -0
  142. package/@types/InputProfilePhotoStatic.ts +18 -0
  143. package/@types/InputSticker.ts +38 -0
  144. package/@types/InputStoryContent.ts +11 -0
  145. package/@types/InputStoryContentPhoto.ts +29 -0
  146. package/@types/InputStoryContentVideo.ts +49 -0
  147. package/@types/InputTextMessageContent.ts +28 -0
  148. package/@types/InputVenueMessageContent.ts +47 -0
  149. package/@types/Invoice.ts +35 -0
  150. package/@types/KeyboardButton.ts +61 -0
  151. package/@types/KeyboardButtonPollType.ts +13 -0
  152. package/@types/KeyboardButtonRequestChat.ts +68 -0
  153. package/@types/KeyboardButtonRequestUsers.ts +45 -0
  154. package/@types/LabeledPrice.ts +18 -0
  155. package/@types/LinkPreviewOptions.ts +32 -0
  156. package/@types/Location.ts +38 -0
  157. package/@types/LocationAddress.ts +26 -0
  158. package/@types/LoginUrl.ts +37 -0
  159. package/@types/MaskPosition.ts +28 -0
  160. package/@types/MaybeInaccessibleMessage.ts +8 -0
  161. package/@types/MenuButton.ts +20 -0
  162. package/@types/MenuButtonCommands.ts +11 -0
  163. package/@types/MenuButtonDefault.ts +11 -0
  164. package/@types/MenuButtonWebApp.ts +26 -0
  165. package/@types/Message.ts +608 -0
  166. package/@types/MessageAutoDeleteTimerChanged.ts +11 -0
  167. package/@types/MessageEntity.ts +109 -0
  168. package/@types/MessageId.ts +11 -0
  169. package/@types/MessageOrigin.ts +21 -0
  170. package/@types/MessageOriginChannel.ts +33 -0
  171. package/@types/MessageOriginChat.ts +28 -0
  172. package/@types/MessageOriginHiddenUser.ts +21 -0
  173. package/@types/MessageOriginUser.ts +23 -0
  174. package/@types/MessageReactionCountUpdated.ts +28 -0
  175. package/@types/MessageReactionUpdated.ts +43 -0
  176. package/@types/OrderInfo.ts +28 -0
  177. package/@types/OwnedGift.ts +11 -0
  178. package/@types/OwnedGiftRegular.ts +77 -0
  179. package/@types/OwnedGiftUnique.ts +57 -0
  180. package/@types/OwnedGifts.ts +23 -0
  181. package/@types/PaidMedia.ts +13 -0
  182. package/@types/PaidMediaInfo.ts +18 -0
  183. package/@types/PaidMediaPhoto.ts +18 -0
  184. package/@types/PaidMediaPreview.ts +26 -0
  185. package/@types/PaidMediaPurchased.ts +18 -0
  186. package/@types/PaidMediaVideo.ts +18 -0
  187. package/@types/PaidMessagePriceChanged.ts +16 -0
  188. package/@types/PassportData.ts +18 -0
  189. package/@types/PassportElementError.ts +37 -0
  190. package/@types/PassportElementErrorDataField.ts +39 -0
  191. package/@types/PassportElementErrorFile.ts +33 -0
  192. package/@types/PassportElementErrorFiles.ts +33 -0
  193. package/@types/PassportElementErrorFrontSide.ts +28 -0
  194. package/@types/PassportElementErrorReverseSide.ts +27 -0
  195. package/@types/PassportElementErrorSelfie.ts +28 -0
  196. package/@types/PassportElementErrorTranslationFile.ts +38 -0
  197. package/@types/PassportElementErrorTranslationFiles.ts +38 -0
  198. package/@types/PassportElementErrorUnspecified.ts +49 -0
  199. package/@types/PassportFile.ts +28 -0
  200. package/@types/PhotoSize.ts +32 -0
  201. package/@types/Poll.ts +81 -0
  202. package/@types/PollAnswer.ts +28 -0
  203. package/@types/PollOption.ts +24 -0
  204. package/@types/PreCheckoutQuery.ts +45 -0
  205. package/@types/ProximityAlertTriggered.ts +24 -0
  206. package/@types/ReactionCount.ts +18 -0
  207. package/@types/ReactionType.ts +18 -0
  208. package/@types/ReactionTypeCustomEmoji.ts +16 -0
  209. package/@types/ReactionTypeEmoji.ts +92 -0
  210. package/@types/ReactionTypePaid.ts +11 -0
  211. package/@types/RefundedPayment.ts +35 -0
  212. package/@types/ReplyKeyboardMarkup.ts +49 -0
  213. package/@types/ReplyKeyboardRemove.ts +25 -0
  214. package/@types/ReplyParameters.ts +48 -0
  215. package/@types/ResponseParameters.ts +19 -0
  216. package/@types/RevenueWithdrawalState.ts +13 -0
  217. package/@types/RevenueWithdrawalStateFailed.ts +11 -0
  218. package/@types/RevenueWithdrawalStatePending.ts +10 -0
  219. package/@types/RevenueWithdrawalStateSucceeded.ts +21 -0
  220. package/@types/SentWebAppMessage.ts +12 -0
  221. package/@types/SharedUser.ts +36 -0
  222. package/@types/ShippingAddress.ts +36 -0
  223. package/@types/ShippingOption.ts +23 -0
  224. package/@types/ShippingQuery.ts +28 -0
  225. package/@types/StarAmount.ts +17 -0
  226. package/@types/StarTransaction.ts +42 -0
  227. package/@types/StarTransactions.ts +13 -0
  228. package/@types/Sticker.ts +86 -0
  229. package/@types/StickerSet.ts +33 -0
  230. package/@types/Story.ts +18 -0
  231. package/@types/StoryArea.ts +18 -0
  232. package/@types/StoryAreaPosition.ts +36 -0
  233. package/@types/StoryAreaType.ts +24 -0
  234. package/@types/StoryAreaTypeLink.ts +16 -0
  235. package/@types/StoryAreaTypeLocation.ts +28 -0
  236. package/@types/StoryAreaTypeSuggestedReaction.ts +29 -0
  237. package/@types/StoryAreaTypeUniqueGift.ts +16 -0
  238. package/@types/StoryAreaTypeWeather.ts +26 -0
  239. package/@types/SuccessfulPayment.ts +60 -0
  240. package/@types/SwitchInlineQueryChosenChat.ts +33 -0
  241. package/@types/TextQuote.ts +30 -0
  242. package/@types/TransactionPartner.ts +31 -0
  243. package/@types/TransactionPartnerAffiliateProgram.ts +24 -0
  244. package/@types/TransactionPartnerChat.ts +21 -0
  245. package/@types/TransactionPartnerFragment.ts +18 -0
  246. package/@types/TransactionPartnerOther.ts +11 -0
  247. package/@types/TransactionPartnerTelegramAds.ts +11 -0
  248. package/@types/TransactionPartnerTelegramApi.ts +16 -0
  249. package/@types/TransactionPartnerUser.ts +70 -0
  250. package/@types/UniqueGift.ts +38 -0
  251. package/@types/UniqueGiftBackdrop.ts +23 -0
  252. package/@types/UniqueGiftBackdropColors.ts +26 -0
  253. package/@types/UniqueGiftInfo.ts +42 -0
  254. package/@types/UniqueGiftModel.ts +23 -0
  255. package/@types/UniqueGiftSymbol.ts +23 -0
  256. package/@types/Update.ts +177 -0
  257. package/@types/User.ts +74 -0
  258. package/@types/UserProfilePhotos.ts +18 -0
  259. package/@types/UsersShared.ts +19 -0
  260. package/@types/Venue.ts +48 -0
  261. package/@types/Video.ts +66 -0
  262. package/@types/VideoChatEnded.ts +11 -0
  263. package/@types/VideoChatParticipantsInvited.ts +13 -0
  264. package/@types/VideoChatScheduled.ts +11 -0
  265. package/@types/VideoChatStarted.ts +6 -0
  266. package/@types/VideoNote.ts +39 -0
  267. package/@types/Voice.ts +34 -0
  268. package/@types/WebAppData.ts +17 -0
  269. package/@types/WebAppInfo.ts +11 -0
  270. package/@types/WebhookInfo.ts +54 -0
  271. package/@types/WriteAccessAllowed.ts +23 -0
  272. package/@types/index.ts +395 -0
  273. package/@types/utils.ts +17 -0
  274. package/biome.json +58 -0
  275. package/bun.lock +105 -0
  276. package/cron/actions-server.ts +87 -0
  277. package/index.ts +9 -0
  278. package/nyx-client.ts +133 -0
  279. package/package.json +22 -0
  280. package/tsconfig.json +28 -0
  281. package/types.d.ts +35 -0
  282. package/utils/actions.ts +30 -0
  283. package/utils/api.ts +27 -0
  284. package/utils/enum.ts +5 -0
  285. package/utils/helpers.ts +71 -0
  286. package/utils/methods.ts +1943 -0
  287. package/utils/objects.ts +37 -0
  288. package/utils/table.ts +72 -0
@@ -0,0 +1,10 @@
1
+ import type { InputProfilePhotoAnimated, InputProfilePhotoStatic } from "./";
2
+
3
+ /**
4
+ * ## InputProfilePhoto
5
+ * This object describes a profile photo to be set for a user or bot.
6
+ * @see https://core.telegram.org/bots/api#inputprofilephoto
7
+ */
8
+ export type InputProfilePhoto =
9
+ | InputProfilePhotoStatic
10
+ | InputProfilePhotoAnimated;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * ## InputProfilePhotoAnimated
3
+ * Represents an animated profile photo.
4
+ * @see https://core.telegram.org/bots/api#inputprofilephotoanimated
5
+ */
6
+ export type InputProfilePhotoAnimated = {
7
+ /**
8
+ * Type of the profile photo, must be 'animated'
9
+ */
10
+ type: "animated";
11
+
12
+ /**
13
+ * The animated profile photo. Use “attach://<file_attach_name>” if uploaded
14
+ * via multipart/form-data.
15
+ */
16
+ animation: string;
17
+
18
+ /**
19
+ * Optional. Timestamp in seconds of the frame that will be used as the static
20
+ * profile photo. Defaults to 0.0.
21
+ */
22
+ main_frame_timestamp?: number;
23
+ };
@@ -0,0 +1,18 @@
1
+ /**
2
+ * ## InputProfilePhotoStatic
3
+ * Represents a static profile photo in the .JPG format.
4
+ * @see https://core.telegram.org/bots/api#inputprofilephotostatic
5
+ */
6
+ export type InputProfilePhotoStatic = {
7
+ /**
8
+ * Type of the profile photo, must be 'static'
9
+ */
10
+ type: "static";
11
+
12
+ /**
13
+ * The static profile photo. Profile photos can't be reused and can only be
14
+ * uploaded as a new file, so you can pass “attach://<file_attach_name>” if
15
+ * the photo was uploaded using multipart/form-data under <file_attach_name>.
16
+ */
17
+ photo: string;
18
+ };
@@ -0,0 +1,38 @@
1
+ import type { InputFile, MaskPosition } from "./";
2
+
3
+ /**
4
+ * ## InputSticker
5
+ * This object describes a sticker to be added to a sticker set.
6
+ * @see https://core.telegram.org/bots/api#inputsticker
7
+ */
8
+ export type InputSticker = {
9
+ /**
10
+ * The added sticker. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an
11
+ * HTTP URL as a String for Telegram to get a file from the Internet, upload a new one using multipart/form-data, or
12
+ * pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name.
13
+ * Animated and video stickers can't be uploaded via HTTP URL. [More information on Sending Files](https://core.telegram.org/bots/api#sending-files)
14
+ */
15
+ sticker: InputFile | string;
16
+
17
+ /**
18
+ * Format of the added sticker, must be one of “static” for a .WEBP or .PNG image, “animated” for a .TGS animation,
19
+ * “video” for a WEBM video
20
+ */
21
+ format: "static" | "animated" | "video";
22
+
23
+ /**
24
+ * List of 1-20 emoji associated with the sticker
25
+ */
26
+ emoji_list: string[];
27
+
28
+ /**
29
+ * Optional. Position where the mask should be placed on faces. For “mask” stickers only.
30
+ */
31
+ mask_position?: MaskPosition;
32
+
33
+ /**
34
+ * Optional. List of 0-20 search keywords for the sticker with total length of up to 64 characters. For “regular”
35
+ * and “custom_emoji” stickers only.
36
+ */
37
+ keywords?: string[];
38
+ };
@@ -0,0 +1,11 @@
1
+ import type { InputStoryContentPhoto, InputStoryContentVideo } from "./";
2
+
3
+ /**
4
+ * ## InputStoryContent
5
+ * This object describes the content of a story to be set for a user or chat.
6
+ * Currently, it can be one of:
7
+ * - InputStoryContentPhoto
8
+ * - InputStoryContentVideo
9
+ * @see https://core.telegram.org/bots/api#inputstorycontent
10
+ */
11
+ export type InputStoryContent = InputStoryContentPhoto | InputStoryContentVideo;
@@ -0,0 +1,29 @@
1
+ /**
2
+ * ## InputStoryContentPhoto
3
+ * Represents a photo to be used as story content.
4
+ * @see https://core.telegram.org/bots/api#inputstorycontentphoto
5
+ */
6
+ export type InputStoryContentPhoto = {
7
+ /**
8
+ * Type of the story content, must be 'photo'
9
+ */
10
+ type: "photo";
11
+
12
+ /**
13
+ * File to send. Pass a file_id to send a file that exists on the Telegram
14
+ * servers (recommended), pass an HTTP URL for Telegram to get a file from the
15
+ * Internet, or pass “attach://<file_attach_name>” to upload a new one using
16
+ * multipart/form-data under <file_attach_name> name.
17
+ */
18
+ media: string;
19
+
20
+ /**
21
+ * Optional. Thumbnail of the file sent; can be ignored if thumbnail
22
+ * generation for the file is supported server-side. The thumbnail should be
23
+ * in JPEG format and less than 200 kB in size. A thumbnail's width and height
24
+ * should not exceed 320. Thumbnails can't be reused and can be only uploaded
25
+ * as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail
26
+ * was uploaded using multipart/form-data under <file_attach_name>.
27
+ */
28
+ thumbnail?: string;
29
+ };
@@ -0,0 +1,49 @@
1
+ /**
2
+ * ## InputStoryContentVideo
3
+ * Represents a video to be used as story content.
4
+ * @see https://core.telegram.org/bots/api#inputstorycontentvideo
5
+ */
6
+ export type InputStoryContentVideo = {
7
+ /**
8
+ * Type of the story content, must be 'video'
9
+ */
10
+ type: "video";
11
+
12
+ /**
13
+ * File to send. Pass a file_id to send a file that exists on the Telegram
14
+ * servers (recommended), pass an HTTP URL for Telegram to get a file from the
15
+ * Internet, or pass “attach://<file_attach_name>” to upload a new one using
16
+ * multipart/form-data under <file_attach_name> name.
17
+ */
18
+ media: string;
19
+
20
+ /**
21
+ * Optional. Thumbnail of the file sent; can be ignored if thumbnail
22
+ * generation for the file is supported server-side. The thumbnail should be
23
+ * in JPEG format and less than 200 kB in size. A thumbnail's width and height
24
+ * should not exceed 320. Thumbnails can't be reused and can be only uploaded
25
+ * as a new file, so you can pass “attach://<file_attach_name>” if the
26
+ * thumbnail was uploaded using multipart/form-data under <file_attach_name>.
27
+ */
28
+ thumbnail?: string;
29
+
30
+ /**
31
+ * Optional. Video width
32
+ */
33
+ width?: number;
34
+
35
+ /**
36
+ * Optional. Video height
37
+ */
38
+ height?: number;
39
+
40
+ /**
41
+ * Optional. Video duration in seconds
42
+ */
43
+ duration?: number;
44
+
45
+ /**
46
+ * Optional. Pass True if the uploaded video is suitable for streaming
47
+ */
48
+ supports_streaming?: boolean;
49
+ };
@@ -0,0 +1,28 @@
1
+ import type { LinkPreviewOptions, MessageEntity, ParseMode } from "./";
2
+
3
+ /**
4
+ * ## InputTextMessageContent
5
+ * Represents the content of a text message to be sent as the result of an inline query.
6
+ * @see https://core.telegram.org/bots/api#inputtextmessagecontent
7
+ */
8
+ export type InputTextMessageContent = {
9
+ /**
10
+ * Text of the message to be sent, 1-4096 characters
11
+ */
12
+ message_text: string;
13
+
14
+ /**
15
+ * Optional. Mode for parsing entities in the message text. See formatting options for more details.
16
+ */
17
+ parse_mode?: ParseMode;
18
+
19
+ /**
20
+ * Optional. List of special entities that appear in message text, which can be specified instead of parse_mode
21
+ */
22
+ entities?: MessageEntity[];
23
+
24
+ /**
25
+ * Optional. Link preview generation options for the message
26
+ */
27
+ link_preview_options?: LinkPreviewOptions;
28
+ };
@@ -0,0 +1,47 @@
1
+ /**
2
+ * ## InputVenueMessageContent
3
+ * Represents the content of a venue message to be sent as the result of an inline query.
4
+ * @see https://core.telegram.org/bots/api#inputvenuemessagecontent
5
+ */
6
+ export type InputVenueMessageContent = {
7
+ /**
8
+ * Latitude of the venue in degrees
9
+ */
10
+ latitude: number;
11
+
12
+ /**
13
+ * Longitude of the venue in degrees
14
+ */
15
+ longitude: number;
16
+
17
+ /**
18
+ * Name of the venue
19
+ */
20
+ title: string;
21
+
22
+ /**
23
+ * Address of the venue
24
+ */
25
+ address: string;
26
+
27
+ /**
28
+ * Optional. Foursquare identifier of the venue, if known
29
+ */
30
+ foursquare_id?: string;
31
+
32
+ /**
33
+ * Optional. Foursquare type of the venue, if known.
34
+ * (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)
35
+ */
36
+ foursquare_type?: string;
37
+
38
+ /**
39
+ * Optional. Google Places identifier of the venue
40
+ */
41
+ google_place_id?: string;
42
+
43
+ /**
44
+ * Optional. Google Places type of the venue. (See supported types.)
45
+ */
46
+ google_place_type?: string;
47
+ };
@@ -0,0 +1,35 @@
1
+ import type { Currencies } from "./index";
2
+
3
+ /**
4
+ * ## Invoice
5
+ * This object contains basic information about an invoice.
6
+ * @see https://core.telegram.org/bots/api#invoice
7
+ */
8
+ export type Invoice = {
9
+ /**
10
+ * Product name
11
+ */
12
+ title: string;
13
+
14
+ /**
15
+ * Product description
16
+ */
17
+ description: string;
18
+
19
+ /**
20
+ * Unique bot deep-linking parameter that can be used to generate this invoice
21
+ */
22
+ start_parameter: string;
23
+
24
+ /**
25
+ * Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars
26
+ */
27
+ currency: Currencies | "XTR";
28
+
29
+ /**
30
+ * Total price in the smallest units of the currency (integer, not float/double).
31
+ * For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the
32
+ * number of digits past the decimal point for each currency (2 for the majority of currencies).
33
+ */
34
+ total_amount: number;
35
+ };
@@ -0,0 +1,61 @@
1
+ import type { AtMostOne } from "../utils";
2
+ import type {
3
+ KeyboardButtonPollType,
4
+ KeyboardButtonRequestChat,
5
+ KeyboardButtonRequestUsers,
6
+ WebAppInfo,
7
+ } from "./";
8
+
9
+ /**
10
+ * ## KeyboardButton
11
+ * This object represents one button of the reply keyboard. At most one of the optional fields must be used to specify
12
+ * type of the button. For simple text buttons, String can be used instead of this object to specify the button text.
13
+ * @see https://core.telegram.org/bots/api#keyboardbutton
14
+ */
15
+ export type KeyboardButton =
16
+ | string
17
+ | ({
18
+ /**
19
+ * Text of the button. If none of the optional fields are used, it will be sent as a message when the button is
20
+ * pressed
21
+ */
22
+ text: string;
23
+ } & Partial<
24
+ AtMostOne<{
25
+ /**
26
+ * Optional. If specified, pressing the button will open a list of suitable users. Identifiers of selected users
27
+ * will be sent to the bot in a “users_shared” service message. Available in private chats only.
28
+ */
29
+ request_users?: KeyboardButtonRequestUsers;
30
+
31
+ /**
32
+ * Optional. If specified, pressing the button will open a list of suitable chats. Tapping on a chat will send
33
+ * its identifier to the bot in a “chat_shared” service message. Available in private chats only.
34
+ */
35
+ request_chat?: KeyboardButtonRequestChat;
36
+
37
+ /**
38
+ * Optional. If True, the user's phone number will be sent as a contact when the button is pressed. Available in
39
+ * private chats only.
40
+ */
41
+ request_contact?: boolean;
42
+
43
+ /**
44
+ * Optional. If True, the user's current location will be sent when the button is pressed. Available in private
45
+ * chats only.
46
+ */
47
+ request_location?: boolean;
48
+
49
+ /**
50
+ * Optional. If specified, the user will be asked to create a poll and send it to the bot when the button is
51
+ * pressed. Available in private chats only.
52
+ */
53
+ request_poll?: KeyboardButtonPollType;
54
+
55
+ /**
56
+ * Optional. If specified, the described Web App will be launched when the button is pressed. The Web App will
57
+ * be able to send a “web_app_data” service message. Available in private chats only.
58
+ */
59
+ web_app?: WebAppInfo;
60
+ }>
61
+ >);
@@ -0,0 +1,13 @@
1
+ /**
2
+ * ## KeyboardButtonPollType
3
+ * This object represents type of a poll, which is allowed to be created and sent when the corresponding button is
4
+ * pressed.
5
+ * @see https://core.telegram.org/bots/api#keyboardbuttonpolltype
6
+ */
7
+ export type KeyboardButtonPollType = {
8
+ /**
9
+ * Optional. If quiz is passed, the user will be allowed to create only polls in the quiz mode. If regular is passed,
10
+ * only regular polls will be allowed. Otherwise, the user will be allowed to create a poll of any type.
11
+ */
12
+ type?: "quiz" | "regular";
13
+ };
@@ -0,0 +1,68 @@
1
+ import type { ChatAdministratorRights } from "./ChatAdministratorRights";
2
+
3
+ /**
4
+ * ## KeyboardButtonRequestChat
5
+ * This object defines the criteria used to request a suitable chat. Information about the selected chat will be shared
6
+ * with the bot when the corresponding button is pressed. The bot will be granted requested rights in the chat if
7
+ * appropriate. [More about requesting chats](https://core.telegram.org/bots/features#chat-and-user-selection).
8
+ * @see https://core.telegram.org/bots/api#keyboardbuttonrequestchat
9
+ */
10
+ export type KeyboardButtonRequestChat = {
11
+ /**
12
+ * Signed 32-bit identifier of the request, which will be received back in the ChatShared object. Must be unique
13
+ * within the message
14
+ */
15
+ request_id: number;
16
+
17
+ /**
18
+ * Pass True to request a channel chat, pass False to request a group or a supergroup chat.
19
+ */
20
+ chat_is_channel: boolean;
21
+
22
+ /**
23
+ * Optional. Pass True to request a forum supergroup, pass False to request a non-forum chat. If not specified, no
24
+ * additional restrictions are applied.
25
+ */
26
+ chat_is_forum?: boolean;
27
+
28
+ /**
29
+ * Optional. Pass True to request a supergroup or a channel with a username, pass False to request a chat without a
30
+ * username. If not specified, no additional restrictions are applied.
31
+ */
32
+ chat_has_username?: boolean;
33
+
34
+ /**
35
+ * Optional. Pass True to request a chat owned by the user. Otherwise, no additional restrictions are applied.
36
+ */
37
+ chat_is_created?: boolean;
38
+
39
+ /**
40
+ * Optional. A JSON-serialized object listing the required administrator rights of the user in the chat. The rights
41
+ * must be a superset of bot_administrator_rights. If not specified, no additional restrictions are applied.
42
+ */
43
+ user_administrator_rights?: Partial<ChatAdministratorRights>;
44
+ /**
45
+ * Optional. A JSON-serialized object listing the required administrator rights of the bot in the chat. The rights
46
+ * must be a subset of user_administrator_rights. If not specified, no additional restrictions are applied.
47
+ */
48
+ bot_administrator_rights?: Partial<ChatAdministratorRights>;
49
+ /**
50
+ * Optional. Pass True to request a chat with the bot as a member. Otherwise, no additional restrictions are applied.
51
+ */
52
+ bot_is_member?: boolean;
53
+
54
+ /**
55
+ * Optional. Pass True to request the chat's title
56
+ */
57
+ request_title?: boolean;
58
+
59
+ /**
60
+ * Optional. Pass True to request the chat's username
61
+ */
62
+ request_username?: boolean;
63
+
64
+ /**
65
+ * Optional. Pass True to request the chat's photo
66
+ */
67
+ request_photo?: boolean;
68
+ };
@@ -0,0 +1,45 @@
1
+ /**
2
+ * ## KeyboardButtonRequestUsers
3
+ * This object defines the criteria used to request suitable users. Information about the selected users will be shared
4
+ * with the bot when the corresponding button is pressed. [More about requesting users](https://core.telegram.org/bots/features#chat-and-user-selection)
5
+ * @see https://core.telegram.org/bots/api#keyboardbuttonrequestusers
6
+ */
7
+ export type KeyboardButtonRequestUsers = {
8
+ /**
9
+ * Signed 32-bit identifier of the request that will be received back in the UsersShared object. Must be unique within
10
+ * the message
11
+ */
12
+ request_id: number;
13
+
14
+ /**
15
+ * Optional. Pass True to request bots, pass False to request regular users. If not specified, no additional
16
+ * restrictions are applied.
17
+ */
18
+ user_is_bot?: boolean;
19
+
20
+ /**
21
+ * Optional. Pass True to request premium users, pass False to request non-premium users. If not specified, no
22
+ * additional restrictions are applied.
23
+ */
24
+ user_is_premium?: boolean;
25
+
26
+ /**
27
+ * Optional. The maximum number of users to be selected; 1-10. Defaults to 1.
28
+ */
29
+ max_quantity?: number;
30
+
31
+ /**
32
+ * Optional. Pass True to request the users' first and last names
33
+ */
34
+ request_name?: boolean;
35
+
36
+ /**
37
+ * Optional. Pass True to request the users' usernames
38
+ */
39
+ request_username?: boolean;
40
+
41
+ /**
42
+ * Optional. Pass True to request the users' photos
43
+ */
44
+ request_photo?: boolean;
45
+ };
@@ -0,0 +1,18 @@
1
+ /**
2
+ * ## LabeledPrice
3
+ * This object represents a portion of the price for goods or services.
4
+ * @see https://core.telegram.org/bots/api#labeledprice
5
+ */
6
+ export type LabeledPrice = {
7
+ /**
8
+ * Portion label
9
+ */
10
+ label: string;
11
+
12
+ /**
13
+ * Price of the product in the smallest units of the currency (integer, not float/double). For example, for a price
14
+ * of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the
15
+ * decimal point for each currency (2 for the majority of currencies).
16
+ */
17
+ amount: number;
18
+ };
@@ -0,0 +1,32 @@
1
+ /**
2
+ * ## LinkPreviewOptions
3
+ * Describes the options used for link preview generation.
4
+ * @see https://core.telegram.org/bots/api#linkpreviewoptions
5
+ */
6
+ export type LinkPreviewOptions = {
7
+ /**
8
+ * Optional. True, if the link preview is disabled
9
+ */
10
+ is_disabled?: boolean;
11
+
12
+ /**
13
+ * Optional. URL to use for the link preview. If empty, then the first URL found in the message text will be used
14
+ */
15
+ url?: string;
16
+ /**
17
+ * Optional. True, if the media in the link preview is supposed to be shrunk; ignored if the URL isn't explicitly
18
+ * specified or media size change isn't supported for the preview
19
+ */
20
+ prefer_small_media?: boolean;
21
+ /**
22
+ * Optional. True, if the media in the link preview is supposed to be enlarged; ignored if the URL isn't explicitly
23
+ * specified or media size change isn't supported for the preview
24
+ */
25
+ prefer_large_media?: boolean;
26
+
27
+ /**
28
+ * Optional. True, if the link preview must be shown above the message text; otherwise, the link preview will be shown
29
+ * below the message text
30
+ */
31
+ show_above_text?: boolean;
32
+ };
@@ -0,0 +1,38 @@
1
+ /**
2
+ * ## Location
3
+ * his object represents a point on the map.
4
+ * @see https://core.telegram.org/bots/api#location
5
+ */
6
+ export type Location = {
7
+ /**
8
+ * Latitude as defined by the sender
9
+ */
10
+ latitude: number;
11
+
12
+ /**
13
+ * Longitude as defined by the sender
14
+ */
15
+ longitude: number;
16
+
17
+ /**
18
+ * Optional. The radius of uncertainty for the location, measured in meters; 0-1500
19
+ */
20
+ horizontal_accuracy?: number;
21
+
22
+ /**
23
+ * Optional. Time relative to the message sending date, during which the location can be updated; in seconds.
24
+ * For active live locations only.
25
+ */
26
+ live_period?: number;
27
+
28
+ /**
29
+ * Optional. The direction in which user is moving, in degrees; 1-360. For active live locations only.
30
+ */
31
+ heading?: number;
32
+
33
+ /**
34
+ * Optional. The maximum distance for proximity alerts about approaching another chat member, in meters. For sent
35
+ * live locations only.
36
+ */
37
+ proximity_alert_radius?: number;
38
+ };
@@ -0,0 +1,26 @@
1
+ /**
2
+ * ## LocationAddress
3
+ * Describes the physical address of a location.
4
+ * @see https://core.telegram.org/bots/api#locationaddress
5
+ */
6
+ export type LocationAddress = {
7
+ /**
8
+ * The two-letter ISO 3166-1 alpha-2 country code of the country where the location is located
9
+ */
10
+ country_code: string;
11
+
12
+ /**
13
+ * Optional. State of the location
14
+ */
15
+ state?: string;
16
+
17
+ /**
18
+ * Optional. City of the location
19
+ */
20
+ city?: string;
21
+
22
+ /**
23
+ * Optional. Street address of the location
24
+ */
25
+ street?: string;
26
+ };
@@ -0,0 +1,37 @@
1
+ /**
2
+ * ## LoginUrl
3
+ * This object represents a parameter of the inline keyboard button used to automatically authorize a user. Serves as a
4
+ * great replacement for the Telegram Login Widget when the user is coming from Telegram. All the user needs to do is
5
+ * tap/click a button and confirm that they want to log in:
6
+ * Telegram apps support these buttons as of version 5.7.
7
+ * > Sample bot: @discussbot
8
+ * @see https://core.telegram.org/bots/api#loginurl
9
+ */
10
+ export type LoginUrl = {
11
+ /**
12
+ * An HTTPS URL to be opened with user authorization data added to the query string when the button is pressed.
13
+ * If the user refuses to provide authorization data, the original URL without information about the user will be
14
+ * opened. The data added is the same as described in Receiving authorization data.
15
+ *
16
+ * NOTE: You must always check the hash of the received data to verify the authentication and the integrity of the
17
+ * data as described in Checking authorization.
18
+ */
19
+ url: string;
20
+
21
+ /**
22
+ * Optional. New text of the button in forwarded messages.
23
+ */
24
+ forward_text?: string;
25
+
26
+ /**
27
+ * Optional. Username of a bot, which will be used for user authorization. See Setting up a bot for more details.
28
+ * If not specified, the current bot's username will be assumed. The url's domain must be the same as the domain
29
+ * linked with the bot. See Linking your domain to the bot for more details.
30
+ */
31
+ bot_username?: string;
32
+
33
+ /**
34
+ * Optional. Pass True to request the permission for your bot to send messages to the user.
35
+ */
36
+ request_write_access?: boolean;
37
+ };
@@ -0,0 +1,28 @@
1
+ /**
2
+ * ## MaskPosition
3
+ * This object describes the position on faces where a mask should be placed by default.
4
+ * @see https://core.telegram.org/bots/api#maskposition
5
+ */
6
+ export type MaskPosition = {
7
+ /**
8
+ * The part of the face relative to which the mask should be placed. One of “forehead”, “eyes”, “mouth”, or “chin”.
9
+ */
10
+ point: "forehead" | "eyes" | "mouth" | "chin";
11
+
12
+ /**
13
+ * Shift by X-axis measured in widths of the mask scaled to the face size, from left to right. For example,
14
+ * choosing -1.0 will place mask just to the left of the default mask position.
15
+ */
16
+ x_shift: number;
17
+
18
+ /**
19
+ * Shift by Y-axis measured in heights of the mask scaled to the face size, from top to bottom. For example,
20
+ * 1.0 will place the mask just below the default mask position.
21
+ */
22
+ y_shift: number;
23
+
24
+ /**
25
+ * Mask scaling coefficient. For example, 2.0 means double size.
26
+ */
27
+ scale: number;
28
+ };