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,42 @@
|
|
|
1
|
+
import type { UniqueGift } from "./";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## UniqueGiftInfo
|
|
5
|
+
* Describes a service message about a unique gift that was sent or received.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#uniquegiftinfo
|
|
7
|
+
*/
|
|
8
|
+
export type UniqueGiftInfo = {
|
|
9
|
+
/**
|
|
10
|
+
* Information about the gift
|
|
11
|
+
*/
|
|
12
|
+
gift: UniqueGift;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Origin of the gift. Currently, either "upgrade" for gifts upgraded from regular gifts, "transfer" for gifts
|
|
16
|
+
* transferred from other users or channels, or "resale" for gifts bought from other users
|
|
17
|
+
*/
|
|
18
|
+
origin: string;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Optional. For gifts bought from other users, the price paid for the gift
|
|
22
|
+
*/
|
|
23
|
+
last_resale_star_count?: number;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Optional. Unique identifier of the received gift for the bot; only present for gifts received on behalf of
|
|
27
|
+
* business accounts
|
|
28
|
+
*/
|
|
29
|
+
owned_gift_id?: string;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Optional. Number of Telegram Stars that must be paid to transfer the gift; omitted if the bot cannot transfer
|
|
33
|
+
* the gift
|
|
34
|
+
*/
|
|
35
|
+
transfer_star_count?: number;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Optional. Point in time (Unix timestamp) when the gift can be transferred. If it is in the past, then the gift
|
|
39
|
+
* can be transferred now
|
|
40
|
+
*/
|
|
41
|
+
next_transfer_date?: number;
|
|
42
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Sticker } from "./";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## UniqueGiftModel
|
|
5
|
+
* This object describes the model of a unique gift.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#uniquegiftmodel
|
|
7
|
+
*/
|
|
8
|
+
export type UniqueGiftModel = {
|
|
9
|
+
/**
|
|
10
|
+
* Name of the model
|
|
11
|
+
*/
|
|
12
|
+
name: string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The sticker that represents the unique gift
|
|
16
|
+
*/
|
|
17
|
+
sticker: Sticker;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The number of unique gifts that receive this model for every 1000 gifts upgraded
|
|
21
|
+
*/
|
|
22
|
+
rarity_per_mille: number;
|
|
23
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Sticker } from "./";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## UniqueGiftSymbol
|
|
5
|
+
* This object describes the symbol shown on the pattern of a unique gift.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#uniquegiftsymbol
|
|
7
|
+
*/
|
|
8
|
+
export type UniqueGiftSymbol = {
|
|
9
|
+
/**
|
|
10
|
+
* Name of the symbol
|
|
11
|
+
*/
|
|
12
|
+
name: string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The sticker that represents the unique gift
|
|
16
|
+
*/
|
|
17
|
+
sticker: Sticker;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The number of unique gifts that receive this model for every 1000 gifts upgraded
|
|
21
|
+
*/
|
|
22
|
+
rarity_per_mille: number;
|
|
23
|
+
};
|
package/@types/Update.ts
ADDED
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import type { AtMostOne } from "../utils";
|
|
2
|
+
import type {
|
|
3
|
+
BusinessConnection,
|
|
4
|
+
BusinessMessagesDeleted,
|
|
5
|
+
CallbackQuery,
|
|
6
|
+
ChatBoostRemoved,
|
|
7
|
+
ChatBoostUpdated,
|
|
8
|
+
ChatJoinRequest,
|
|
9
|
+
ChatMemberUpdated,
|
|
10
|
+
ChosenInlineResult,
|
|
11
|
+
InlineQuery,
|
|
12
|
+
Message,
|
|
13
|
+
MessageReactionCountUpdated,
|
|
14
|
+
MessageReactionUpdated,
|
|
15
|
+
PaidMediaPurchased,
|
|
16
|
+
Poll,
|
|
17
|
+
PollAnswer,
|
|
18
|
+
PreCheckoutQuery,
|
|
19
|
+
ShippingQuery,
|
|
20
|
+
} from "./";
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* @see https://core.telegram.org/bots/api#update
|
|
24
|
+
*/
|
|
25
|
+
export type EventTypes = {
|
|
26
|
+
/**
|
|
27
|
+
* New incoming message of any kind - text, photo, sticker, etc.
|
|
28
|
+
*/
|
|
29
|
+
message: Message;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* New version of a message that is known to the bot and was edited. This update may at times be triggered by changes
|
|
33
|
+
* to message fields that are either unavailable or not actively used by your bot.
|
|
34
|
+
*/
|
|
35
|
+
edited_message: Message;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* New incoming channel post of any kind - text, photo, sticker, etc.
|
|
39
|
+
*/
|
|
40
|
+
channel_post: Message;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* New version of a channel post that is known to the bot and was edited. This update may at times be triggered by
|
|
44
|
+
* changes to message fields that are either unavailable or not actively used by your bot.
|
|
45
|
+
*/
|
|
46
|
+
edited_channel_post: Message;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* The bot was connected to or disconnected from a business account, or a user edited an existing connection with the
|
|
50
|
+
* bot
|
|
51
|
+
*/
|
|
52
|
+
business_connection: BusinessConnection;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* New message from a connected business account
|
|
56
|
+
*/
|
|
57
|
+
business_message: Message;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* New version of a message from a connected business account
|
|
61
|
+
*/
|
|
62
|
+
edited_business_message: Message;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Messages were deleted from a connected business account
|
|
66
|
+
*/
|
|
67
|
+
deleted_business_messages: BusinessMessagesDeleted;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* A reaction to a message was changed by a user. The bot must be an administrator in the chat and must explicitly
|
|
71
|
+
* specify "message_reaction" in the list of allowed_updates to receive these updates. The update isn't received for
|
|
72
|
+
* reactions set by bots.
|
|
73
|
+
*/
|
|
74
|
+
message_reaction: MessageReactionUpdated;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Reactions to a message with anonymous reactions were changed. The bot must be an administrator in the chat and must
|
|
78
|
+
* explicitly specify "message_reaction_count" in the list of allowed_updates to receive these updates. The updates
|
|
79
|
+
* are grouped and can be sent with delay up to a few minutes.
|
|
80
|
+
*/
|
|
81
|
+
message_reaction_count: MessageReactionCountUpdated;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* New incoming inline query
|
|
85
|
+
*/
|
|
86
|
+
inline_query: InlineQuery;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* The result of an inline query that was chosen by a user and sent to their chat partner. Please see our
|
|
90
|
+
* documentation on the feedback collecting for details on how to enable these updates for your bot.
|
|
91
|
+
*/
|
|
92
|
+
chosen_inline_result: ChosenInlineResult;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* New incoming callback query
|
|
96
|
+
*/
|
|
97
|
+
callback_query: CallbackQuery;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* New incoming shipping query. Only for invoices with flexible price
|
|
101
|
+
*/
|
|
102
|
+
shipping_query: ShippingQuery;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* New incoming pre-checkout query. Contains full information about checkout
|
|
106
|
+
*/
|
|
107
|
+
pre_checkout_query: PreCheckoutQuery;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* A user purchased paid media with a non-empty payload sent by the bot in a non-channel chat
|
|
111
|
+
*/
|
|
112
|
+
purchased_paid_media: PaidMediaPurchased;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* New poll state. Bots receive only updates about manually stopped polls and polls, which are sent by the bot
|
|
116
|
+
*/
|
|
117
|
+
poll: Poll;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* A user changed their answer in a non-anonymous poll. Bots receive new votes only in polls that were sent by the bot
|
|
121
|
+
* itself.
|
|
122
|
+
*/
|
|
123
|
+
poll_answer: PollAnswer;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* The bot's chat member status was updated in a chat. For private chats, this update is received only when the bot is
|
|
127
|
+
* blocked or unblocked by the user.
|
|
128
|
+
*/
|
|
129
|
+
my_chat_member: ChatMemberUpdated;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* A chat member's status was updated in a chat. The bot must be an administrator in the chat and must explicitly
|
|
133
|
+
* specify "chat_member" in the list of allowed_updates to receive these updates.
|
|
134
|
+
*/
|
|
135
|
+
chat_member: ChatMemberUpdated;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* A request to join the chat has been sent. The bot must have the can_invite_users administrator right in the chat to
|
|
139
|
+
* receive these updates.
|
|
140
|
+
*/
|
|
141
|
+
chat_join_request: ChatJoinRequest;
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* A chat boost was added or changed. The bot must be an administrator in the chat to receive these updates.
|
|
145
|
+
*/
|
|
146
|
+
chat_boost: ChatBoostUpdated;
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* A boost was removed from a chat. The bot must be an administrator in the chat to receive these updates.
|
|
150
|
+
*/
|
|
151
|
+
removed_chat_boost: ChatBoostRemoved;
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* All possible update types.
|
|
156
|
+
* @see https://core.telegram.org/bots/api#update
|
|
157
|
+
*/
|
|
158
|
+
export type UpdateType = keyof EventTypes;
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* ## Update
|
|
162
|
+
* This object represents an incoming update.
|
|
163
|
+
* At most one of the optional parameters can be present in any given update.
|
|
164
|
+
* @see https://core.telegram.org/bots/api#update
|
|
165
|
+
*/
|
|
166
|
+
export type Update = {
|
|
167
|
+
/**
|
|
168
|
+
* The update's unique identifier. Update identifiers start from a certain positive number and increase sequentially.
|
|
169
|
+
* This identifier becomes especially handy if you're using [webhooks](https://core.telegram.org/bots/api#setwebhook),
|
|
170
|
+
* since it allows you to ignore repeated updates or to restore the correct update sequence, should they get out of
|
|
171
|
+
* order. If there are no new updates for at least a week, then identifier of the next update will be chosen randomly
|
|
172
|
+
* instead of sequentially.
|
|
173
|
+
*/
|
|
174
|
+
update_id: number;
|
|
175
|
+
} & AtMostOne<{
|
|
176
|
+
[K in UpdateType]: EventTypes[K];
|
|
177
|
+
}>;
|
package/@types/User.ts
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## User
|
|
3
|
+
* This object represents a Telegram user or bot.
|
|
4
|
+
* @see https://core.telegram.org/bots/api#user
|
|
5
|
+
*/
|
|
6
|
+
export type User = {
|
|
7
|
+
/**
|
|
8
|
+
* Unique identifier for this user or bot. This number may have more than 32 significant bits and some programming
|
|
9
|
+
* languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a
|
|
10
|
+
* 64-bit integer or double-precision float type are safe for storing this identifier.
|
|
11
|
+
*/
|
|
12
|
+
id: number;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* True, if this user is a bot
|
|
16
|
+
*/
|
|
17
|
+
is_bot: boolean;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* User's or bot's first name
|
|
21
|
+
*/
|
|
22
|
+
first_name: string;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Optional. User's or bot's last name
|
|
26
|
+
*/
|
|
27
|
+
last_name?: string;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Optional. User's or bot's username
|
|
31
|
+
*/
|
|
32
|
+
username?: string;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Optional. IETF language tag of the user's language
|
|
36
|
+
*/
|
|
37
|
+
language_code?: string;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Optional. True, if this user is a Telegram Premium user
|
|
41
|
+
*/
|
|
42
|
+
is_premium?: boolean;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Optional. True, if this user added the bot to the attachment menu
|
|
46
|
+
*/
|
|
47
|
+
added_to_attachment_menu?: boolean;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Optional. True, if the bot can be invited to groups. Returned only in getMe.
|
|
51
|
+
*/
|
|
52
|
+
can_join_groups?: boolean;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Optional. True, if privacy mode is disabled for the bot. Returned only in getMe.
|
|
56
|
+
*/
|
|
57
|
+
can_read_all_group_messages?: boolean;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Optional. True, if the bot supports inline queries. Returned only in getMe.
|
|
61
|
+
*/
|
|
62
|
+
supports_inline_queries?: boolean;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Optional. True, if the bot can be connected to a Telegram Business account to receive its messages. Returned only
|
|
66
|
+
* in getMe.
|
|
67
|
+
*/
|
|
68
|
+
can_connect_to_business?: boolean;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Optional. True, if the bot has a main Web App. Returned only in getMe.
|
|
72
|
+
*/
|
|
73
|
+
has_main_web_app?: boolean;
|
|
74
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { PhotoSize } from "./";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## UserProfilePhotos
|
|
5
|
+
* This object represent a user's profile pictures.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#userprofilephotos
|
|
7
|
+
*/
|
|
8
|
+
export type UserProfilePhotos = {
|
|
9
|
+
/**
|
|
10
|
+
* Total number of profile pictures the target user has
|
|
11
|
+
*/
|
|
12
|
+
total_count: number;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Requested profile pictures (in up to 4 sizes each)
|
|
16
|
+
*/
|
|
17
|
+
photos: PhotoSize[][];
|
|
18
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { SharedUser } from "./";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## UsersShared
|
|
5
|
+
* This object contains information about the users whose identifiers were shared with the bot using a
|
|
6
|
+
* KeyboardButtonRequestUsers button.
|
|
7
|
+
* @see https://core.telegram.org/bots/api#usersshared
|
|
8
|
+
*/
|
|
9
|
+
export type UsersShared = {
|
|
10
|
+
/**
|
|
11
|
+
* Identifier of the request
|
|
12
|
+
*/
|
|
13
|
+
request_id: number;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Information about users shared with the bot.
|
|
17
|
+
*/
|
|
18
|
+
users: SharedUser[];
|
|
19
|
+
};
|
package/@types/Venue.ts
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { Location } from "./";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## Venue
|
|
5
|
+
* This object represents a venue.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#venue
|
|
7
|
+
*/
|
|
8
|
+
export type Venue = {
|
|
9
|
+
/**
|
|
10
|
+
* Venue location. Can't be a live location
|
|
11
|
+
*/
|
|
12
|
+
location: Location;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Name of the venue
|
|
16
|
+
*/
|
|
17
|
+
title: string;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Address of the venue
|
|
21
|
+
*/
|
|
22
|
+
address: string;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Optional. Foursquare identifier of the venue
|
|
26
|
+
*/
|
|
27
|
+
foursquare_id?: string;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Optional. Foursquare identifier of the venue
|
|
31
|
+
*/
|
|
32
|
+
foursquare_type?: string;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Optional. Foursquare type of the venue. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium”
|
|
36
|
+
* or “food/icecream”.)
|
|
37
|
+
*/
|
|
38
|
+
google_place_id?: string;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Optional. Google Places identifier of the venue
|
|
42
|
+
*/
|
|
43
|
+
google_place_type?: string;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Optional. Google Places type of the venue. (See supported types.)
|
|
47
|
+
*/
|
|
48
|
+
};
|
package/@types/Video.ts
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { PhotoSize } from "./";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## Video
|
|
5
|
+
* This object represents a video file.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#video
|
|
7
|
+
*/
|
|
8
|
+
export type Video = {
|
|
9
|
+
/**
|
|
10
|
+
* Identifier for this file, which can be used to download or reuse the file
|
|
11
|
+
*/
|
|
12
|
+
file_id: string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used
|
|
16
|
+
* to download or reuse the file.
|
|
17
|
+
*/
|
|
18
|
+
file_unique_id: string;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Video width as defined by the sender
|
|
22
|
+
*/
|
|
23
|
+
width: number;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Video height as defined by the sender
|
|
27
|
+
*/
|
|
28
|
+
height: number;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Duration of the video in seconds as defined by the sender
|
|
32
|
+
*/
|
|
33
|
+
duration: number;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Optional. Video thumbnail
|
|
37
|
+
*/
|
|
38
|
+
thumbnail?: PhotoSize;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Optional. Available sizes of the cover of the video in the message
|
|
42
|
+
*/
|
|
43
|
+
cover?: PhotoSize[];
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Optional. Timestamp in seconds from which the video will play in the message
|
|
47
|
+
*/
|
|
48
|
+
start_timestamp?: number;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Optional. Original filename as defined by the sender
|
|
52
|
+
*/
|
|
53
|
+
file_name?: string;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Optional. MIME type of the file as defined by the sender
|
|
57
|
+
*/
|
|
58
|
+
mime_type?: string;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent
|
|
62
|
+
* defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision
|
|
63
|
+
* float type are safe for storing this value.
|
|
64
|
+
*/
|
|
65
|
+
file_size?: number;
|
|
66
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## VideoChatEnded
|
|
3
|
+
* This object represents a service message about a video chat ended in the chat.
|
|
4
|
+
* @see https://core.telegram.org/bots/api#videochatended
|
|
5
|
+
*/
|
|
6
|
+
export type VideoChatEnded = {
|
|
7
|
+
/**
|
|
8
|
+
* Video chat duration in seconds
|
|
9
|
+
*/
|
|
10
|
+
duration: number;
|
|
11
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { User } from "./";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## VideoChatParticipantsInvited
|
|
5
|
+
* This object represents a service message about new members invited to a video chat.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#videochatparticipantsinvited
|
|
7
|
+
*/
|
|
8
|
+
export type VideoChatParticipantsInvited = {
|
|
9
|
+
/**
|
|
10
|
+
* New members that were invited to the video chat
|
|
11
|
+
*/
|
|
12
|
+
users: User[];
|
|
13
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## VideoChatScheduled
|
|
3
|
+
* This object represents a service message about a video chat scheduled in the chat.
|
|
4
|
+
* @see https://core.telegram.org/bots/api#videochatscheduled
|
|
5
|
+
*/
|
|
6
|
+
export type VideoChatScheduled = {
|
|
7
|
+
/**
|
|
8
|
+
* Point in time (Unix timestamp) when the video chat is supposed to be started by a chat administrator
|
|
9
|
+
*/
|
|
10
|
+
start_date: number;
|
|
11
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { PhotoSize } from "./";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## VideoNote
|
|
5
|
+
* This object represents a video message (available in Telegram apps as of v.4.0).
|
|
6
|
+
* @see https://core.telegram.org/bots/api#videonote
|
|
7
|
+
*/
|
|
8
|
+
export type VideoNote = {
|
|
9
|
+
/**
|
|
10
|
+
* Identifier for this file, which can be used to download or reuse the file
|
|
11
|
+
*/
|
|
12
|
+
file_id: string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used
|
|
16
|
+
* to download or reuse the file.
|
|
17
|
+
*/
|
|
18
|
+
file_unique_id: string;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Video width and height (diameter of the video message) as defined by the sender
|
|
22
|
+
*/
|
|
23
|
+
length: number;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Duration of the video in seconds as defined by the sender
|
|
27
|
+
*/
|
|
28
|
+
duration: number;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Optional. Video thumbnail
|
|
32
|
+
*/
|
|
33
|
+
thumbnail?: PhotoSize;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Optional. File size in bytes
|
|
37
|
+
*/
|
|
38
|
+
file_size?: number;
|
|
39
|
+
};
|
package/@types/Voice.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## Voice
|
|
3
|
+
* This object represents a voice note.
|
|
4
|
+
* @see https://core.telegram.org/bots/api#voice
|
|
5
|
+
*/
|
|
6
|
+
export type Voice = {
|
|
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
|
+
* Duration of the audio in seconds as defined by the sender
|
|
20
|
+
*/
|
|
21
|
+
duration: number;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Optional. MIME type of the file as defined by the sender
|
|
25
|
+
*/
|
|
26
|
+
mime_type?: string;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent
|
|
30
|
+
* defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision
|
|
31
|
+
* float type are safe for storing this value.
|
|
32
|
+
*/
|
|
33
|
+
file_size?: number;
|
|
34
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## WebAppData
|
|
3
|
+
* Describes data sent from a Web App to the bot.
|
|
4
|
+
* @see https://core.telegram.org/bots/api#webappdata
|
|
5
|
+
*/
|
|
6
|
+
export type WebAppData = {
|
|
7
|
+
/**
|
|
8
|
+
* The data. Be aware that a bad client can send arbitrary data in this field.
|
|
9
|
+
*/
|
|
10
|
+
data: string;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Text of the web_app keyboard button from which the Web App was opened. Be aware that a bad client can send
|
|
14
|
+
* arbitrary data in this field.
|
|
15
|
+
*/
|
|
16
|
+
button_text: string;
|
|
17
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## WebAppInfo
|
|
3
|
+
* Describes a Web App.
|
|
4
|
+
* @see https://core.telegram.org/bots/api#webappinfo
|
|
5
|
+
*/
|
|
6
|
+
export type WebAppInfo = {
|
|
7
|
+
/**
|
|
8
|
+
* An HTTPS URL of a Web App to be opened with additional data as specified in Initializing Web Apps
|
|
9
|
+
*/
|
|
10
|
+
url: string;
|
|
11
|
+
};
|