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,7 @@
1
+ /**
2
+ * ## GeneralForumTopicHidden
3
+ * This object represents a service message about General forum topic hidden in the chat. Currently holds no
4
+ * information.
5
+ * @see https://core.telegram.org/bots/api#generalforumtopichidden
6
+ */
7
+ export type GeneralForumTopicHidden = Record<string, never>;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * ## GeneralForumTopicUnhidden
3
+ * This object represents a service message about General forum topic unhidden in the chat. Currently holds no
4
+ * information.
5
+ * @see https://core.telegram.org/bots/api#generalforumtopicunhidden
6
+ */
7
+ export type GeneralForumTopicUnhidden = Record<string, never>;
package/@types/Gift.ts ADDED
@@ -0,0 +1,38 @@
1
+ import type { Sticker } from "./";
2
+
3
+ /**
4
+ * ## Gift
5
+ * This object represents a gift that can be sent by the bot.
6
+ * @see https://core.telegram.org/bots/api#gift
7
+ */
8
+ export type Gift = {
9
+ /**
10
+ * Unique identifier of the gift
11
+ */
12
+ id: string;
13
+
14
+ /**
15
+ * The sticker that represents the gift
16
+ */
17
+ sticker: Sticker;
18
+
19
+ /**
20
+ * The number of Telegram Stars that must be paid to send the sticker
21
+ */
22
+ star_count: number;
23
+
24
+ /**
25
+ * Optional. The number of Telegram Stars that must be paid to upgrade the gift to a unique one
26
+ */
27
+ upgrade_star_count?: number;
28
+
29
+ /**
30
+ * Optional. The total number of the gifts of this type that can be sent; for limited gifts only
31
+ */
32
+ total_count?: number;
33
+
34
+ /**
35
+ * Optional. The number of remaining gifts of this type that can be sent; for limited gifts only
36
+ */
37
+ remaining_count?: number;
38
+ };
@@ -0,0 +1,52 @@
1
+ import type { Gift } from "./Gift";
2
+ import type { MessageEntity } from "./MessageEntity";
3
+
4
+ /**
5
+ * ## GiftInfo
6
+ * Describes a service message about a regular gift that was sent or received.
7
+ * @see https://core.telegram.org/bots/api#giftinfo
8
+ */
9
+ export type GiftInfo = {
10
+ /**
11
+ * Information about the gift
12
+ */
13
+ gift: Gift;
14
+
15
+ /**
16
+ * Optional. Unique identifier of the received gift for the bot; only present
17
+ * for gifts received on behalf of business accounts
18
+ */
19
+ owned_gift_id?: string;
20
+
21
+ /**
22
+ * Optional. Number of Telegram Stars that can be claimed by the receiver by
23
+ * converting the gift; omitted if conversion to Telegram Stars is impossible
24
+ */
25
+ convert_star_count?: number;
26
+
27
+ /**
28
+ * Optional. Number of Telegram Stars that were prepaid by the sender for the ability to upgrade the gift
29
+ */
30
+ prepaid_upgrade_star_count?: number;
31
+
32
+ /**
33
+ * Optional. True, if the gift can be upgraded to a unique gift
34
+ */
35
+ can_be_upgraded?: true;
36
+
37
+ /**
38
+ * Optional. Text of the message that was added to the gift
39
+ */
40
+ text?: string;
41
+
42
+ /**
43
+ * Optional. Special entities that appear in the text
44
+ */
45
+ entities?: MessageEntity[];
46
+
47
+ /**
48
+ * Optional. True, if the sender and gift text are shown only to the gift
49
+ * receiver; otherwise, everyone will be able to see them
50
+ */
51
+ is_private?: true;
52
+ };
@@ -0,0 +1,13 @@
1
+ import type { Gift } from "./";
2
+
3
+ /**
4
+ * ## Gifts
5
+ * This object represent a list of gifts.
6
+ * @see https://core.telegram.org/bots/api#gifts
7
+ */
8
+ export type Gifts = {
9
+ /**
10
+ * The list of gifts
11
+ */
12
+ gifts: Gift[];
13
+ };
@@ -0,0 +1,55 @@
1
+ import type { Chat } from "./";
2
+
3
+ /**
4
+ * ## Giveaway
5
+ * This object represents a message about a scheduled giveaway.
6
+ * @see https://core.telegram.org/bots/api#giveaway
7
+ */
8
+ export type Giveaway = {
9
+ /**
10
+ * The list of chats which the user must join to participate in the giveaway
11
+ */
12
+ chat: Chat;
13
+
14
+ /**
15
+ * Point in time (Unix timestamp) when winners of the giveaway will be selected
16
+ */
17
+ winners_selection_date: number;
18
+
19
+ /**
20
+ * The number of users which are supposed to be selected as winners of the giveaway
21
+ */
22
+ winner_count?: number;
23
+
24
+ /**
25
+ * Optional. True, if only users who join the chats after the giveaway started should be eligible to win
26
+ */
27
+ only_new_members?: boolean;
28
+
29
+ /**
30
+ * Optional. True, if the list of giveaway winners will be visible to everyone
31
+ */
32
+ has_public_winners?: boolean;
33
+
34
+ /**
35
+ * Optional. Description of additional giveaway prize
36
+ */
37
+ prize_description?: string;
38
+
39
+ /**
40
+ * Optional. A list of two-letter ISO 3166-1 alpha-2 country codes indicating the countries from which eligible users
41
+ * for the giveaway must come. If empty, then all users can participate in the giveaway. Users with a phone number
42
+ * that was bought on Fragment can always participate in giveaways.
43
+ */
44
+ country_codes?: string[];
45
+
46
+ /**
47
+ * Optional. The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only
48
+ */
49
+ prize_star_count?: number;
50
+
51
+ /**
52
+ * Optional. The number of months the Telegram Premium subscription won from the giveaway will be active for
53
+ */
54
+ premium_subscription_month_count?: number;
55
+ };
@@ -0,0 +1,29 @@
1
+ import type { Message } from "./";
2
+
3
+ /**
4
+ * ## GiveawayCompleted
5
+ * This object represents a service message about the completion of a giveaway without public winners.
6
+ * @see https://core.telegram.org/bots/api#giveawaycompleted
7
+ */
8
+ export type GiveawayCompleted = {
9
+ /**
10
+ * Number of winners in the giveaway
11
+ */
12
+ winner_count: number;
13
+
14
+ /**
15
+ * Optional. Number of undistributed prizes
16
+ */
17
+ unclaimed_prize_count: number;
18
+
19
+ /**
20
+ * Optional. Message with the giveaway that was completed, if it wasn't deleted
21
+ */
22
+ giveaway_message: Message;
23
+
24
+ /**
25
+ * Optional. True, if the giveaway is a Telegram Star giveaway. Otherwise, currently, the giveaway is a Telegram
26
+ * Premium giveaway.
27
+ */
28
+ is_star_giveaway: boolean;
29
+ };
@@ -0,0 +1,11 @@
1
+ /**
2
+ * ## GiveawayCreated
3
+ * This object represents a service message about the creation of a scheduled giveaway.
4
+ * @see https://core.telegram.org/bots/api#giveawaycreated
5
+ */
6
+ export type GiveawayCreated = {
7
+ /**
8
+ * Optional. The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only
9
+ */
10
+ prize_star_count?: number;
11
+ };
@@ -0,0 +1,68 @@
1
+ import type { Chat, User } from "./";
2
+
3
+ /**
4
+ * ## GiveawayWinners
5
+ * This object represents a message about the completion of a giveaway with public winners.
6
+ * @see https://core.telegram.org/bots/api#giveawaywinners
7
+ */
8
+ export type GiveawayWinners = {
9
+ /**
10
+ * The chat that created the giveaway
11
+ */
12
+ chat: Chat;
13
+
14
+ /**
15
+ * Identifier of the message with the giveaway in the chat
16
+ */
17
+ giveaway_message_id: number;
18
+
19
+ /**
20
+ * Point in time (Unix timestamp) when winners of the giveaway were selected
21
+ */
22
+ winners_selection_date: number;
23
+
24
+ /**
25
+ * Total number of winners in the giveaway
26
+ */
27
+ winner_count: number;
28
+
29
+ /**
30
+ * List of up to 100 winners of the giveaway
31
+ */
32
+ winners: User[];
33
+
34
+ /**
35
+ * Optional. The number of other chats the user had to join in order to be eligible for the giveaway
36
+ */
37
+ additional_chat_count?: number;
38
+
39
+ /**
40
+ * Optional. The number of Telegram Stars that were split between giveaway winners; for Telegram Star giveaways only
41
+ */
42
+ prize_star_count?: number;
43
+
44
+ /**
45
+ * Optional. The number of months the Telegram Premium subscription won from the giveaway will be active for
46
+ */
47
+ premium_subscription_month_count?: number;
48
+
49
+ /**
50
+ * Optional. Number of undistributed prizes
51
+ */
52
+ unclaimed_prize_count?: number;
53
+
54
+ /**
55
+ * Optional. True, if only users who had joined the chats after the giveaway started were eligible to win
56
+ */
57
+ only_new_members?: boolean;
58
+
59
+ /**
60
+ * Optional. True, if the giveaway was canceled because the payment for it was refunded
61
+ */
62
+ was_refunded?: boolean;
63
+
64
+ /**
65
+ * Optional. Description of additional giveaway prize
66
+ */
67
+ prize_description?: string;
68
+ };
@@ -0,0 +1,23 @@
1
+ import type { Chat } from "./";
2
+
3
+ /**
4
+ * ## InaccessibleMessage
5
+ * This object describes a message that was deleted or is otherwise inaccessible to the bot.
6
+ * @see https://core.telegram.org/bots/api#inaccessiblemessage
7
+ */
8
+ export type InaccessibleMessage = {
9
+ /**
10
+ * Chat the message belonged to
11
+ */
12
+ chat: Chat;
13
+
14
+ /**
15
+ * Unique message identifier inside the chat
16
+ */
17
+ message_id: number;
18
+
19
+ /**
20
+ * Always 0. The field can be used to differentiate regular and inaccessible messages.
21
+ */
22
+ date: 0;
23
+ };
@@ -0,0 +1,88 @@
1
+ import type {
2
+ CallbackGame,
3
+ CopyTextButton,
4
+ LoginUrl,
5
+ SwitchInlineQueryChosenChat,
6
+ WebAppInfo,
7
+ } from "./";
8
+
9
+ /**
10
+ * ## InlineKeyboardButton
11
+ * This object represents one button of an inline keyboard. Exactly one of the optional fields must be used to specify
12
+ * type of the button.
13
+ * @see https://core.telegram.org/bots/api#inlinekeyboardbutton
14
+ */
15
+ export type InlineKeyboardButton = {
16
+ /**
17
+ * Label text on the button
18
+ */
19
+ text: string;
20
+
21
+ /**
22
+ * Optional. HTTP or tg:// URL to be opened when the button is pressed. Links tg://user?id=<user_id> can be used to
23
+ * mention a user by their identifier without using a username, if this is allowed by their privacy settings.
24
+ */
25
+ url?: string;
26
+
27
+ /**
28
+ * Optional. Data to be sent in a callback query to the bot when the button is pressed, 1-64 bytes
29
+ */
30
+ callback_data?: string;
31
+
32
+ /**
33
+ * Optional. Description of the Web App that will be launched when the user presses the button. The Web App will be
34
+ * able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Available only in
35
+ * private chats between a user and the bot. Not supported for messages sent on behalf of a Telegram Business account.
36
+ */
37
+ web_app?: WebAppInfo;
38
+
39
+ /**
40
+ * Optional. An HTTPS URL used to automatically authorize the user. Can be used as a replacement for the Telegram
41
+ * Login Widget.
42
+ */
43
+ login_url?: LoginUrl;
44
+
45
+ /**
46
+ * Optional. If set, pressing the button will prompt the user to select one of their chats, open that chat and insert
47
+ * the bot's username and the specified inline query in the input field. May be empty, in which case just the bot's
48
+ * username will be inserted. Not supported for messages sent on behalf of a Telegram Business account.
49
+ */
50
+ switch_inline_query?: string;
51
+
52
+ /**
53
+ * Optional. If set, pressing the button will insert the bot's username and the specified inline query in the current
54
+ * chat's input field. May be empty, in which case only the bot's username will be inserted.
55
+ *
56
+ * This offers a quick way for the user to open your bot in inline mode in the same chat - good for selecting
57
+ * something from multiple options. Not supported in channels and for messages sent on behalf of a Telegram Business
58
+ * account.
59
+ */
60
+ switch_inline_query_current_chat?: string;
61
+
62
+ /**
63
+ * Optional. If set, pressing the button will prompt the user to select one of their chats of the specified type, open
64
+ * that chat and insert the bot's username and the specified inline query in the input field. Not supported for
65
+ * messages sent on behalf of a Telegram Business account.
66
+ */
67
+ switch_inline_query_chosen_chat?: SwitchInlineQueryChosenChat;
68
+
69
+ /**
70
+ * Optional. Description of the button that copies the specified text to the clipboard.
71
+ */
72
+ copy_text?: CopyTextButton;
73
+
74
+ /**
75
+ * Optional. Description of the game that will be launched when the user presses the button.
76
+ * NOTE: This type of button must always be the first button in the first row.
77
+ */
78
+ callback_game?: CallbackGame;
79
+
80
+ /**
81
+ * Optional. Specify True, to send a Pay button. Substrings “⭐” and “XTR” in the buttons's text will be replaced with
82
+ * a Telegram Star icon.
83
+ *
84
+ * NOTE: This type of button must always be the first button in the first row and can only be used in invoice
85
+ * messages.
86
+ */
87
+ pay?: boolean;
88
+ };
@@ -0,0 +1,13 @@
1
+ import type { InlineKeyboardButton } from "./";
2
+
3
+ /**
4
+ * ## InlineKeyboardMarkup
5
+ * This object represents an inline keyboard that appears right next to the message it belongs to.
6
+ * @see https://core.telegram.org/bots/api#inlinekeyboardmarkup
7
+ */
8
+ export type InlineKeyboardMarkup = {
9
+ /**
10
+ * Array of button rows, each represented by an Array of InlineKeyboardButton objects
11
+ */
12
+ inline_keyboard: InlineKeyboardButton[][];
13
+ };
@@ -0,0 +1,41 @@
1
+ import type { Location, User } from "./";
2
+
3
+ /**
4
+ * ## InlineQuery
5
+ * This object represents an incoming inline query. When the user sends an empty query, your bot could return some
6
+ * default or trending results.
7
+ * @see https://core.telegram.org/bots/api#inlinequery
8
+ */
9
+ export type InlineQuery = {
10
+ /**
11
+ * Unique identifier for this query
12
+ */
13
+ id: string;
14
+
15
+ /**
16
+ * Sender
17
+ */
18
+ from: User;
19
+
20
+ /**
21
+ * Text of the query (up to 256 characters)
22
+ */
23
+ query: string;
24
+
25
+ /**
26
+ * Offset of the results to be returned, can be controlled by the bot
27
+ */
28
+ offset: string;
29
+
30
+ /**
31
+ * Optional. Type of the chat from which the inline query was sent. Can be either “sender” for a private chat with
32
+ * the inline query sender, “private”, “group”, “supergroup”, or “channel”. The chat type should be always known for
33
+ * requests sent from official clients and most third-party clients, unless the request was sent from a secret chat
34
+ */
35
+ chat_type?: "sender" | "private" | "group" | "supergroup" | "channel";
36
+
37
+ /**
38
+ * Optional. Sender location, only for bots that request user location
39
+ */
40
+ location?: Location;
41
+ };
@@ -0,0 +1,70 @@
1
+ import type {
2
+ InlineQueryResultArticle,
3
+ InlineQueryResultAudio,
4
+ InlineQueryResultCachedAudio,
5
+ InlineQueryResultCachedDocument,
6
+ InlineQueryResultCachedGif,
7
+ InlineQueryResultCachedMpeg4Gif,
8
+ InlineQueryResultCachedPhoto,
9
+ InlineQueryResultCachedSticker,
10
+ InlineQueryResultCachedVideo,
11
+ InlineQueryResultCachedVoice,
12
+ InlineQueryResultContact,
13
+ InlineQueryResultDocument,
14
+ InlineQueryResultGame,
15
+ InlineQueryResultGif,
16
+ InlineQueryResultLocation,
17
+ InlineQueryResultMpeg4Gif,
18
+ InlineQueryResultPhoto,
19
+ InlineQueryResultVenue,
20
+ InlineQueryResultVideo,
21
+ InlineQueryResultVoice,
22
+ } from "./";
23
+
24
+ /**
25
+ * ## InlineQueryResult
26
+ * This object represents one result of an inline query. Telegram clients currently support results of the following
27
+ * 20 types:
28
+ * - InlineQueryResultCachedAudio
29
+ * - InlineQueryResultCachedDocument
30
+ * - InlineQueryResultCachedGif
31
+ * - InlineQueryResultCachedMpeg4Gif
32
+ * - InlineQueryResultCachedPhoto
33
+ * - InlineQueryResultCachedSticker
34
+ * - InlineQueryResultCachedVideo
35
+ * - InlineQueryResultCachedVoice
36
+ * - InlineQueryResultArticle
37
+ * - InlineQueryResultAudio
38
+ * - InlineQueryResultContact
39
+ * - InlineQueryResultGame
40
+ * - InlineQueryResultDocument
41
+ * - InlineQueryResultGif
42
+ * - InlineQueryResultLocation
43
+ * - InlineQueryResultMpeg4Gif
44
+ * - InlineQueryResultPhoto
45
+ * - InlineQueryResultVenue
46
+ * - InlineQueryResultVideo
47
+ * - InlineQueryResultVoice
48
+ * @see https://core.telegram.org/bots/api#inlinequeryresult
49
+ */
50
+ export type InlineQueryResult =
51
+ | InlineQueryResultCachedAudio
52
+ | InlineQueryResultCachedDocument
53
+ | InlineQueryResultCachedGif
54
+ | InlineQueryResultCachedMpeg4Gif
55
+ | InlineQueryResultCachedPhoto
56
+ | InlineQueryResultCachedSticker
57
+ | InlineQueryResultCachedVideo
58
+ | InlineQueryResultCachedVoice
59
+ | InlineQueryResultArticle
60
+ | InlineQueryResultAudio
61
+ | InlineQueryResultContact
62
+ | InlineQueryResultGame
63
+ | InlineQueryResultDocument
64
+ | InlineQueryResultGif
65
+ | InlineQueryResultLocation
66
+ | InlineQueryResultMpeg4Gif
67
+ | InlineQueryResultPhoto
68
+ | InlineQueryResultVenue
69
+ | InlineQueryResultVideo
70
+ | InlineQueryResultVoice;
@@ -0,0 +1,58 @@
1
+ import type { InlineKeyboardMarkup, InputMessageContent } from "./";
2
+
3
+ /**
4
+ * ## InlineQueryResultArticle
5
+ * Represents a link to an article or web page.
6
+ * @see https://core.telegram.org/bots/api#inlinequeryresultarticle
7
+ */
8
+ export type InlineQueryResultArticle = {
9
+ /**
10
+ * Type of the result, must be article
11
+ */
12
+ type: "article";
13
+
14
+ /**
15
+ * Unique identifier for this result, 1-64 Bytes
16
+ */
17
+ id: string;
18
+
19
+ /**
20
+ * Title of the result
21
+ */
22
+ title: string;
23
+
24
+ /**
25
+ * Content of the message to be sent
26
+ */
27
+ input_message_content: InputMessageContent;
28
+
29
+ /**
30
+ * Optional. Inline keyboard attached to the message
31
+ */
32
+ reply_markup?: InlineKeyboardMarkup;
33
+
34
+ /**
35
+ * Optional. URL of the result
36
+ */
37
+ url?: string;
38
+
39
+ /**
40
+ * Optional. Short description of the result
41
+ */
42
+ description?: string;
43
+
44
+ /**
45
+ * Optional. Url of the thumbnail for the result
46
+ */
47
+ thumb_url?: string;
48
+
49
+ /**
50
+ * Optional. Thumbnail width
51
+ */
52
+ thumb_width?: number;
53
+
54
+ /**
55
+ * Optional. Thumbnail height
56
+ */
57
+ thumb_height?: number;
58
+ };
@@ -0,0 +1,69 @@
1
+ import type {
2
+ InlineKeyboardMarkup,
3
+ InputMessageContent,
4
+ MessageEntity,
5
+ ParseMode,
6
+ } from "./";
7
+
8
+ /**
9
+ * ## InlineQueryResultAudio
10
+ * Represents a link to an MP3 audio file. By default, this audio file will be sent by the user. Alternatively, you can
11
+ * use input_message_content to send a message with the specified content instead of the audio.
12
+ * @see https://core.telegram.org/bots/api#inlinequeryresultaudio
13
+ */
14
+ export type InlineQueryResultAudio = {
15
+ /**
16
+ * Type of the result, must be audio
17
+ */
18
+ type: "audio";
19
+
20
+ /**
21
+ * Unique identifier for this result, 1-64 bytes
22
+ */
23
+ id: string;
24
+
25
+ /**
26
+ * A valid URL for the audio file
27
+ */
28
+ audio_url: string;
29
+
30
+ /**
31
+ * Title
32
+ */
33
+ title: string;
34
+
35
+ /**
36
+ * Optional. Caption, 0-1024 characters after entities parsing
37
+ */
38
+ caption?: string;
39
+
40
+ /**
41
+ * Optional. Mode for parsing entities in the audio caption. See formatting options for more details.
42
+ */
43
+ parse_mode?: ParseMode;
44
+
45
+ /**
46
+ * Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
47
+ */
48
+ caption_entities?: MessageEntity[];
49
+
50
+ /**
51
+ * Optional. Performer
52
+ */
53
+ performer?: string;
54
+
55
+ /**
56
+ * Optional. Audio duration in seconds
57
+ */
58
+ audio_duration?: number;
59
+
60
+ /**
61
+ * Optional. Inline keyboard attached to the message
62
+ */
63
+ reply_markup?: InlineKeyboardMarkup;
64
+
65
+ /**
66
+ * Optional. Content of the message to be sent instead of the audio
67
+ */
68
+ input_message_content?: InputMessageContent;
69
+ };