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
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
PassportElementErrorDataField,
|
|
3
|
+
PassportElementErrorFile,
|
|
4
|
+
PassportElementErrorFiles,
|
|
5
|
+
PassportElementErrorFrontSide,
|
|
6
|
+
PassportElementErrorReverseSide,
|
|
7
|
+
PassportElementErrorSelfie,
|
|
8
|
+
PassportElementErrorTranslationFile,
|
|
9
|
+
PassportElementErrorTranslationFiles,
|
|
10
|
+
PassportElementErrorUnspecified,
|
|
11
|
+
} from "./";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* ## PassportElementError
|
|
15
|
+
* This object represents an error in the Telegram Passport element which was submitted that should be resolved by the
|
|
16
|
+
* user. It should be one of:
|
|
17
|
+
* - PassportElementErrorDataField
|
|
18
|
+
* - PassportElementErrorFrontSide
|
|
19
|
+
* - PassportElementErrorReverseSide
|
|
20
|
+
* - PassportElementErrorSelfie
|
|
21
|
+
* - PassportElementErrorFile
|
|
22
|
+
* - PassportElementErrorFiles
|
|
23
|
+
* - PassportElementErrorTranslationFile
|
|
24
|
+
* - PassportElementErrorTranslationFiles
|
|
25
|
+
* - PassportElementErrorUnspecified
|
|
26
|
+
* @see https://core.telegram.org/bots/api#passportelementerror
|
|
27
|
+
*/
|
|
28
|
+
export type PassportElementError =
|
|
29
|
+
| PassportElementErrorDataField
|
|
30
|
+
| PassportElementErrorFrontSide
|
|
31
|
+
| PassportElementErrorReverseSide
|
|
32
|
+
| PassportElementErrorSelfie
|
|
33
|
+
| PassportElementErrorFile
|
|
34
|
+
| PassportElementErrorFiles
|
|
35
|
+
| PassportElementErrorTranslationFile
|
|
36
|
+
| PassportElementErrorTranslationFiles
|
|
37
|
+
| PassportElementErrorUnspecified;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## PassportElementErrorDataField
|
|
3
|
+
* Represents an issue in one of the data fields that was provided by the user. The error is considered resolved when
|
|
4
|
+
* the field's value changes.
|
|
5
|
+
* @see https://core.telegram.org/bots/api#passportelementerrordatafield
|
|
6
|
+
*/
|
|
7
|
+
export type PassportElementErrorDataField = {
|
|
8
|
+
/**
|
|
9
|
+
* Error source, must be data
|
|
10
|
+
*/
|
|
11
|
+
source: "data";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The section of the user's Telegram Passport which has the error, one of “personal_details”, “passport”,
|
|
15
|
+
* “driver_license”, “identity_card”, “internal_passport”, “address”
|
|
16
|
+
*/
|
|
17
|
+
type:
|
|
18
|
+
| "personal_details"
|
|
19
|
+
| "passport"
|
|
20
|
+
| "driver_license"
|
|
21
|
+
| "identity_card"
|
|
22
|
+
| "internal_passport"
|
|
23
|
+
| "address";
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Name of the data field which has the error
|
|
27
|
+
*/
|
|
28
|
+
field_name: string;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Base64-encoded data hash
|
|
32
|
+
*/
|
|
33
|
+
data_hash: string;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Error message
|
|
37
|
+
*/
|
|
38
|
+
message: string;
|
|
39
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## PassportElementErrorFile
|
|
3
|
+
* Represents an issue with a document scan. The error is considered resolved when the file with the document scan
|
|
4
|
+
* changes.
|
|
5
|
+
* @see https://core.telegram.org/bots/api#passportelementerrorfile
|
|
6
|
+
*/
|
|
7
|
+
export type PassportElementErrorFile = {
|
|
8
|
+
/**
|
|
9
|
+
* Error source, must be file
|
|
10
|
+
*/
|
|
11
|
+
source: "file";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The section of the user's Telegram Passport which has the issue, one of “utility_bill”, “bank_statement”,
|
|
15
|
+
* “rental_agreement”, “passport_registration”, “temporary_registration”
|
|
16
|
+
*/
|
|
17
|
+
type:
|
|
18
|
+
| "utility_bill"
|
|
19
|
+
| "bank_statement"
|
|
20
|
+
| "rental_agreement"
|
|
21
|
+
| "passport_registration"
|
|
22
|
+
| "temporary_registration";
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Base64-encoded file hash
|
|
26
|
+
*/
|
|
27
|
+
file_hash: string;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Error message
|
|
31
|
+
*/
|
|
32
|
+
message: string;
|
|
33
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## PassportElementErrorFiles
|
|
3
|
+
* Represents an issue with a list of scans. The error is considered resolved when the list of files containing the
|
|
4
|
+
* scans changes.
|
|
5
|
+
* @see https://core.telegram.org/bots/api#passportelementerrorfiles
|
|
6
|
+
*/
|
|
7
|
+
export type PassportElementErrorFiles = {
|
|
8
|
+
/**
|
|
9
|
+
* Error source, must be files
|
|
10
|
+
*/
|
|
11
|
+
source: "files";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The section of the user's Telegram Passport which has the issue, one of “utility_bill”, “bank_statement”,
|
|
15
|
+
* “rental_agreement”, “passport_registration”, “temporary_registration”
|
|
16
|
+
*/
|
|
17
|
+
type:
|
|
18
|
+
| "utility_bill"
|
|
19
|
+
| "bank_statement"
|
|
20
|
+
| "rental_agreement"
|
|
21
|
+
| "passport_registration"
|
|
22
|
+
| "temporary_registration";
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* List of base64-encoded file hashes
|
|
26
|
+
*/
|
|
27
|
+
file_hashes: string[];
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Error message
|
|
31
|
+
*/
|
|
32
|
+
message: string;
|
|
33
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## PassportElementErrorFrontSide
|
|
3
|
+
* Represents an issue with the front side of a document. The error is considered resolved when the file with the front
|
|
4
|
+
* side of the document changes.
|
|
5
|
+
* @see https://core.telegram.org/bots/api#passportelementerrorfrontside
|
|
6
|
+
*/
|
|
7
|
+
export type PassportElementErrorFrontSide = {
|
|
8
|
+
/**
|
|
9
|
+
* Error source, must be front_side
|
|
10
|
+
*/
|
|
11
|
+
source: "front_side";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The section of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”,
|
|
15
|
+
* “identity_card”, “internal_passport”
|
|
16
|
+
*/
|
|
17
|
+
type: "passport" | "driver_license" | "identity_card" | "internal_passport";
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Base64-encoded hash of the file with the front side of the document
|
|
21
|
+
*/
|
|
22
|
+
file_hash: string;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Error message
|
|
26
|
+
*/
|
|
27
|
+
message: string;
|
|
28
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## PassportElementErrorReverseSide
|
|
3
|
+
* Represents an issue with the reverse side of a document. The error is considered resolved when the file with reverse
|
|
4
|
+
* side of the document changes.
|
|
5
|
+
* @see https://core.telegram.org/bots/api#passportelementerrorreverseside
|
|
6
|
+
*/
|
|
7
|
+
export type PassportElementErrorReverseSide = {
|
|
8
|
+
/**
|
|
9
|
+
* Error source, must be reverse_side
|
|
10
|
+
*/
|
|
11
|
+
source: "reverse_side";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The section of the user's Telegram Passport which has the issue, one of “driver_license”, “identity_card”
|
|
15
|
+
*/
|
|
16
|
+
type: "driver_license" | "identity_card";
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Base64-encoded hash of the file with the reverse side of the document
|
|
20
|
+
*/
|
|
21
|
+
file_hash: string;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Error message
|
|
25
|
+
*/
|
|
26
|
+
message: string;
|
|
27
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## PassportElementErrorSelfie
|
|
3
|
+
* Represents an issue with the selfie with a document. The error is considered resolved when the file with the selfie
|
|
4
|
+
* changes.
|
|
5
|
+
* @see https://core.telegram.org/bots/api#passportelementerrorselfie
|
|
6
|
+
*/
|
|
7
|
+
export type PassportElementErrorSelfie = {
|
|
8
|
+
/**
|
|
9
|
+
* Error source, must be selfie
|
|
10
|
+
*/
|
|
11
|
+
source: "selfie";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The section of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”,
|
|
15
|
+
* “identity_card”, “internal_passport”
|
|
16
|
+
*/
|
|
17
|
+
type: "passport" | "driver_license" | "identity_card" | "internal_passport";
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Base64-encoded hash of the file with the selfie
|
|
21
|
+
*/
|
|
22
|
+
file_hash: string;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Error message
|
|
26
|
+
*/
|
|
27
|
+
message: string;
|
|
28
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## PassportElementErrorTranslationFile
|
|
3
|
+
* Represents an issue with one of the files that constitute the translation of a document. The error is considered
|
|
4
|
+
* resolved when the file changes.
|
|
5
|
+
* @see https://core.telegram.org/bots/api#passportelementerrortranslationfile
|
|
6
|
+
*/
|
|
7
|
+
export type PassportElementErrorTranslationFile = {
|
|
8
|
+
/**
|
|
9
|
+
* Error source, must be translation_file
|
|
10
|
+
*/
|
|
11
|
+
source: "translation_file";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Type of element of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”,
|
|
15
|
+
* “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”,
|
|
16
|
+
* “passport_registration”, “temporary_registration”
|
|
17
|
+
*/
|
|
18
|
+
type:
|
|
19
|
+
| "passport"
|
|
20
|
+
| "driver_license"
|
|
21
|
+
| "identity_card"
|
|
22
|
+
| "internal_passport"
|
|
23
|
+
| "utility_bill"
|
|
24
|
+
| "bank_statement"
|
|
25
|
+
| "rental_agreement"
|
|
26
|
+
| "passport_registration"
|
|
27
|
+
| "temporary_registration";
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Base64-encoded file hash
|
|
31
|
+
*/
|
|
32
|
+
file_hash: string;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Error message
|
|
36
|
+
*/
|
|
37
|
+
message: string;
|
|
38
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## PassportElementErrorTranslationFiles
|
|
3
|
+
* Represents an issue with the translated version of a document. The error is considered resolved when a file with the
|
|
4
|
+
* document translation change.
|
|
5
|
+
* @see https://core.telegram.org/bots/api#passportelementerrortranslationfiles
|
|
6
|
+
*/
|
|
7
|
+
export type PassportElementErrorTranslationFiles = {
|
|
8
|
+
/**
|
|
9
|
+
* Error source, must be translation_files
|
|
10
|
+
*/
|
|
11
|
+
source: "translation_files";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Type of element of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”,
|
|
15
|
+
* “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”,
|
|
16
|
+
* “passport_registration”, “temporary_registration”
|
|
17
|
+
*/
|
|
18
|
+
type:
|
|
19
|
+
| "passport"
|
|
20
|
+
| "driver_license"
|
|
21
|
+
| "identity_card"
|
|
22
|
+
| "internal_passport"
|
|
23
|
+
| "utility_bill"
|
|
24
|
+
| "bank_statement"
|
|
25
|
+
| "rental_agreement"
|
|
26
|
+
| "passport_registration"
|
|
27
|
+
| "temporary_registration";
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* List of base64-encoded file hashes
|
|
31
|
+
*/
|
|
32
|
+
file_hashes: string[];
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Error message
|
|
36
|
+
*/
|
|
37
|
+
message: string;
|
|
38
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
PassportElementErrorDataField,
|
|
3
|
+
PassportElementErrorFile,
|
|
4
|
+
PassportElementErrorFiles,
|
|
5
|
+
PassportElementErrorFrontSide,
|
|
6
|
+
PassportElementErrorReverseSide,
|
|
7
|
+
PassportElementErrorSelfie,
|
|
8
|
+
PassportElementErrorTranslationFile,
|
|
9
|
+
PassportElementErrorTranslationFiles,
|
|
10
|
+
} from "./";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* ## PassportElementErrorUnspecified
|
|
14
|
+
* Represents an issue in an unspecified place. The error is considered resolved when new data is added.
|
|
15
|
+
* @see https://core.telegram.org/bots/api#passportelementerrorunspecified
|
|
16
|
+
*/
|
|
17
|
+
export type PassportElementErrorUnspecified = {
|
|
18
|
+
/**
|
|
19
|
+
* Error source, must be unspecified
|
|
20
|
+
*/
|
|
21
|
+
source: "unspecified";
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Type of element of the user's Telegram Passport which has the issue
|
|
25
|
+
*/
|
|
26
|
+
type: Extract<
|
|
27
|
+
(
|
|
28
|
+
| PassportElementErrorDataField
|
|
29
|
+
| PassportElementErrorFrontSide
|
|
30
|
+
| PassportElementErrorReverseSide
|
|
31
|
+
| PassportElementErrorSelfie
|
|
32
|
+
| PassportElementErrorFile
|
|
33
|
+
| PassportElementErrorFiles
|
|
34
|
+
| PassportElementErrorTranslationFile
|
|
35
|
+
| PassportElementErrorTranslationFiles
|
|
36
|
+
)["type"],
|
|
37
|
+
string
|
|
38
|
+
>;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Base64-encoded element hash
|
|
42
|
+
*/
|
|
43
|
+
element_hash: string;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Error message
|
|
47
|
+
*/
|
|
48
|
+
message: string;
|
|
49
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## PassportFile
|
|
3
|
+
* This object represents a file uploaded to Telegram Passport. Currently all Telegram Passport files are in JPEG format
|
|
4
|
+
* when decrypted and don't exceed 10MB.
|
|
5
|
+
* @see https://core.telegram.org/bots/api#passportfile
|
|
6
|
+
*/
|
|
7
|
+
export type PassportFile = {
|
|
8
|
+
/**
|
|
9
|
+
* Identifier for this file, which can be used to download or reuse the file
|
|
10
|
+
*/
|
|
11
|
+
file_id: string;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used
|
|
15
|
+
* to download or reuse the file.
|
|
16
|
+
*/
|
|
17
|
+
file_unique_id: string;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* File size in bytes
|
|
21
|
+
*/
|
|
22
|
+
file_size: number;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Unix time when the file was uploaded
|
|
26
|
+
*/
|
|
27
|
+
file_date: number;
|
|
28
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## PhotoSize
|
|
3
|
+
* This object represents one size of a photo or a file / sticker thumbnail.
|
|
4
|
+
* @see https://core.telegram.org/bots/api#photosize
|
|
5
|
+
*/
|
|
6
|
+
export type PhotoSize = {
|
|
7
|
+
/**
|
|
8
|
+
* Identifier for this file, which can be used to download or reuse the file
|
|
9
|
+
*/
|
|
10
|
+
file_id: string;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used
|
|
14
|
+
* to download or reuse the file.
|
|
15
|
+
*/
|
|
16
|
+
file_unique_id: string;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Photo width
|
|
20
|
+
*/
|
|
21
|
+
width: number;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Photo height
|
|
25
|
+
*/
|
|
26
|
+
height: number;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Optional. File size in bytes
|
|
30
|
+
*/
|
|
31
|
+
file_size?: number;
|
|
32
|
+
};
|
package/@types/Poll.ts
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { MessageEntity, PollOption } from "./";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## Poll
|
|
5
|
+
* This object contains information about a poll.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#poll
|
|
7
|
+
*/
|
|
8
|
+
export type Poll = {
|
|
9
|
+
/**
|
|
10
|
+
* Unique poll identifier
|
|
11
|
+
*/
|
|
12
|
+
id: string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Poll question, 1-300 characters
|
|
16
|
+
*/
|
|
17
|
+
question: string;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Optional. Special entities that appear in the question. Currently, only custom emoji entities are allowed in poll
|
|
21
|
+
* questions
|
|
22
|
+
*/
|
|
23
|
+
question_entities?: MessageEntity[];
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* List of poll options
|
|
27
|
+
*/
|
|
28
|
+
options: PollOption[];
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Total number of users that voted in the poll
|
|
32
|
+
*/
|
|
33
|
+
total_voter_count: number;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* True, if the poll is closed
|
|
37
|
+
*/
|
|
38
|
+
is_closed: boolean;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* True, if the poll is anonymous
|
|
42
|
+
*/
|
|
43
|
+
is_anonymous: boolean;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Poll type, currently can be “regular” or “quiz”
|
|
47
|
+
*/
|
|
48
|
+
type: "regular" | "quiz";
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* True, if the poll allows multiple answers
|
|
52
|
+
*/
|
|
53
|
+
allows_multiple_answers: boolean;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Optional. 0-based identifier of the correct answer option. Available only for polls in the quiz mode, which are
|
|
57
|
+
* closed, or was sent (not forwarded) by the bot or to the private chat with the bot.
|
|
58
|
+
*/
|
|
59
|
+
correct_option_id?: number;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Optional. Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll,
|
|
63
|
+
* 0-200 characters
|
|
64
|
+
*/
|
|
65
|
+
explanation?: string;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Optional. Special entities like usernames, URLs, bot commands, etc. that appear in the explanation
|
|
69
|
+
*/
|
|
70
|
+
explanation_entities?: MessageEntity[];
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Optional. Amount of time in seconds the poll will be active after creation
|
|
74
|
+
*/
|
|
75
|
+
open_period?: number;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Optional. Point in time (Unix timestamp) when the poll will be automatically closed
|
|
79
|
+
*/
|
|
80
|
+
close_date?: number;
|
|
81
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Chat, User } from "./";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## PollAnswer
|
|
5
|
+
* This object represents an answer of a user in a non-anonymous poll.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#pollanswer
|
|
7
|
+
*/
|
|
8
|
+
export type PollAnswer = {
|
|
9
|
+
/**
|
|
10
|
+
* Unique poll identifier
|
|
11
|
+
*/
|
|
12
|
+
poll_id: string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Optional. The chat that changed the answer to the poll, if the voter is anonymous
|
|
16
|
+
*/
|
|
17
|
+
voter_chat: Chat;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Optional. The user that changed the answer to the poll, if the voter isn't anonymous
|
|
21
|
+
*/
|
|
22
|
+
user: User;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* 0-based identifiers of chosen answer options. May be empty if the vote was retracted.
|
|
26
|
+
*/
|
|
27
|
+
option_ids: number[];
|
|
28
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { MessageEntity } from "./MessageEntity";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## PollOption
|
|
5
|
+
* This object contains information about one answer option in a poll.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#polloption
|
|
7
|
+
*/
|
|
8
|
+
export type PollOption = {
|
|
9
|
+
/**
|
|
10
|
+
* Option text, 1-100 characters
|
|
11
|
+
*/
|
|
12
|
+
text: string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Optional. Special entities that appear in the option text. Currently, only custom emoji entities are allowed in
|
|
16
|
+
* poll option texts
|
|
17
|
+
*/
|
|
18
|
+
text_entities?: MessageEntity[];
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Number of users that voted for this option
|
|
22
|
+
*/
|
|
23
|
+
voter_count: number;
|
|
24
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { Currencies, OrderInfo, User } from "./";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## PreCheckoutQuery
|
|
5
|
+
* This object contains information about an incoming pre-checkout query.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#precheckoutquery
|
|
7
|
+
*/
|
|
8
|
+
export type PreCheckoutQuery = {
|
|
9
|
+
/**
|
|
10
|
+
* Unique query identifier
|
|
11
|
+
*/
|
|
12
|
+
id: string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* User who sent the query
|
|
16
|
+
*/
|
|
17
|
+
from: User;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars
|
|
21
|
+
*/
|
|
22
|
+
currency: Currencies | "XTR";
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45
|
|
26
|
+
* pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point
|
|
27
|
+
* for each currency (2 for the majority of currencies).
|
|
28
|
+
*/
|
|
29
|
+
total_amount: number;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Bot-specified invoice payload
|
|
33
|
+
*/
|
|
34
|
+
invoice_payload: string;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Optional. Identifier of the shipping option chosen by the user
|
|
38
|
+
*/
|
|
39
|
+
shipping_option_id?: string;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Optional. Order information provided by the user
|
|
43
|
+
*/
|
|
44
|
+
order_info?: OrderInfo;
|
|
45
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { User } from "./User";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## ProximityAlertTriggered
|
|
5
|
+
* This object represents the content of a service message, sent whenever a user in the chat triggers a proximity alert
|
|
6
|
+
* set by another user.
|
|
7
|
+
* @see https://core.telegram.org/bots/api#proximityalerttriggered
|
|
8
|
+
*/
|
|
9
|
+
export type ProximityAlertTriggered = {
|
|
10
|
+
/**
|
|
11
|
+
* User that triggered the alert
|
|
12
|
+
*/
|
|
13
|
+
traveler: User;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* User that set the alert
|
|
17
|
+
*/
|
|
18
|
+
watcher: User;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The distance between the users
|
|
22
|
+
*/
|
|
23
|
+
distance: number;
|
|
24
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ReactionType } from "./ReactionType";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## ReactionCount
|
|
5
|
+
* Represents a reaction added to a message along with the number of times it was added.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#reactioncount
|
|
7
|
+
*/
|
|
8
|
+
export type ReactionCount = {
|
|
9
|
+
/**
|
|
10
|
+
* Type of the reaction
|
|
11
|
+
*/
|
|
12
|
+
type: ReactionType;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Number of times the reaction was added
|
|
16
|
+
*/
|
|
17
|
+
total_count: number;
|
|
18
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ReactionTypeCustomEmoji,
|
|
3
|
+
ReactionTypeEmoji,
|
|
4
|
+
ReactionTypePaid,
|
|
5
|
+
} from "./";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* ## ReactionType
|
|
9
|
+
* This object describes the type of a reaction. Currently, it can be one of
|
|
10
|
+
* - ReactionTypeEmoji
|
|
11
|
+
* - ReactionTypeCustomEmoji
|
|
12
|
+
* - ReactionTypePaid
|
|
13
|
+
* @see https://core.telegram.org/bots/api#reactiontype
|
|
14
|
+
*/
|
|
15
|
+
export type ReactionType =
|
|
16
|
+
| ReactionTypeEmoji
|
|
17
|
+
| ReactionTypeCustomEmoji
|
|
18
|
+
| ReactionTypePaid;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## ReactionTypeCustomEmoji
|
|
3
|
+
* The reaction is based on a custom emoji.
|
|
4
|
+
* #see https://core.telegram.org/bots/api#reactiontypecustomemoji
|
|
5
|
+
*/
|
|
6
|
+
export type ReactionTypeCustomEmoji = {
|
|
7
|
+
/**
|
|
8
|
+
* Type of the reaction, always “custom_emoji”
|
|
9
|
+
*/
|
|
10
|
+
type: "custom_emoji";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Custom emoji identifier
|
|
14
|
+
*/
|
|
15
|
+
custom_emoji_id: string;
|
|
16
|
+
};
|