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,109 @@
|
|
|
1
|
+
import type { User } from "./";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## MessageEntity
|
|
5
|
+
* This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#messageentity
|
|
7
|
+
*/
|
|
8
|
+
export type MessageEntity = {
|
|
9
|
+
/**
|
|
10
|
+
* Offset in UTF-16 code units to the start of the entity
|
|
11
|
+
*/
|
|
12
|
+
offset: number;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Length of the entity in UTF-16 code units
|
|
16
|
+
*/
|
|
17
|
+
length: number;
|
|
18
|
+
} & (
|
|
19
|
+
| {
|
|
20
|
+
/**
|
|
21
|
+
* Type of the entity. Currently, can be
|
|
22
|
+
* “mention” (@username),
|
|
23
|
+
* “hashtag” (#hashtag or #hashtag@chatusername),
|
|
24
|
+
* “cashtag” ($USD),
|
|
25
|
+
* “bot_command” (/start@jobs_bot),
|
|
26
|
+
* “url” (https://telegram.org),
|
|
27
|
+
* “email” (do-not-reply@telegram.org),
|
|
28
|
+
* “phone_number” (+1-212-555-0123),
|
|
29
|
+
* “bold” (bold text),
|
|
30
|
+
* “italic” (italic text),
|
|
31
|
+
* “underline” (underlined text),
|
|
32
|
+
* “strikethrough” (strikethrough text),
|
|
33
|
+
* “spoiler” (spoiler message),
|
|
34
|
+
* “blockquote” (block quotation),
|
|
35
|
+
* “expandable_blockquote” (collapsed-by-default block quotation),
|
|
36
|
+
* “code” (monowidth string),
|
|
37
|
+
* “pre” (monowidth block),
|
|
38
|
+
* “text_link” (for clickable text URLs),
|
|
39
|
+
* “text_mention” (for users without usernames),
|
|
40
|
+
* “custom_emoji” (for inline custom emoji stickers)
|
|
41
|
+
*/
|
|
42
|
+
type:
|
|
43
|
+
| "mention"
|
|
44
|
+
| "hashtag"
|
|
45
|
+
| "cashtag"
|
|
46
|
+
| "bot_command"
|
|
47
|
+
| "email"
|
|
48
|
+
| "phone_number"
|
|
49
|
+
| "bold"
|
|
50
|
+
| "italic"
|
|
51
|
+
| "underline"
|
|
52
|
+
| "strikethrough"
|
|
53
|
+
| "spoiler"
|
|
54
|
+
| "blockquote"
|
|
55
|
+
| "expandable_blockquote"
|
|
56
|
+
| "code"
|
|
57
|
+
| "text_link";
|
|
58
|
+
}
|
|
59
|
+
| {
|
|
60
|
+
/**
|
|
61
|
+
* Type of the entity.
|
|
62
|
+
* “url” (https://telegram.org),
|
|
63
|
+
*/
|
|
64
|
+
type: "url";
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Optional. For “text_link” only, URL that will be opened after user taps on the text
|
|
68
|
+
*/
|
|
69
|
+
url: string;
|
|
70
|
+
}
|
|
71
|
+
| {
|
|
72
|
+
/**
|
|
73
|
+
* Type of the entity.
|
|
74
|
+
* “text_mention” (for users without usernames),
|
|
75
|
+
*/
|
|
76
|
+
type: "text_mention";
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Optional. For “text_mention” only, the mentioned user
|
|
80
|
+
*/
|
|
81
|
+
user: User;
|
|
82
|
+
}
|
|
83
|
+
| {
|
|
84
|
+
/**
|
|
85
|
+
* Type of the entity.
|
|
86
|
+
* “pre” (monowidth block),
|
|
87
|
+
*/
|
|
88
|
+
type: "pre";
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Optional. For “pre” only, the programming language of the entity text
|
|
92
|
+
*/
|
|
93
|
+
language: string;
|
|
94
|
+
}
|
|
95
|
+
| {
|
|
96
|
+
/**
|
|
97
|
+
* Type of the entity.
|
|
98
|
+
* “custom_emoji” (for inline custom emoji stickers)
|
|
99
|
+
*/
|
|
100
|
+
type: "custom_emoji";
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Optional. For “custom_emoji” only, unique identifier of the custom emoji. Use getCustomEmojiStickers to get
|
|
104
|
+
* full
|
|
105
|
+
* information about the sticker
|
|
106
|
+
*/
|
|
107
|
+
custom_emoji_id: string;
|
|
108
|
+
}
|
|
109
|
+
);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
MessageOriginChannel,
|
|
3
|
+
MessageOriginChat,
|
|
4
|
+
MessageOriginHiddenUser,
|
|
5
|
+
MessageOriginUser,
|
|
6
|
+
} from "./";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* ## MessageOrigin
|
|
10
|
+
* This object describes the origin of a message. It can be one of
|
|
11
|
+
* - MessageOriginUser
|
|
12
|
+
* - MessageOriginHiddenUser
|
|
13
|
+
* - MessageOriginChat
|
|
14
|
+
* - MessageOriginChannel
|
|
15
|
+
* @see https://core.telegram.org/bots/api#messageorigin
|
|
16
|
+
*/
|
|
17
|
+
export type MessageOrigin =
|
|
18
|
+
| MessageOriginUser
|
|
19
|
+
| MessageOriginHiddenUser
|
|
20
|
+
| MessageOriginChat
|
|
21
|
+
| MessageOriginChannel;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Chat } from "./";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## MessageOriginChannel
|
|
5
|
+
* The message was originally sent to a channel chat.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#messageoriginchannel
|
|
7
|
+
*/
|
|
8
|
+
export type MessageOriginChannel = {
|
|
9
|
+
/**
|
|
10
|
+
* Type of the message origin, always “channel”
|
|
11
|
+
*/
|
|
12
|
+
type: "channel";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Date the message was sent originally in Unix time
|
|
16
|
+
*/
|
|
17
|
+
date: number;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Channel chat to which the message was originally sent
|
|
21
|
+
*/
|
|
22
|
+
chat: Chat;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Unique message identifier inside the chat
|
|
26
|
+
*/
|
|
27
|
+
message_id: number;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Optional. Signature of the original post author
|
|
31
|
+
*/
|
|
32
|
+
author_signature?: string;
|
|
33
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Chat } from "./";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## MessageOriginChat
|
|
5
|
+
* The message was originally sent on behalf of a chat to a group chat.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#messageoriginchat
|
|
7
|
+
*/
|
|
8
|
+
export type MessageOriginChat = {
|
|
9
|
+
/**
|
|
10
|
+
* Type of the message origin, always “chat”
|
|
11
|
+
*/
|
|
12
|
+
type: "chat";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Date the message was sent originally in Unix time
|
|
16
|
+
*/
|
|
17
|
+
date: number;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Chat that sent the message originally
|
|
21
|
+
*/
|
|
22
|
+
sender_chat: Chat;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Optional. For messages originally sent by an anonymous chat administrator, original message author signature
|
|
26
|
+
*/
|
|
27
|
+
author_signature?: string;
|
|
28
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## MessageOriginHiddenUser
|
|
3
|
+
* The message was originally sent by an unknown user.
|
|
4
|
+
* @see https://core.telegram.org/bots/api#messageoriginhiddenuser
|
|
5
|
+
*/
|
|
6
|
+
export type MessageOriginHiddenUser = {
|
|
7
|
+
/**
|
|
8
|
+
* Type of the message origin, always “hidden_user”
|
|
9
|
+
*/
|
|
10
|
+
type: "hidden_user";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Date the message was sent originally in Unix time
|
|
14
|
+
*/
|
|
15
|
+
date: number;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Name of the user that sent the message originally
|
|
19
|
+
*/
|
|
20
|
+
sender_user_name: string;
|
|
21
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { User } from "./User";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## MessageOriginUser
|
|
5
|
+
* The message was originally sent by a known user.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#messageoriginuser
|
|
7
|
+
*/
|
|
8
|
+
export type MessageOriginUser = {
|
|
9
|
+
/**
|
|
10
|
+
* Type of the message origin, always “user”
|
|
11
|
+
*/
|
|
12
|
+
type: "user";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Date the message was sent originally in Unix time
|
|
16
|
+
*/
|
|
17
|
+
date: number;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* User that sent the message originally
|
|
21
|
+
*/
|
|
22
|
+
sender_user: User;
|
|
23
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Chat, ReactionCount } from "./";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## MessageReactionCountUpdated
|
|
5
|
+
* This object represents reaction changes on a message with anonymous reactions.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#messagereactioncountupdated
|
|
7
|
+
*/
|
|
8
|
+
export type MessageReactionCountUpdated = {
|
|
9
|
+
/**
|
|
10
|
+
* The chat containing the message
|
|
11
|
+
*/
|
|
12
|
+
chat: Chat;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Unique message identifier inside the chat
|
|
16
|
+
*/
|
|
17
|
+
message_id: number;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Date of the change in Unix time
|
|
21
|
+
*/
|
|
22
|
+
date: number;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* List of reactions that are present on the message
|
|
26
|
+
*/
|
|
27
|
+
reactions: ReactionCount[];
|
|
28
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { Chat, ReactionType, User } from "./";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## MessageReactionUpdated
|
|
5
|
+
* This object represents a change of a reaction on a message performed by a user.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#messagereactionupdated
|
|
7
|
+
*/
|
|
8
|
+
export type MessageReactionUpdated = {
|
|
9
|
+
/**
|
|
10
|
+
* The chat containing the message the user reacted to
|
|
11
|
+
*/
|
|
12
|
+
chat: Chat;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Unique identifier of the message inside the chat
|
|
16
|
+
*/
|
|
17
|
+
message_id: number;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Optional. The user that changed the reaction, if the user isn't anonymous
|
|
21
|
+
*/
|
|
22
|
+
user: User;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Optional. The chat on behalf of which the reaction was changed, if the user is anonymous
|
|
26
|
+
*/
|
|
27
|
+
actor_chat: Chat;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Date of the change in Unix time
|
|
31
|
+
*/
|
|
32
|
+
date: number;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Previous list of reaction types that were set by the user
|
|
36
|
+
*/
|
|
37
|
+
old_reaction: ReactionType[];
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* New list of reaction types that have been set by the user
|
|
41
|
+
*/
|
|
42
|
+
new_reaction: ReactionType[];
|
|
43
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ShippingAddress } from "./";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## OrderInfo
|
|
5
|
+
* This object represents information about an order.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#orderinfo
|
|
7
|
+
*/
|
|
8
|
+
export type OrderInfo = {
|
|
9
|
+
/**
|
|
10
|
+
* Optional. User name
|
|
11
|
+
*/
|
|
12
|
+
name?: string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Optional. User's phone number
|
|
16
|
+
*/
|
|
17
|
+
phone_number?: string;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Optional. User email
|
|
21
|
+
*/
|
|
22
|
+
email?: string;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Optional. User shipping address
|
|
26
|
+
*/
|
|
27
|
+
shipping_address: ShippingAddress;
|
|
28
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { OwnedGiftRegular, OwnedGiftUnique } from "./";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## OwnedGift
|
|
5
|
+
* This object describes a gift received and owned by a user or a chat.
|
|
6
|
+
* Currently, it can be one of:
|
|
7
|
+
* - OwnedGiftRegular
|
|
8
|
+
* - OwnedGiftUnique
|
|
9
|
+
* @see https://core.telegram.org/bots/api#ownedgift
|
|
10
|
+
*/
|
|
11
|
+
export type OwnedGift = OwnedGiftRegular | OwnedGiftUnique;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { Gift, MessageEntity, User } from "./";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## OwnedGiftRegular
|
|
5
|
+
* Describes a regular gift owned by a user or a chat.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#ownedgiftregular
|
|
7
|
+
*/
|
|
8
|
+
export type OwnedGiftRegular = {
|
|
9
|
+
/**
|
|
10
|
+
* Type of the gift, always “regular”
|
|
11
|
+
*/
|
|
12
|
+
type: "regular";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Information about the regular gift
|
|
16
|
+
*/
|
|
17
|
+
gift: Gift;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Optional. Unique identifier of the gift for the bot; for gifts received on behalf of business accounts only
|
|
21
|
+
*/
|
|
22
|
+
owned_gift_id?: string;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Optional. Sender of the gift if it is a known user
|
|
26
|
+
*/
|
|
27
|
+
sender_user?: User;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Date the gift was sent in Unix time
|
|
31
|
+
*/
|
|
32
|
+
send_date: number;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Optional. Text of the message that was added to the gift
|
|
36
|
+
*/
|
|
37
|
+
text?: string;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Optional. Special entities that appear in the text
|
|
41
|
+
*/
|
|
42
|
+
entities?: MessageEntity[];
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Optional. True, if the sender and gift text are shown only to the gift
|
|
46
|
+
* receiver; otherwise, everyone will be able to see them
|
|
47
|
+
*/
|
|
48
|
+
is_private?: true;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Optional. True, if the gift is displayed on the account's profile page; for
|
|
52
|
+
* gifts received on behalf of business accounts only
|
|
53
|
+
*/
|
|
54
|
+
is_saved?: true;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Optional. True, if the gift can be upgraded to a unique gift; for gifts
|
|
58
|
+
* received on behalf of business accounts only
|
|
59
|
+
*/
|
|
60
|
+
can_be_upgraded?: true;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Optional. True, if the gift was refunded and isn't available anymore
|
|
64
|
+
*/
|
|
65
|
+
was_refunded?: true;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Optional. Number of Telegram Stars that can be claimed by the receiver
|
|
69
|
+
* instead of the gift; omitted if the gift cannot be converted to Telegram Stars
|
|
70
|
+
*/
|
|
71
|
+
convert_star_count?: number;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Optional. Number of Telegram Stars that were paid by the sender for the ability to upgrade the gift
|
|
75
|
+
*/
|
|
76
|
+
prepaid_upgrade_star_count?: number;
|
|
77
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { Gift, User } from "./";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## OwnedGiftUnique
|
|
5
|
+
* Describes a unique gift owned by a user or a chat.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#ownedgiftunique
|
|
7
|
+
*/
|
|
8
|
+
export type OwnedGiftUnique = {
|
|
9
|
+
/**
|
|
10
|
+
* Type of the gift, always “unique”
|
|
11
|
+
*/
|
|
12
|
+
type: "unique";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Information about the unique gift
|
|
16
|
+
*/
|
|
17
|
+
gift: Gift;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Optional. Unique identifier of the gift for the bot; for gifts received on behalf of business accounts only
|
|
21
|
+
*/
|
|
22
|
+
owned_gift_id?: string;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Optional. Sender of the gift if it is a known user
|
|
26
|
+
*/
|
|
27
|
+
sender_user?: User;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Date the gift was sent in Unix time
|
|
31
|
+
*/
|
|
32
|
+
send_date: number;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Optional. True, if the gift is displayed on the account's profile page; for
|
|
36
|
+
* gifts received on behalf of business accounts only
|
|
37
|
+
*/
|
|
38
|
+
is_saved?: true;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Optional. True, if the gift can be transferred to another owner; for gifts
|
|
42
|
+
* received on behalf of business accounts only
|
|
43
|
+
*/
|
|
44
|
+
can_be_transferred?: true;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Optional. Number of Telegram Stars that must be paid to transfer the gift;
|
|
48
|
+
* omitted if the bot cannot transfer the gift
|
|
49
|
+
*/
|
|
50
|
+
transfer_star_count?: number;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Optional. Point in time (Unix timestamp) when the gift can be transferred.
|
|
54
|
+
* If it is in the past, then the gift can be transferred now
|
|
55
|
+
*/
|
|
56
|
+
next_transfer_date?: number;
|
|
57
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { OwnedGift } from "./";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## OwnedGifts
|
|
5
|
+
* Contains the list of gifts received and owned by a user or a chat.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#ownedgifts
|
|
7
|
+
*/
|
|
8
|
+
export type OwnedGifts = {
|
|
9
|
+
/**
|
|
10
|
+
* The total number of gifts owned by the user or the chat
|
|
11
|
+
*/
|
|
12
|
+
total_count: number;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The list of gifts
|
|
16
|
+
*/
|
|
17
|
+
gifts: OwnedGift[];
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Optional. Offset for the next request. If empty, then there are no more results
|
|
21
|
+
*/
|
|
22
|
+
next_offset?: string;
|
|
23
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { PaidMediaPhoto } from "./PaidMediaPhoto";
|
|
2
|
+
import type { PaidMediaPreview } from "./PaidMediaPreview";
|
|
3
|
+
import type { PaidMediaVideo } from "./PaidMediaVideo";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* ## PaidMedia
|
|
7
|
+
* This object describes paid media. Currently, it can be one of
|
|
8
|
+
* - PaidMediaPreview
|
|
9
|
+
* - PaidMediaPhoto
|
|
10
|
+
* - PaidMediaVideo
|
|
11
|
+
* @see https://core.telegram.org/bots/api#paidmedia
|
|
12
|
+
*/
|
|
13
|
+
export type PaidMedia = PaidMediaPreview | PaidMediaPhoto | PaidMediaVideo;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { PaidMedia } from "./PaidMedia";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## PaidMediaInfo
|
|
5
|
+
* Describes the paid media added to a message.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#paidmediainfo
|
|
7
|
+
*/
|
|
8
|
+
export type PaidMediaInfo = {
|
|
9
|
+
/**
|
|
10
|
+
* The number of Telegram Stars that must be paid to buy access to the media
|
|
11
|
+
*/
|
|
12
|
+
star_count: number;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Information about the paid media
|
|
16
|
+
*/
|
|
17
|
+
paid_media: PaidMedia[];
|
|
18
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { PhotoSize } from "./PhotoSize";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## PaidMediaPhoto
|
|
5
|
+
* The paid media is a photo.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#paidmediaphoto
|
|
7
|
+
*/
|
|
8
|
+
export type PaidMediaPhoto = {
|
|
9
|
+
/**
|
|
10
|
+
* Type of the paid media, always “photo”
|
|
11
|
+
*/
|
|
12
|
+
type: "photo";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The photo
|
|
16
|
+
*/
|
|
17
|
+
photo: PhotoSize[];
|
|
18
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## PaidMediaPreview
|
|
3
|
+
* The paid media isn't available before the payment.
|
|
4
|
+
* @see https://core.telegram.org/bots/api#paidmediapreview
|
|
5
|
+
*/
|
|
6
|
+
export type PaidMediaPreview = {
|
|
7
|
+
/**
|
|
8
|
+
* Type of the paid media, always “preview”
|
|
9
|
+
*/
|
|
10
|
+
type: "preview";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Optional. Media width as defined by the sender
|
|
14
|
+
*/
|
|
15
|
+
width?: number;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Optional. Media height as defined by the sender
|
|
19
|
+
*/
|
|
20
|
+
height?: number;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Optional. Duration of the media in seconds as defined by the sender
|
|
24
|
+
*/
|
|
25
|
+
duration?: number;
|
|
26
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { User } from "./User";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## PaidMediaPreview
|
|
5
|
+
* This object contains information about a paid media purchase.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#paidmediapurchased
|
|
7
|
+
*/
|
|
8
|
+
export type PaidMediaPurchased = {
|
|
9
|
+
/**
|
|
10
|
+
* User who purchased the media
|
|
11
|
+
*/
|
|
12
|
+
from: User;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Bot-specified paid media payload
|
|
16
|
+
*/
|
|
17
|
+
paid_media_payload: string;
|
|
18
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Video } from "./Video";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## PaidMediaVideo
|
|
5
|
+
* The paid media is a video.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#paidmediavideo
|
|
7
|
+
*/
|
|
8
|
+
export type PaidMediaVideo = {
|
|
9
|
+
/**
|
|
10
|
+
* Type of the paid media, always “video”
|
|
11
|
+
*/
|
|
12
|
+
type: "video";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The video
|
|
16
|
+
*/
|
|
17
|
+
photo: Video[];
|
|
18
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## PaidMessagePriceChanged
|
|
3
|
+
* This object represents a service message about a change in the price for paid messages in a chat.
|
|
4
|
+
* @see https://core.telegram.org/bots/api#paidmessagepricechanged
|
|
5
|
+
*/
|
|
6
|
+
export type PaidMessagePriceChanged = {
|
|
7
|
+
/**
|
|
8
|
+
* New price for paid messages in the chat, in the smallest units of the currency (integer, not float). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json for the number of digits past the decimal point for each currency (https://core.telegram.org/bots/payments/currencies.json), it may be different for each currency.
|
|
9
|
+
*/
|
|
10
|
+
amount: number;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Three-letter ISO 4217 currency code
|
|
14
|
+
*/
|
|
15
|
+
currency: string;
|
|
16
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { EncryptedCredentials, EncryptedPassportElement } from "./";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## PassportData
|
|
5
|
+
* Describes Telegram Passport data shared with the bot by the user.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#passportdata
|
|
7
|
+
*/
|
|
8
|
+
export type PassportData = {
|
|
9
|
+
/**
|
|
10
|
+
* Array with information about documents and other Telegram Passport elements that was shared with the bot
|
|
11
|
+
*/
|
|
12
|
+
data: EncryptedPassportElement[];
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Encrypted credentials required to decrypt the data
|
|
16
|
+
*/
|
|
17
|
+
credentials: EncryptedCredentials;
|
|
18
|
+
};
|