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.
- package/.env.sample +4 -0
- package/.vscode/extensions.json +11 -0
- package/.vscode/settings.json +17 -0
- package/.zed/settings.json +20 -0
- package/@types/AcceptedGiftTypes.ts +26 -0
- package/@types/AffiliateInfo.ts +35 -0
- package/@types/Animation.ts +56 -0
- package/@types/Audio.ts +56 -0
- package/@types/BackgroundFill.ts +18 -0
- package/@types/BackgroundFillFreeformGradient.ts +16 -0
- package/@types/BackgroundFillGradient.ts +26 -0
- package/@types/BackgroundFillSolid.ts +16 -0
- package/@types/BackgroundType.ts +21 -0
- package/@types/BackgroundTypeChatTheme.ts +16 -0
- package/@types/BackgroundTypeFill.ts +23 -0
- package/@types/BackgroundTypePattern.ts +40 -0
- package/@types/BackgroundTypeWallpaper.ts +33 -0
- package/@types/Birthdate.ts +21 -0
- package/@types/BotCommand.ts +16 -0
- package/@types/BotCommandScope.ts +30 -0
- package/@types/BotCommandScopeAllChatAdministrators.ts +11 -0
- package/@types/BotCommandScopeAllGroupChats.ts +11 -0
- package/@types/BotCommandScopeAllPrivateChats.ts +11 -0
- package/@types/BotCommandScopeChat.ts +16 -0
- package/@types/BotCommandScopeChatAdministrators.ts +16 -0
- package/@types/BotCommandScopeChatMember.ts +21 -0
- package/@types/BotCommandScopeDefault.ts +12 -0
- package/@types/BotDescription.ts +11 -0
- package/@types/BotName.ts +11 -0
- package/@types/BotShortDescription.ts +11 -0
- package/@types/BusinessBotRights.ts +65 -0
- package/@types/BusinessConnection.ts +41 -0
- package/@types/BusinessIntro.ts +23 -0
- package/@types/BusinessLocation.ts +18 -0
- package/@types/BusinessMessagesDeleted.ts +24 -0
- package/@types/BusinessOpeningHours.ts +18 -0
- package/@types/BusinessOpeningHoursInterval.ts +18 -0
- package/@types/CallbackGame.ts +6 -0
- package/@types/CallbackQuery.ts +49 -0
- package/@types/Chat.ts +43 -0
- package/@types/ChatAdministratorRights.ts +84 -0
- package/@types/ChatBackground.ts +13 -0
- package/@types/ChatBoost.ts +29 -0
- package/@types/ChatBoostAdded.ts +11 -0
- package/@types/ChatBoostRemoved.ts +28 -0
- package/@types/ChatBoostSource.ts +18 -0
- package/@types/ChatBoostSourceGiftCode.ts +19 -0
- package/@types/ChatBoostSourceGiveaway.ts +35 -0
- package/@types/ChatBoostSourcePremium.ts +19 -0
- package/@types/ChatBoostUpdated.ts +18 -0
- package/@types/ChatFullInfo.ts +260 -0
- package/@types/ChatInviteLink.ts +66 -0
- package/@types/ChatJoinRequest.ts +42 -0
- package/@types/ChatLocation.ts +16 -0
- package/@types/ChatMember.ts +28 -0
- package/@types/ChatMemberAdministrator.ts +107 -0
- package/@types/ChatMemberBanned.ts +23 -0
- package/@types/ChatMemberLeft.ts +18 -0
- package/@types/ChatMemberMember.ts +23 -0
- package/@types/ChatMemberOwner.ts +28 -0
- package/@types/ChatMemberRestricted.ts +99 -0
- package/@types/ChatMemberUpdated.ts +49 -0
- package/@types/ChatPermissions.ts +78 -0
- package/@types/ChatPhoto.ts +30 -0
- package/@types/ChatShared.ts +36 -0
- package/@types/Checklist.ts +33 -0
- package/@types/ChecklistTask.ts +33 -0
- package/@types/ChecklistTasksAdded.ts +19 -0
- package/@types/ChecklistTasksDone.ts +24 -0
- package/@types/ChosenInlineResult.ts +34 -0
- package/@types/Contact.ts +33 -0
- package/@types/CopyTextButton.ts +11 -0
- package/@types/Dice.ts +17 -0
- package/@types/DirectMessagePriceChanged.ts +17 -0
- package/@types/Document.ts +41 -0
- package/@types/EncryptedCredentials.ts +23 -0
- package/@types/EncryptedPassportElement.ts +357 -0
- package/@types/ExternalReplyInfo.ts +159 -0
- package/@types/File.ts +33 -0
- package/@types/ForceReply.ts +26 -0
- package/@types/ForumTopic.ts +26 -0
- package/@types/ForumTopicClosed.ts +6 -0
- package/@types/ForumTopicCreated.ts +21 -0
- package/@types/ForumTopicEdited.ts +17 -0
- package/@types/ForumTopicReopened.ts +6 -0
- package/@types/Game.ts +41 -0
- package/@types/GameHighScore.ts +23 -0
- package/@types/GeneralForumTopicHidden.ts +7 -0
- package/@types/GeneralForumTopicUnhidden.ts +7 -0
- package/@types/Gift.ts +38 -0
- package/@types/GiftInfo.ts +52 -0
- package/@types/Gifts.ts +13 -0
- package/@types/Giveaway.ts +55 -0
- package/@types/GiveawayCompleted.ts +29 -0
- package/@types/GiveawayCreated.ts +11 -0
- package/@types/GiveawayWinners.ts +68 -0
- package/@types/InaccessibleMessage.ts +23 -0
- package/@types/InlineKeyboardButton.ts +88 -0
- package/@types/InlineKeyboardMarkup.ts +13 -0
- package/@types/InlineQuery.ts +41 -0
- package/@types/InlineQueryResult.ts +70 -0
- package/@types/InlineQueryResultArticle.ts +58 -0
- package/@types/InlineQueryResultAudio.ts +69 -0
- package/@types/InlineQueryResultCachedAudio.ts +55 -0
- package/@types/InlineQueryResultCachedDocument.ts +65 -0
- package/@types/InlineQueryResultCachedGif.ts +65 -0
- package/@types/InlineQueryResultCachedMpeg4Gif.ts +65 -0
- package/@types/InlineQueryResultCachedPhoto.ts +70 -0
- package/@types/InlineQueryResultCachedSticker.ts +34 -0
- package/@types/InlineQueryResultCachedVideo.ts +70 -0
- package/@types/InlineQueryResultCachedVoice.ts +60 -0
- package/@types/InlineQueryResultContact.ts +64 -0
- package/@types/InlineQueryResultDocument.ts +85 -0
- package/@types/InlineQueryResultGame.ts +29 -0
- package/@types/InlineQueryResultGif.ts +91 -0
- package/@types/InlineQueryResultLocation.ts +82 -0
- package/@types/InlineQueryResultMpeg4Gif.ts +91 -0
- package/@types/InlineQueryResultPhoto.ts +84 -0
- package/@types/InlineQueryResultVenue.ts +80 -0
- package/@types/InlineQueryResultVideo.ts +98 -0
- package/@types/InlineQueryResultVoice.ts +65 -0
- package/@types/InlineQueryResultsButton.ts +34 -0
- package/@types/InputChecklist.ts +39 -0
- package/@types/InputChecklistTask.ts +30 -0
- package/@types/InputContactMessageContent.ts +27 -0
- package/@types/InputFile.ts +10 -0
- package/@types/InputInvoiceMessageContent.ts +120 -0
- package/@types/InputLocationMessageContent.ts +39 -0
- package/@types/InputMedia.ts +24 -0
- package/@types/InputMediaAnimation.ts +68 -0
- package/@types/InputMediaAudio.ts +58 -0
- package/@types/InputMediaDocument.ts +49 -0
- package/@types/InputMediaPhoto.ts +45 -0
- package/@types/InputMediaVideo.ts +85 -0
- package/@types/InputMessageContent.ts +25 -0
- package/@types/InputPaidMedia.ts +11 -0
- package/@types/InputPaidMediaPhoto.ts +21 -0
- package/@types/InputPaidMediaVideo.ts +64 -0
- package/@types/InputPollOption.ts +25 -0
- package/@types/InputProfilePhoto.ts +10 -0
- package/@types/InputProfilePhotoAnimated.ts +23 -0
- package/@types/InputProfilePhotoStatic.ts +18 -0
- package/@types/InputSticker.ts +38 -0
- package/@types/InputStoryContent.ts +11 -0
- package/@types/InputStoryContentPhoto.ts +29 -0
- package/@types/InputStoryContentVideo.ts +49 -0
- package/@types/InputTextMessageContent.ts +28 -0
- package/@types/InputVenueMessageContent.ts +47 -0
- package/@types/Invoice.ts +35 -0
- package/@types/KeyboardButton.ts +61 -0
- package/@types/KeyboardButtonPollType.ts +13 -0
- package/@types/KeyboardButtonRequestChat.ts +68 -0
- package/@types/KeyboardButtonRequestUsers.ts +45 -0
- package/@types/LabeledPrice.ts +18 -0
- package/@types/LinkPreviewOptions.ts +32 -0
- package/@types/Location.ts +38 -0
- package/@types/LocationAddress.ts +26 -0
- package/@types/LoginUrl.ts +37 -0
- package/@types/MaskPosition.ts +28 -0
- package/@types/MaybeInaccessibleMessage.ts +8 -0
- package/@types/MenuButton.ts +20 -0
- package/@types/MenuButtonCommands.ts +11 -0
- package/@types/MenuButtonDefault.ts +11 -0
- package/@types/MenuButtonWebApp.ts +26 -0
- package/@types/Message.ts +608 -0
- package/@types/MessageAutoDeleteTimerChanged.ts +11 -0
- package/@types/MessageEntity.ts +109 -0
- package/@types/MessageId.ts +11 -0
- package/@types/MessageOrigin.ts +21 -0
- package/@types/MessageOriginChannel.ts +33 -0
- package/@types/MessageOriginChat.ts +28 -0
- package/@types/MessageOriginHiddenUser.ts +21 -0
- package/@types/MessageOriginUser.ts +23 -0
- package/@types/MessageReactionCountUpdated.ts +28 -0
- package/@types/MessageReactionUpdated.ts +43 -0
- package/@types/OrderInfo.ts +28 -0
- package/@types/OwnedGift.ts +11 -0
- package/@types/OwnedGiftRegular.ts +77 -0
- package/@types/OwnedGiftUnique.ts +57 -0
- package/@types/OwnedGifts.ts +23 -0
- package/@types/PaidMedia.ts +13 -0
- package/@types/PaidMediaInfo.ts +18 -0
- package/@types/PaidMediaPhoto.ts +18 -0
- package/@types/PaidMediaPreview.ts +26 -0
- package/@types/PaidMediaPurchased.ts +18 -0
- package/@types/PaidMediaVideo.ts +18 -0
- package/@types/PaidMessagePriceChanged.ts +16 -0
- package/@types/PassportData.ts +18 -0
- package/@types/PassportElementError.ts +37 -0
- package/@types/PassportElementErrorDataField.ts +39 -0
- package/@types/PassportElementErrorFile.ts +33 -0
- package/@types/PassportElementErrorFiles.ts +33 -0
- package/@types/PassportElementErrorFrontSide.ts +28 -0
- package/@types/PassportElementErrorReverseSide.ts +27 -0
- package/@types/PassportElementErrorSelfie.ts +28 -0
- package/@types/PassportElementErrorTranslationFile.ts +38 -0
- package/@types/PassportElementErrorTranslationFiles.ts +38 -0
- package/@types/PassportElementErrorUnspecified.ts +49 -0
- package/@types/PassportFile.ts +28 -0
- package/@types/PhotoSize.ts +32 -0
- package/@types/Poll.ts +81 -0
- package/@types/PollAnswer.ts +28 -0
- package/@types/PollOption.ts +24 -0
- package/@types/PreCheckoutQuery.ts +45 -0
- package/@types/ProximityAlertTriggered.ts +24 -0
- package/@types/ReactionCount.ts +18 -0
- package/@types/ReactionType.ts +18 -0
- package/@types/ReactionTypeCustomEmoji.ts +16 -0
- package/@types/ReactionTypeEmoji.ts +92 -0
- package/@types/ReactionTypePaid.ts +11 -0
- package/@types/RefundedPayment.ts +35 -0
- package/@types/ReplyKeyboardMarkup.ts +49 -0
- package/@types/ReplyKeyboardRemove.ts +25 -0
- package/@types/ReplyParameters.ts +48 -0
- package/@types/ResponseParameters.ts +19 -0
- package/@types/RevenueWithdrawalState.ts +13 -0
- package/@types/RevenueWithdrawalStateFailed.ts +11 -0
- package/@types/RevenueWithdrawalStatePending.ts +10 -0
- package/@types/RevenueWithdrawalStateSucceeded.ts +21 -0
- package/@types/SentWebAppMessage.ts +12 -0
- package/@types/SharedUser.ts +36 -0
- package/@types/ShippingAddress.ts +36 -0
- package/@types/ShippingOption.ts +23 -0
- package/@types/ShippingQuery.ts +28 -0
- package/@types/StarAmount.ts +17 -0
- package/@types/StarTransaction.ts +42 -0
- package/@types/StarTransactions.ts +13 -0
- package/@types/Sticker.ts +86 -0
- package/@types/StickerSet.ts +33 -0
- package/@types/Story.ts +18 -0
- package/@types/StoryArea.ts +18 -0
- package/@types/StoryAreaPosition.ts +36 -0
- package/@types/StoryAreaType.ts +24 -0
- package/@types/StoryAreaTypeLink.ts +16 -0
- package/@types/StoryAreaTypeLocation.ts +28 -0
- package/@types/StoryAreaTypeSuggestedReaction.ts +29 -0
- package/@types/StoryAreaTypeUniqueGift.ts +16 -0
- package/@types/StoryAreaTypeWeather.ts +26 -0
- package/@types/SuccessfulPayment.ts +60 -0
- package/@types/SwitchInlineQueryChosenChat.ts +33 -0
- package/@types/TextQuote.ts +30 -0
- package/@types/TransactionPartner.ts +31 -0
- package/@types/TransactionPartnerAffiliateProgram.ts +24 -0
- package/@types/TransactionPartnerChat.ts +21 -0
- package/@types/TransactionPartnerFragment.ts +18 -0
- package/@types/TransactionPartnerOther.ts +11 -0
- package/@types/TransactionPartnerTelegramAds.ts +11 -0
- package/@types/TransactionPartnerTelegramApi.ts +16 -0
- package/@types/TransactionPartnerUser.ts +70 -0
- package/@types/UniqueGift.ts +38 -0
- package/@types/UniqueGiftBackdrop.ts +23 -0
- package/@types/UniqueGiftBackdropColors.ts +26 -0
- package/@types/UniqueGiftInfo.ts +42 -0
- package/@types/UniqueGiftModel.ts +23 -0
- package/@types/UniqueGiftSymbol.ts +23 -0
- package/@types/Update.ts +177 -0
- package/@types/User.ts +74 -0
- package/@types/UserProfilePhotos.ts +18 -0
- package/@types/UsersShared.ts +19 -0
- package/@types/Venue.ts +48 -0
- package/@types/Video.ts +66 -0
- package/@types/VideoChatEnded.ts +11 -0
- package/@types/VideoChatParticipantsInvited.ts +13 -0
- package/@types/VideoChatScheduled.ts +11 -0
- package/@types/VideoChatStarted.ts +6 -0
- package/@types/VideoNote.ts +39 -0
- package/@types/Voice.ts +34 -0
- package/@types/WebAppData.ts +17 -0
- package/@types/WebAppInfo.ts +11 -0
- package/@types/WebhookInfo.ts +54 -0
- package/@types/WriteAccessAllowed.ts +23 -0
- package/@types/index.ts +395 -0
- package/@types/utils.ts +17 -0
- package/biome.json +58 -0
- package/bun.lock +105 -0
- package/cron/actions-server.ts +87 -0
- package/index.ts +9 -0
- package/nyx-client.ts +133 -0
- package/package.json +22 -0
- package/tsconfig.json +28 -0
- package/types.d.ts +35 -0
- package/utils/actions.ts +30 -0
- package/utils/api.ts +27 -0
- package/utils/enum.ts +5 -0
- package/utils/helpers.ts +71 -0
- package/utils/methods.ts +1943 -0
- package/utils/objects.ts +37 -0
- package/utils/table.ts +72 -0
package/.env.sample
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"recommendations": [
|
|
3
|
+
"biomejs.biome",
|
|
4
|
+
"vscode.html-language-features",
|
|
5
|
+
"vscode.css-language-features",
|
|
6
|
+
"vscode.typescript-language-features",
|
|
7
|
+
"vscode.json-language-features",
|
|
8
|
+
"vscode.markdown-language-features",
|
|
9
|
+
"vscode.builtin-extensions"
|
|
10
|
+
]
|
|
11
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"editor.tabSize": 3,
|
|
3
|
+
"editor.insertSpaces": false,
|
|
4
|
+
"editor.formatOnSave": true,
|
|
5
|
+
"editor.detectIndentation": false,
|
|
6
|
+
"editor.defaultFormatter": "biomejs.biome",
|
|
7
|
+
"[javascript]": {
|
|
8
|
+
"editor.tabSize": 3,
|
|
9
|
+
"editor.insertSpaces": false,
|
|
10
|
+
"editor.defaultFormatter": "biomejs.biome"
|
|
11
|
+
},
|
|
12
|
+
"[typescript]": {
|
|
13
|
+
"editor.tabSize": 3,
|
|
14
|
+
"editor.insertSpaces": false,
|
|
15
|
+
"editor.defaultFormatter": "biomejs.biome"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"tab_size": 3,
|
|
3
|
+
"format_on_save": "on",
|
|
4
|
+
"remove_trailing_whitespace_on_save": true,
|
|
5
|
+
"show_whitespaces": "trailing",
|
|
6
|
+
"languages": {
|
|
7
|
+
"JavaScript": { "formatter": { "language_server": { "name": "biome" } } },
|
|
8
|
+
"TypeScript": { "formatter": { "language_server": { "name": "biome" } } },
|
|
9
|
+
"JSX": { "formatter": { "language_server": { "name": "biome" } } },
|
|
10
|
+
"TSX": { "formatter": { "language_server": { "name": "biome" } } },
|
|
11
|
+
"JSON": { "formatter": { "language_server": { "name": "biome" } } },
|
|
12
|
+
"JSONC": { "formatter": { "language_server": { "name": "biome" } } },
|
|
13
|
+
"CSS": { "formatter": { "language_server": { "name": "biome" } } },
|
|
14
|
+
"GraphQL": { "formatter": { "language_server": { "name": "biome" } } }
|
|
15
|
+
},
|
|
16
|
+
"code_actions_on_format": {
|
|
17
|
+
"source.organizeImports.biome": true,
|
|
18
|
+
"source.fixAll.biome": true
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## AcceptedGiftTypes
|
|
3
|
+
* This object describes the types of gifts that can be gifted to a user or a chat.
|
|
4
|
+
* @see https://core.telegram.org/bots/api#acceptedgifttypes
|
|
5
|
+
*/
|
|
6
|
+
export type AcceptedGiftTypes = {
|
|
7
|
+
/**
|
|
8
|
+
* True, if unlimited regular gifts are accepted
|
|
9
|
+
*/
|
|
10
|
+
unlimited_gifts: boolean;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* True, if limited regular gifts are accepted
|
|
14
|
+
*/
|
|
15
|
+
limited_gifts: boolean;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* True, if unique gifts or gifts that can be upgraded to unique for free are accepted
|
|
19
|
+
*/
|
|
20
|
+
unique_gifts: boolean;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* True, if a Telegram Premium subscription is accepted
|
|
24
|
+
*/
|
|
25
|
+
premium_subscription: boolean;
|
|
26
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Chat, User } from "./";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## AffiliateInfo
|
|
5
|
+
* Contains information about the affiliate that received a commission via this transaction.
|
|
6
|
+
*/
|
|
7
|
+
export type AffiliateInfo = {
|
|
8
|
+
/**
|
|
9
|
+
* Optional. The bot or the user that received an affiliate commission if it was received by a bot or a user
|
|
10
|
+
*/
|
|
11
|
+
affiliate_user?: User;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Optional. The chat that received an affiliate commission if it was received by a chat
|
|
15
|
+
*/
|
|
16
|
+
affiliate_chat?: Chat;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* The number of Telegram Stars received by the affiliate for each 1000 Telegram Stars received by the bot from
|
|
20
|
+
* referred users
|
|
21
|
+
*/
|
|
22
|
+
commission_per_mille: number;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Integer amount of Telegram Stars received by the affiliate from the transaction, rounded to 0; can be negative for
|
|
26
|
+
* refunds
|
|
27
|
+
*/
|
|
28
|
+
amount: number;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Optional. The number of 1/1000000000 shares of Telegram Stars received by the affiliate;
|
|
32
|
+
* from -999999999 to 999999999; can be negative for refunds
|
|
33
|
+
*/
|
|
34
|
+
nanostar_amount?: number;
|
|
35
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { PhotoSize } from "./";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## Animation
|
|
5
|
+
* This object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound).
|
|
6
|
+
* @see https://core.telegram.org/bots/api#animation
|
|
7
|
+
*/
|
|
8
|
+
export type Animation = {
|
|
9
|
+
/**
|
|
10
|
+
* Identifier for this file, which can be used to download or reuse the file
|
|
11
|
+
*/
|
|
12
|
+
file_id: string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used
|
|
16
|
+
* to download or reuse the file.
|
|
17
|
+
*/
|
|
18
|
+
file_unique_id: string;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Video width as defined by sender
|
|
22
|
+
*/
|
|
23
|
+
width: number;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Video height as defined by sender
|
|
27
|
+
*/
|
|
28
|
+
height: number;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Duration of the video in seconds as defined by sender
|
|
32
|
+
*/
|
|
33
|
+
duration: number;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Optional. Animation thumbnail as defined by sender
|
|
37
|
+
*/
|
|
38
|
+
thumbnail?: PhotoSize;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Optional. Original animation filename as defined by sender
|
|
42
|
+
*/
|
|
43
|
+
file_name?: string;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Optional. MIME type of the file as defined by sender
|
|
47
|
+
*/
|
|
48
|
+
mime_type?: string;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent
|
|
52
|
+
* defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision
|
|
53
|
+
* float type are safe for storing this value.
|
|
54
|
+
*/
|
|
55
|
+
file_size?: number;
|
|
56
|
+
};
|
package/@types/Audio.ts
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { PhotoSize } from "./";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## Audio
|
|
5
|
+
* This object represents an audio file to be treated as music by the Telegram clients.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#audio
|
|
7
|
+
*/
|
|
8
|
+
export type Audio = {
|
|
9
|
+
/**
|
|
10
|
+
* Identifier for this file, which can be used to download or reuse the file
|
|
11
|
+
*/
|
|
12
|
+
file_id: string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used
|
|
16
|
+
* to download or reuse the file.
|
|
17
|
+
*/
|
|
18
|
+
file_unique_id: string;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Duration of the audio in seconds as defined by sender
|
|
22
|
+
*/
|
|
23
|
+
duration: number;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Optional. Performer of the audio as defined by sender or by audio tags
|
|
27
|
+
*/
|
|
28
|
+
performer?: string;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Optional. Title of the audio as defined by sender or by audio tags
|
|
32
|
+
*/
|
|
33
|
+
title?: string;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Optional. Original filename as defined by sender
|
|
37
|
+
*/
|
|
38
|
+
file_name?: string;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Optional. MIME type of the file as defined by sender
|
|
42
|
+
*/
|
|
43
|
+
mime_type?: string;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent
|
|
47
|
+
* defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision
|
|
48
|
+
* float type are safe for storing this value.
|
|
49
|
+
*/
|
|
50
|
+
file_size?: number;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Optional. Thumbnail of the album cover to which the music file belongs
|
|
54
|
+
*/
|
|
55
|
+
thumbnail?: PhotoSize;
|
|
56
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
BackgroundFillFreeformGradient,
|
|
3
|
+
BackgroundFillGradient,
|
|
4
|
+
BackgroundFillSolid,
|
|
5
|
+
} from "./";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* ## BackgroundFill
|
|
9
|
+
* This object describes the way a background is filled based on the selected colors. Currently, it can be one of
|
|
10
|
+
* - `BackgroundFillSolid`
|
|
11
|
+
* - `BackgroundFillGradient`
|
|
12
|
+
* - `BackgroundFillFreeformGradient`
|
|
13
|
+
* @see https://core.telegram.org/bots/api#backgroundfill
|
|
14
|
+
*/
|
|
15
|
+
export type BackgroundFill =
|
|
16
|
+
| BackgroundFillSolid
|
|
17
|
+
| BackgroundFillGradient
|
|
18
|
+
| BackgroundFillFreeformGradient;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## BackgroundFillFreeformGradient
|
|
3
|
+
* The background is a freeform gradient that rotates after every message in the chat.
|
|
4
|
+
* @see https://core.telegram.org/bots/api#backgroundfillfreeformgradient
|
|
5
|
+
*/
|
|
6
|
+
export type BackgroundFillFreeformGradient = {
|
|
7
|
+
/**
|
|
8
|
+
* Type of the background fill, always `freeform_gradient`
|
|
9
|
+
*/
|
|
10
|
+
type: "freeform_gradient";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* A list of the 3 or 4 base colors that are used to generate the freeform gradient in the RGB24 format
|
|
14
|
+
*/
|
|
15
|
+
colors: [number, number, number] | [number, number, number, number];
|
|
16
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## BackgroundFillGradient
|
|
3
|
+
* The background is a gradient fill.
|
|
4
|
+
* @see https://core.telegram.org/bots/api#backgroundfillgradient
|
|
5
|
+
*/
|
|
6
|
+
export type BackgroundFillGradient = {
|
|
7
|
+
/**
|
|
8
|
+
* Type of the background fill, always “gradient”
|
|
9
|
+
*/
|
|
10
|
+
type: "gradient";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Top color of the gradient in the RGB24 format
|
|
14
|
+
*/
|
|
15
|
+
top_color: number;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Bottom color of the gradient in the RGB24 format
|
|
19
|
+
*/
|
|
20
|
+
bottom_color: number;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Clockwise rotation angle of the background fill in degrees; 0-359
|
|
24
|
+
*/
|
|
25
|
+
rotation_angle: number;
|
|
26
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## BackgroundFillSolid
|
|
3
|
+
* The background is filled using the selected color.
|
|
4
|
+
* @see https://core.telegram.org/bots/api#backgroundfillsolid
|
|
5
|
+
*/
|
|
6
|
+
export type BackgroundFillSolid = {
|
|
7
|
+
/**
|
|
8
|
+
* Type of the background fill, always “solid”
|
|
9
|
+
*/
|
|
10
|
+
type: "solid";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The color of the background fill in the RGB24 format
|
|
14
|
+
*/
|
|
15
|
+
color: string;
|
|
16
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
BackgroundTypeChatTheme,
|
|
3
|
+
BackgroundTypeFill,
|
|
4
|
+
BackgroundTypePattern,
|
|
5
|
+
BackgroundTypeWallpaper,
|
|
6
|
+
} from "./";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* ## BackgroundType
|
|
10
|
+
* This object describes the type of a background. Currently, it can be one of
|
|
11
|
+
* - `BackgroundTypeFill`
|
|
12
|
+
* - `BackgroundTypeWallpaper`
|
|
13
|
+
* - `BackgroundTypePattern`
|
|
14
|
+
* - `BackgroundTypeChatTheme`
|
|
15
|
+
* @see https://core.telegram.org/bots/api#backgroundtype
|
|
16
|
+
*/
|
|
17
|
+
export type BackgroundType =
|
|
18
|
+
| BackgroundTypeFill
|
|
19
|
+
| BackgroundTypeWallpaper
|
|
20
|
+
| BackgroundTypePattern
|
|
21
|
+
| BackgroundTypeChatTheme;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## BackgroundTypeChatTheme
|
|
3
|
+
* The background is taken directly from a built-in chat theme.
|
|
4
|
+
* @see https://core.telegram.org/bots/api#backgroundtypechattheme
|
|
5
|
+
*/
|
|
6
|
+
export type BackgroundTypeChatTheme = {
|
|
7
|
+
/**
|
|
8
|
+
* Type of the background, always “chat_theme”
|
|
9
|
+
*/
|
|
10
|
+
type: "chat_theme";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Name of the chat theme, which is usually an emoji
|
|
14
|
+
*/
|
|
15
|
+
theme_name: string;
|
|
16
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { BackgroundFill } from "./";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## BackgroundTypeFill
|
|
5
|
+
* The background is automatically filled based on the selected colors.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#backgroundtypefill
|
|
7
|
+
*/
|
|
8
|
+
export type BackgroundTypeFill = {
|
|
9
|
+
/**
|
|
10
|
+
* Type of the background, always “fill”
|
|
11
|
+
*/
|
|
12
|
+
type: "fill";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The background fill
|
|
16
|
+
*/
|
|
17
|
+
fill: BackgroundFill;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Dimming of the background in dark themes, as a percentage; 0-100
|
|
21
|
+
*/
|
|
22
|
+
dark_theme_dimming: number;
|
|
23
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { BackgroundFill, Document } from "./";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## BackgroundTypePattern
|
|
5
|
+
* The background is a PNG or TGV (gzipped subset of SVG with MIME type “application/x-tgwallpattern”) pattern to be
|
|
6
|
+
* combined with the background fill chosen by the user.
|
|
7
|
+
* @see https://core.telegram.org/bots/api#backgroundtypepattern
|
|
8
|
+
*/
|
|
9
|
+
export type BackgroundTypePattern = {
|
|
10
|
+
/**
|
|
11
|
+
* Type of the background, always “pattern”
|
|
12
|
+
*/
|
|
13
|
+
type: "pattern";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Document with the pattern
|
|
17
|
+
*/
|
|
18
|
+
document: Document;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The background fill that is combined with the pattern
|
|
22
|
+
*/
|
|
23
|
+
fill: BackgroundFill;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Intensity of the pattern when it is shown above the filled background; 0-100
|
|
27
|
+
*/
|
|
28
|
+
intensity: number;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Optional. True, if the background fill must be applied only to the pattern itself. All other pixels are black in
|
|
32
|
+
* this case. For dark themes only
|
|
33
|
+
*/
|
|
34
|
+
is_blurred: boolean;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Optional. True, if the background moves slightly when the device is tilted
|
|
38
|
+
*/
|
|
39
|
+
is_moving: boolean;
|
|
40
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Document } from "./";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## BackgroundTypeWallpaper
|
|
5
|
+
* The background is a wallpaper in the JPEG format.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#backgroundtypewallpaper
|
|
7
|
+
*/
|
|
8
|
+
export type BackgroundTypeWallpaper = {
|
|
9
|
+
/**
|
|
10
|
+
* Type of the background, always “wallpaper”
|
|
11
|
+
*/
|
|
12
|
+
type: "wallpaper";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Document with the wallpaper
|
|
16
|
+
*/
|
|
17
|
+
document: Document;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Dimming of the background in dark themes, as a percentage; 0-100
|
|
21
|
+
*/
|
|
22
|
+
dark_theme_dimming: number;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Optional. True, if the wallpaper is downscaled to fit in a 450x450 square and then box-blurred with radius 12
|
|
26
|
+
*/
|
|
27
|
+
is_blurred: boolean;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Optional. True, if the background moves slightly when the device is tilted
|
|
31
|
+
*/
|
|
32
|
+
is_moving: boolean;
|
|
33
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## Birthdate
|
|
3
|
+
* Describes the birthdate of a user.
|
|
4
|
+
* @see https://core.telegram.org/bots/api#birthdate
|
|
5
|
+
*/
|
|
6
|
+
export type Birthdate = {
|
|
7
|
+
/**
|
|
8
|
+
* Day of the user's birth; 1-31
|
|
9
|
+
*/
|
|
10
|
+
day: number;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Month of the user's birth; 1-12
|
|
14
|
+
*/
|
|
15
|
+
month: number;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Optional. Year of the user's birth
|
|
19
|
+
*/
|
|
20
|
+
year?: number;
|
|
21
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## BotCommand
|
|
3
|
+
* This object represents a bot command.
|
|
4
|
+
* @see https://core.telegram.org/bots/api#botcommand
|
|
5
|
+
*/
|
|
6
|
+
export type BotCommand = {
|
|
7
|
+
/**
|
|
8
|
+
* Text of the command; 1-32 characters. Can contain only lowercase English letters, digits and underscores.
|
|
9
|
+
*/
|
|
10
|
+
command: string;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Description of the command; 1-256 characters.
|
|
14
|
+
*/
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
BotCommandScopeAllChatAdministrators,
|
|
3
|
+
BotCommandScopeAllGroupChats,
|
|
4
|
+
BotCommandScopeAllPrivateChats,
|
|
5
|
+
BotCommandScopeChat,
|
|
6
|
+
BotCommandScopeChatAdministrators,
|
|
7
|
+
BotCommandScopeChatMember,
|
|
8
|
+
BotCommandScopeDefault,
|
|
9
|
+
} from "./";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* ## BotCommandScope
|
|
13
|
+
* This object represents the scope to which bot commands are applied. Currently, the following 7 scopes are supported:
|
|
14
|
+
* - `BotCommandScopeDefault`
|
|
15
|
+
* - `BotCommandScopeAllPrivateChats`
|
|
16
|
+
* - `BotCommandScopeAllGroupChats`
|
|
17
|
+
* - `BotCommandScopeAllChatAdministrators`
|
|
18
|
+
* - `BotCommandScopeChat`
|
|
19
|
+
* - `BotCommandScopeChatAdministrators`
|
|
20
|
+
* - `BotCommandScopeChatMember`
|
|
21
|
+
* @see https://core.telegram.org/bots/api#botcommandscope
|
|
22
|
+
*/
|
|
23
|
+
export type BotCommandScope =
|
|
24
|
+
| BotCommandScopeDefault
|
|
25
|
+
| BotCommandScopeAllPrivateChats
|
|
26
|
+
| BotCommandScopeAllGroupChats
|
|
27
|
+
| BotCommandScopeAllChatAdministrators
|
|
28
|
+
| BotCommandScopeChat
|
|
29
|
+
| BotCommandScopeChatAdministrators
|
|
30
|
+
| BotCommandScopeChatMember;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## BotCommandScopeAllChatAdministrators
|
|
3
|
+
* Represents the scope of bot commands, covering all group and supergroup chat administrators.
|
|
4
|
+
* @see https://core.telegram.org/bots/api#botcommandscopeallchatadministrators
|
|
5
|
+
*/
|
|
6
|
+
export type BotCommandScopeAllChatAdministrators = {
|
|
7
|
+
/**
|
|
8
|
+
* Scope type, must be all_chat_administrators
|
|
9
|
+
*/
|
|
10
|
+
type: "all_chat_administrators";
|
|
11
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## BotCommandScopeAllGroupChats
|
|
3
|
+
* Represents the scope of bot commands, covering all group and supergroup chats.
|
|
4
|
+
* @see https://core.telegram.org/bots/api#botcommandscopeallgroupchats
|
|
5
|
+
*/
|
|
6
|
+
export type BotCommandScopeAllGroupChats = {
|
|
7
|
+
/**
|
|
8
|
+
* Scope type, must be all_group_chats
|
|
9
|
+
*/
|
|
10
|
+
type: "all_group_chats";
|
|
11
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## BotCommandScopeAllPrivateChats
|
|
3
|
+
* Represents the scope of bot commands, covering all private chats.
|
|
4
|
+
* @see https://core.telegram.org/bots/api#botcommandscopeallprivatechats
|
|
5
|
+
*/
|
|
6
|
+
export type BotCommandScopeAllPrivateChats = {
|
|
7
|
+
/**
|
|
8
|
+
* Scope type, must be all_private_chats
|
|
9
|
+
*/
|
|
10
|
+
type: "all_private_chats";
|
|
11
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## BotCommandScopeChat
|
|
3
|
+
* Represents the scope of bot commands, covering a specific chat.
|
|
4
|
+
* @see https://core.telegram.org/bots/api#botcommandscopechat
|
|
5
|
+
*/
|
|
6
|
+
export type BotCommandScopeChat = {
|
|
7
|
+
/**
|
|
8
|
+
* Scope type, must be chat
|
|
9
|
+
*/
|
|
10
|
+
type: "chat";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
|
|
14
|
+
*/
|
|
15
|
+
chat_id: number | string;
|
|
16
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## BotCommandScopeChatAdministrators
|
|
3
|
+
* Represents the scope of bot commands, covering all administrators of a specific group or supergroup chat.
|
|
4
|
+
* @see https://core.telegram.org/bots/api#botcommandscopechatadministrators
|
|
5
|
+
*/
|
|
6
|
+
export type BotCommandScopeChatAdministrators = {
|
|
7
|
+
/**
|
|
8
|
+
* Scope type, must be chat_administrators
|
|
9
|
+
*/
|
|
10
|
+
type: "chat_administrators";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
|
|
14
|
+
*/
|
|
15
|
+
chat_id: number | string;
|
|
16
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## BotCommandScopeChatMember
|
|
3
|
+
* Represents the scope of bot commands, covering a specific member of a group or supergroup chat.
|
|
4
|
+
* @see https://core.telegram.org/bots/api#botcommandscopechatmember
|
|
5
|
+
*/
|
|
6
|
+
export type BotCommandScopeChatMember = {
|
|
7
|
+
/**
|
|
8
|
+
* Scope type, must be chat_member
|
|
9
|
+
*/
|
|
10
|
+
type: "chat_member";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
|
|
14
|
+
*/
|
|
15
|
+
chat_id: number | string;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Unique identifier of the target user
|
|
19
|
+
*/
|
|
20
|
+
user_id: number;
|
|
21
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## BotCommandScopeDefault
|
|
3
|
+
* Represents the default scope of bot commands. Default commands are used if no commands with a narrower scope are
|
|
4
|
+
* specified for the user.
|
|
5
|
+
* @see https://core.telegram.org/bots/api#botcommandscopedefault
|
|
6
|
+
*/
|
|
7
|
+
export type BotCommandScopeDefault = {
|
|
8
|
+
/**
|
|
9
|
+
* Scope type, must be default
|
|
10
|
+
*/
|
|
11
|
+
type: "default";
|
|
12
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## BotShortDescription
|
|
3
|
+
* This object represents the bot's short description.
|
|
4
|
+
* @see https://core.telegram.org/bots/api#botshortdescription
|
|
5
|
+
*/
|
|
6
|
+
export type BotShortDescription = {
|
|
7
|
+
/**
|
|
8
|
+
* The bot's short description
|
|
9
|
+
*/
|
|
10
|
+
short_description: string;
|
|
11
|
+
};
|