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/@types/Story.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Chat } from "./Chat";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## Story
|
|
5
|
+
* This object represents a story.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#story
|
|
7
|
+
*/
|
|
8
|
+
export type Story = {
|
|
9
|
+
/**
|
|
10
|
+
* Chat that posted the story
|
|
11
|
+
*/
|
|
12
|
+
chat: Chat;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Unique identifier for the story in the chat
|
|
16
|
+
*/
|
|
17
|
+
id: number;
|
|
18
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { StoryAreaPosition, StoryAreaType } from "./";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## StoryArea
|
|
5
|
+
* Describes a clickable area on a story media.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#storyarea
|
|
7
|
+
*/
|
|
8
|
+
export type StoryArea = {
|
|
9
|
+
/**
|
|
10
|
+
* Position of the area
|
|
11
|
+
*/
|
|
12
|
+
position: StoryAreaPosition;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Type of the area
|
|
16
|
+
*/
|
|
17
|
+
type: StoryAreaType;
|
|
18
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## StoryAreaPosition
|
|
3
|
+
* Describes the position of a clickable area within a story.
|
|
4
|
+
* @see https://core.telegram.org/bots/api#storyareaposition
|
|
5
|
+
*/
|
|
6
|
+
export type StoryAreaPosition = {
|
|
7
|
+
/**
|
|
8
|
+
* The abscissa of the area's center, as a percentage of the media width
|
|
9
|
+
*/
|
|
10
|
+
x_percentage: number;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The ordinate of the area's center, as a percentage of the media height
|
|
14
|
+
*/
|
|
15
|
+
y_percentage: number;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The width of the area's rectangle, as a percentage of the media width
|
|
19
|
+
*/
|
|
20
|
+
width_percentage: number;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The height of the area's rectangle, as a percentage of the media height
|
|
24
|
+
*/
|
|
25
|
+
height_percentage: number;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* The clockwise rotation angle of the rectangle, in degrees; 0-360
|
|
29
|
+
*/
|
|
30
|
+
rotation_angle: number;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* The radius of the rectangle corner rounding, as a percentage of the media
|
|
34
|
+
*/
|
|
35
|
+
corner_radius_percentage: number;
|
|
36
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
StoryAreaTypeLink,
|
|
3
|
+
StoryAreaTypeLocation,
|
|
4
|
+
StoryAreaTypeSuggestedReaction,
|
|
5
|
+
StoryAreaTypeUniqueGift,
|
|
6
|
+
StoryAreaTypeWeather,
|
|
7
|
+
} from "./";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* ## StoryAreaType
|
|
11
|
+
* Describes the type of a clickable area on a story. Currently, it can be one of:
|
|
12
|
+
* - StoryAreaTypeLocation
|
|
13
|
+
* - StoryAreaTypeSuggestedReaction
|
|
14
|
+
* - StoryAreaTypeLink
|
|
15
|
+
* - StoryAreaTypeWeather
|
|
16
|
+
* - StoryAreaTypeUniqueGift
|
|
17
|
+
* @see https://core.telegram.org/bots/api#storyareatype
|
|
18
|
+
*/
|
|
19
|
+
export type StoryAreaType =
|
|
20
|
+
| StoryAreaTypeLocation
|
|
21
|
+
| StoryAreaTypeSuggestedReaction
|
|
22
|
+
| StoryAreaTypeLink
|
|
23
|
+
| StoryAreaTypeWeather
|
|
24
|
+
| StoryAreaTypeUniqueGift;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## StoryAreaTypeLink
|
|
3
|
+
* Describes a story area pointing to an HTTP or tg:// link. Currently, a story can have up to 3 link areas.
|
|
4
|
+
* @see https://core.telegram.org/bots/api#storyareatypelink
|
|
5
|
+
*/
|
|
6
|
+
export type StoryAreaTypeLink = {
|
|
7
|
+
/**
|
|
8
|
+
* Type of the area, always “link”
|
|
9
|
+
*/
|
|
10
|
+
type: "link";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* HTTP or tg:// URL to be opened when the area is clicked
|
|
14
|
+
*/
|
|
15
|
+
url: string;
|
|
16
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { LocationAddress } from "./";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## StoryAreaTypeLocation
|
|
5
|
+
* Describes a story area pointing to a location. Currently, a story can have up to 10 location areas.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#storyareatypelocation
|
|
7
|
+
*/
|
|
8
|
+
export type StoryAreaTypeLocation = {
|
|
9
|
+
/**
|
|
10
|
+
* Type of the area, always “location”
|
|
11
|
+
*/
|
|
12
|
+
type: "location";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Location latitude in degrees
|
|
16
|
+
*/
|
|
17
|
+
latitude: number;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Location longitude in degrees
|
|
21
|
+
*/
|
|
22
|
+
longitude: number;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Optional. Address of the location
|
|
26
|
+
*/
|
|
27
|
+
address?: LocationAddress;
|
|
28
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ReactionType } from "./";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## StoryAreaTypeSuggestedReaction
|
|
5
|
+
* Describes a story area pointing to a suggested reaction. Currently, a story
|
|
6
|
+
* can have up to 5 suggested reaction areas.
|
|
7
|
+
* @see https://core.telegram.org/bots/api#storyareatypesuggestedreaction
|
|
8
|
+
*/
|
|
9
|
+
export type StoryAreaTypeSuggestedReaction = {
|
|
10
|
+
/**
|
|
11
|
+
* Type of the area, always “suggested_reaction”
|
|
12
|
+
*/
|
|
13
|
+
type: "suggested_reaction";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Type of the reaction
|
|
17
|
+
*/
|
|
18
|
+
reaction_type: ReactionType;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Optional. Pass True if the reaction area has a dark background
|
|
22
|
+
*/
|
|
23
|
+
is_dark?: boolean;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Optional. Pass True if reaction area corner is flipped
|
|
27
|
+
*/
|
|
28
|
+
is_flipped?: boolean;
|
|
29
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## StoryAreaTypeUniqueGift
|
|
3
|
+
* Describes a story area pointing to a unique gift. Currently, a story can have at most 1 unique gift area.
|
|
4
|
+
* @see https://core.telegram.org/bots/api#storyareatypeuniquegift
|
|
5
|
+
*/
|
|
6
|
+
export type StoryAreaTypeUniqueGift = {
|
|
7
|
+
/**
|
|
8
|
+
* Type of the area, always “unique_gift”
|
|
9
|
+
*/
|
|
10
|
+
type: "unique_gift";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Unique name of the gift
|
|
14
|
+
*/
|
|
15
|
+
name: string;
|
|
16
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## StoryAreaTypeWeather
|
|
3
|
+
* Describes a story area containing weather information. Currently, a story can have up to 3 weather areas.
|
|
4
|
+
* @see https://core.telegram.org/bots/api#storyareatypeweather
|
|
5
|
+
*/
|
|
6
|
+
export type StoryAreaTypeWeather = {
|
|
7
|
+
/**
|
|
8
|
+
* Type of the area, always “weather”
|
|
9
|
+
*/
|
|
10
|
+
type: "weather";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Temperature, in degree Celsius
|
|
14
|
+
*/
|
|
15
|
+
temperature: number;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Emoji representing the weather
|
|
19
|
+
*/
|
|
20
|
+
emoji: string;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* A color of the area background in the ARGB format
|
|
24
|
+
*/
|
|
25
|
+
background_color: number;
|
|
26
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { Currencies, OrderInfo } from "./";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## SuccessfulPayment
|
|
5
|
+
* This object contains basic information about a successful payment.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#successfulpayment
|
|
7
|
+
*/
|
|
8
|
+
export type SuccessfulPayment = {
|
|
9
|
+
/**
|
|
10
|
+
* Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars
|
|
11
|
+
*/
|
|
12
|
+
currency: Currencies | "XTR";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45
|
|
16
|
+
* pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point
|
|
17
|
+
* for each currency (2 for the majority of currencies).
|
|
18
|
+
*/
|
|
19
|
+
total_amount: number;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Bot-specified invoice payload
|
|
23
|
+
*/
|
|
24
|
+
invoice_payload: string;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Optional. Expiration date of the subscription, in Unix time; for recurring payments only
|
|
28
|
+
*/
|
|
29
|
+
subscription_expiration_date?: number;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Optional. True, if the payment is a recurring payment for a subscription
|
|
33
|
+
*/
|
|
34
|
+
is_recurring?: boolean;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Optional. True, if the payment is the first payment for a subscription
|
|
38
|
+
*/
|
|
39
|
+
is_first_recurring?: boolean;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Optional. Identifier of the shipping option chosen by the user
|
|
43
|
+
*/
|
|
44
|
+
shipping_option_id?: string;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Optional. Order information provided by the user
|
|
48
|
+
*/
|
|
49
|
+
order_info?: OrderInfo;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Telegram payment identifier
|
|
53
|
+
*/
|
|
54
|
+
telegram_payment_charge_id: string;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Provider payment identifier
|
|
58
|
+
*/
|
|
59
|
+
provider_payment_charge_id: string;
|
|
60
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## SwitchInlineQueryChosenChat
|
|
3
|
+
* This object represents an inline button that switches the current user to inline mode in a chosen chat, with an
|
|
4
|
+
* optional default inline query.
|
|
5
|
+
* @see https://core.telegram.org/bots/api#switchinlinequerychosenchat
|
|
6
|
+
*/
|
|
7
|
+
export type SwitchInlineQueryChosenChat = {
|
|
8
|
+
/**
|
|
9
|
+
* Optional. The default inline query to be inserted in the input field. If left empty, only the bot's username will
|
|
10
|
+
* be inserted
|
|
11
|
+
*/
|
|
12
|
+
query: string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Optional. True, if private chats with users can be chosen
|
|
16
|
+
*/
|
|
17
|
+
allow_user_chats?: boolean;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Optional. True, if private chats with bots can be chosen
|
|
21
|
+
*/
|
|
22
|
+
allow_bot_chats?: boolean;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Optional. True, if group and supergroup chats can be chosen
|
|
26
|
+
*/
|
|
27
|
+
allow_group_chats?: boolean;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Optional. True, if channel chats can be chosen
|
|
31
|
+
*/
|
|
32
|
+
allow_channel_chats?: boolean;
|
|
33
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { MessageEntity } from "./";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## TextQuote
|
|
5
|
+
* This object contains information about the quoted part of a message that is replied to by the given message.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#textquote
|
|
7
|
+
*/
|
|
8
|
+
export type TextQuote = {
|
|
9
|
+
/**
|
|
10
|
+
* Text of the quoted part of a message that is replied to by the given message
|
|
11
|
+
*/
|
|
12
|
+
text: string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Optional. Special entities that appear in the quote. Currently, only bold, italic, underline, strikethrough,
|
|
16
|
+
* spoiler, and custom_emoji entities are kept in quotes.
|
|
17
|
+
*/
|
|
18
|
+
entities: MessageEntity[];
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Approximate quote position in the original message in UTF-16 code units as specified by the sender
|
|
22
|
+
*/
|
|
23
|
+
position: number;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Optional. True, if the quote was chosen manually by the message sender. Otherwise, the quote was added
|
|
27
|
+
* automatically by the server.
|
|
28
|
+
*/
|
|
29
|
+
is_manual: boolean;
|
|
30
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
TransactionPartnerAffiliateProgram,
|
|
3
|
+
TransactionPartnerChat,
|
|
4
|
+
TransactionPartnerFragment,
|
|
5
|
+
TransactionPartnerOther,
|
|
6
|
+
TransactionPartnerTelegramAds,
|
|
7
|
+
TransactionPartnerTelegramApi,
|
|
8
|
+
TransactionPartnerUser,
|
|
9
|
+
} from "./";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* ## TransactionPartner
|
|
13
|
+
* This object describes the source of a transaction, or its recipient for outgoing transactions. Currently, it can be
|
|
14
|
+
* one of
|
|
15
|
+
* - TransactionPartnerUser
|
|
16
|
+
* - TransactionPartnerChat
|
|
17
|
+
* - TransactionPartnerAffiliateProgram
|
|
18
|
+
* - TransactionPartnerFragment
|
|
19
|
+
* - TransactionPartnerTelegramAds
|
|
20
|
+
* - TransactionPartnerTelegramApi
|
|
21
|
+
* - TransactionPartnerOther
|
|
22
|
+
* @see https://core.telegram.org/bots/api#transactionpartner
|
|
23
|
+
*/
|
|
24
|
+
export type TransactionPartner =
|
|
25
|
+
| TransactionPartnerUser
|
|
26
|
+
| TransactionPartnerChat
|
|
27
|
+
| TransactionPartnerAffiliateProgram
|
|
28
|
+
| TransactionPartnerFragment
|
|
29
|
+
| TransactionPartnerTelegramAds
|
|
30
|
+
| TransactionPartnerTelegramApi
|
|
31
|
+
| TransactionPartnerOther;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { User } from "./";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## TransactionPartnerAffiliateProgram
|
|
5
|
+
* Describes the affiliate program that issued the affiliate commission received via this transaction.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#transactionpartneraffiliateprogram
|
|
7
|
+
*/
|
|
8
|
+
export type TransactionPartnerAffiliateProgram = {
|
|
9
|
+
/**
|
|
10
|
+
* Type of the transaction partner, always “affiliate_program”
|
|
11
|
+
*/
|
|
12
|
+
type: "affiliate_program";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Optional. Information about the bot that sponsored the affiliate program
|
|
16
|
+
*/
|
|
17
|
+
sponsor_user?: User;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The number of Telegram Stars received by the bot for each 1000 Telegram Stars received by the affiliate program
|
|
21
|
+
* sponsor from referred users
|
|
22
|
+
*/
|
|
23
|
+
commission_per_mille: number;
|
|
24
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Chat, Gift } from "./";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Describes a transaction with a chat.
|
|
5
|
+
*/
|
|
6
|
+
export type TransactionPartnerChat = {
|
|
7
|
+
/**
|
|
8
|
+
* Type of the transaction partner, always “chat”
|
|
9
|
+
*/
|
|
10
|
+
type: "chat";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Information about the chat
|
|
14
|
+
*/
|
|
15
|
+
chat: Chat;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Optional. The gift sent to the chat by the bot
|
|
19
|
+
*/
|
|
20
|
+
gift?: Gift;
|
|
21
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { RevenueWithdrawalState } from "./RevenueWithdrawalState";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## TransactionPartnerFragment
|
|
5
|
+
* Describes a withdrawal transaction with Fragment.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#transactionpartnerfragment
|
|
7
|
+
*/
|
|
8
|
+
export type TransactionPartnerFragment = {
|
|
9
|
+
/**
|
|
10
|
+
* Type of the transaction partner, always “fragment”
|
|
11
|
+
*/
|
|
12
|
+
type: "fragment";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Optional. State of the transaction if the transaction is outgoing
|
|
16
|
+
*/
|
|
17
|
+
withdrawal_state?: RevenueWithdrawalState;
|
|
18
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## TransactionPartnerOther
|
|
3
|
+
* Describes a transaction with an unknown source or recipient.
|
|
4
|
+
* @see https://core.telegram.org/bots/api#transactionpartneruser
|
|
5
|
+
*/
|
|
6
|
+
export type TransactionPartnerOther = {
|
|
7
|
+
/**
|
|
8
|
+
* Type of the transaction partner, always “other”
|
|
9
|
+
*/
|
|
10
|
+
type: "other";
|
|
11
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## TransactionPartnerTelegramAds
|
|
3
|
+
* Describes a withdrawal transaction to the Telegram Ads platform.
|
|
4
|
+
* @see https://core.telegram.org/bots/api#transactionpartnertelegramads
|
|
5
|
+
*/
|
|
6
|
+
export type TransactionPartnerTelegramAds = {
|
|
7
|
+
/**
|
|
8
|
+
* Type of the transaction partner, always “telegram_ads”
|
|
9
|
+
*/
|
|
10
|
+
type: "telegram_ads";
|
|
11
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## TransactionPartnerTelegramApi
|
|
3
|
+
* Describes a transaction with payment for paid broadcasting.
|
|
4
|
+
* @see https://core.telegram.org/bots/api#transactionpartnertelegramapi
|
|
5
|
+
*/
|
|
6
|
+
export type TransactionPartnerTelegramApi = {
|
|
7
|
+
/**
|
|
8
|
+
* Type of the transaction partner, always “telegram_api”
|
|
9
|
+
*/
|
|
10
|
+
type: "telegram_api";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The number of successful requests that exceeded regular limits and were therefore billed
|
|
14
|
+
*/
|
|
15
|
+
request_count: number;
|
|
16
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { AffiliateInfo, Gift, PaidMedia, User } from "./";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## TransactionPartnerUser
|
|
5
|
+
* Describes a transaction with a user.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#transactionpartneruser
|
|
7
|
+
*/
|
|
8
|
+
export type TransactionPartnerUser = {
|
|
9
|
+
/**
|
|
10
|
+
* Type of the transaction partner, always “user”
|
|
11
|
+
*/
|
|
12
|
+
type: "user";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Type of the transaction, currently one of:
|
|
16
|
+
* - "invoice_payment" for payments via invoices
|
|
17
|
+
* - "paid_media_payment" for payments for paid media
|
|
18
|
+
* - "gift_purchase" for gifts sent by the bot
|
|
19
|
+
* - "premium_purchase" for Telegram Premium subscriptions gifted by the bot
|
|
20
|
+
* - "business_account_transfer" for direct transfers from managed business accounts
|
|
21
|
+
*/
|
|
22
|
+
transaction_type:
|
|
23
|
+
| "invoice_payment"
|
|
24
|
+
| "paid_media_payment"
|
|
25
|
+
| "gift_purchase"
|
|
26
|
+
| "premium_purchase"
|
|
27
|
+
| "business_account_transfer";
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Information about the user
|
|
31
|
+
*/
|
|
32
|
+
user: User;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Optional. Information about the affiliate that received a commission via this transaction.
|
|
36
|
+
* Can be available only for “invoice_payment” and “paid_media_payment” transactions.
|
|
37
|
+
*/
|
|
38
|
+
affiliate?: AffiliateInfo;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Optional. Bot-specified invoice payload. Can be available only for “invoice_payment” transactions.
|
|
42
|
+
*/
|
|
43
|
+
invoice_payload?: string;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Optional. The duration of the paid subscription. Can be available only for “invoice_payment” transactions.
|
|
47
|
+
*/
|
|
48
|
+
subscription_period?: number;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Optional. Information about the paid media bought by the user; for “paid_media_payment” transactions only
|
|
52
|
+
*/
|
|
53
|
+
paid_media?: PaidMedia[];
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Optional. Bot-specified paid media payload. Can be available only for “paid_media_payment” transactions.
|
|
57
|
+
*/
|
|
58
|
+
paid_media_payload?: string;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Optional. The gift sent to the user by the bot; for “gift_purchase” transactions only
|
|
62
|
+
*/
|
|
63
|
+
gift?: Gift;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Optional. Number of months the gifted Telegram Premium subscription will be active for;
|
|
67
|
+
* for “premium_purchase” transactions only
|
|
68
|
+
*/
|
|
69
|
+
premium_subscription_duration?: number;
|
|
70
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { UniqueGiftBackdrop, UniqueGiftModel, UniqueGiftSymbol } from "./";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## UniqueGift
|
|
5
|
+
* This object describes a unique gift that was upgraded from a regular gift.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#uniquegift
|
|
7
|
+
*/
|
|
8
|
+
export type UniqueGift = {
|
|
9
|
+
/**
|
|
10
|
+
* Human-readable name of the regular gift from which this unique gift was upgraded
|
|
11
|
+
*/
|
|
12
|
+
base_name: string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Unique name of the gift. This name can be used in https://t.me/nft/... links and story areas
|
|
16
|
+
*/
|
|
17
|
+
name: string;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Unique number of the upgraded gift among gifts upgraded from the same regular gift
|
|
21
|
+
*/
|
|
22
|
+
number: number;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Model of the gift
|
|
26
|
+
*/
|
|
27
|
+
model: UniqueGiftModel;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Symbol of the gift
|
|
31
|
+
*/
|
|
32
|
+
symbol: UniqueGiftSymbol;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Backdrop of the gift
|
|
36
|
+
*/
|
|
37
|
+
backdrop: UniqueGiftBackdrop;
|
|
38
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { UniqueGiftBackdropColors } from "./";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## UniqueGiftBackdrop
|
|
5
|
+
* This object describes the backdrop of a unique gift.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#uniquegiftbackdrop
|
|
7
|
+
*/
|
|
8
|
+
export type UniqueGiftBackdrop = {
|
|
9
|
+
/**
|
|
10
|
+
* Name of the backdrop
|
|
11
|
+
*/
|
|
12
|
+
name: string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Colors of the backdrop
|
|
16
|
+
*/
|
|
17
|
+
colors: UniqueGiftBackdropColors;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The number of unique gifts that receive this backdrop for every 1000 gifts upgraded
|
|
21
|
+
*/
|
|
22
|
+
rarity_per_mille: number;
|
|
23
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## UniqueGiftBackdropColors
|
|
3
|
+
* This object describes the colors of the backdrop of a unique gift.
|
|
4
|
+
* @see https://core.telegram.org/bots/api#uniquegiftbackdropcolors
|
|
5
|
+
*/
|
|
6
|
+
export type UniqueGiftBackdropColors = {
|
|
7
|
+
/**
|
|
8
|
+
* The color in the center of the backdrop in RGB format
|
|
9
|
+
*/
|
|
10
|
+
center_color: number;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The color on the edges of the backdrop in RGB format
|
|
14
|
+
*/
|
|
15
|
+
edge_color: number;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The color to be applied to the symbol in RGB format
|
|
19
|
+
*/
|
|
20
|
+
symbol_color: number;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The color for the text on the backdrop in RGB format
|
|
24
|
+
*/
|
|
25
|
+
text_color: number;
|
|
26
|
+
};
|