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,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## BusinessBotRights
|
|
3
|
+
* Represents the rights of a business bot.
|
|
4
|
+
* @see https://core.telegram.org/bots/api#businessbotrights
|
|
5
|
+
*/
|
|
6
|
+
export type BusinessBotRights = {
|
|
7
|
+
/**
|
|
8
|
+
* Optional. True, if the bot can send and edit messages in the private chats
|
|
9
|
+
* that had incoming messages in the last 24 hours
|
|
10
|
+
*/
|
|
11
|
+
can_reply?: true;
|
|
12
|
+
/**
|
|
13
|
+
* Optional. True, if the bot can mark incoming private messages as read
|
|
14
|
+
*/
|
|
15
|
+
can_read_messages?: true;
|
|
16
|
+
/**
|
|
17
|
+
* Optional. True, if the bot can delete messages sent by the bot
|
|
18
|
+
*/
|
|
19
|
+
can_delete_sent_messages?: true;
|
|
20
|
+
/**
|
|
21
|
+
* Optional. True, if the bot can delete all private messages in managed chats
|
|
22
|
+
*/
|
|
23
|
+
can_delete_all_messages?: true;
|
|
24
|
+
/**
|
|
25
|
+
* Optional. True, if the bot can edit the first and last name of the business account
|
|
26
|
+
*/
|
|
27
|
+
can_edit_name?: true;
|
|
28
|
+
/**
|
|
29
|
+
* Optional. True, if the bot can edit the bio of the business account
|
|
30
|
+
*/
|
|
31
|
+
can_edit_bio?: true;
|
|
32
|
+
/**
|
|
33
|
+
* Optional. True, if the bot can edit the profile photo of the business account
|
|
34
|
+
*/
|
|
35
|
+
can_edit_profile_photo?: true;
|
|
36
|
+
/**
|
|
37
|
+
* Optional. True, if the bot can edit the username of the business account
|
|
38
|
+
*/
|
|
39
|
+
can_edit_username?: true;
|
|
40
|
+
/**
|
|
41
|
+
* Optional. True, if the bot can change the privacy settings pertaining to gifts for the business account
|
|
42
|
+
*/
|
|
43
|
+
can_change_gift_settings?: true;
|
|
44
|
+
/**
|
|
45
|
+
* Optional. True, if the bot can view gifts and the amount of Telegram Stars owned by the business account
|
|
46
|
+
*/
|
|
47
|
+
can_view_gifts_and_stars?: true;
|
|
48
|
+
/**
|
|
49
|
+
* Optional. True, if the bot can convert regular gifts owned by the business account to Telegram Stars
|
|
50
|
+
*/
|
|
51
|
+
can_convert_gifts_to_stars?: true;
|
|
52
|
+
/**
|
|
53
|
+
* Optional. True, if the bot can transfer and upgrade gifts owned by the business account
|
|
54
|
+
*/
|
|
55
|
+
can_transfer_and_upgrade_gifts?: true;
|
|
56
|
+
/**
|
|
57
|
+
* Optional. True, if the bot can transfer Telegram Stars received by the
|
|
58
|
+
* business account to its own account, or use them to upgrade and transfer gifts
|
|
59
|
+
*/
|
|
60
|
+
can_transfer_stars?: true;
|
|
61
|
+
/**
|
|
62
|
+
* Optional. True, if the bot can post, edit and delete stories on behalf of the business account
|
|
63
|
+
*/
|
|
64
|
+
can_manage_stories?: true;
|
|
65
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { BusinessBotRights, User } from "./";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## BusinessConnection
|
|
5
|
+
* Describes the connection of the bot with a business account.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#businessconnection
|
|
7
|
+
*/
|
|
8
|
+
export type BusinessConnection = {
|
|
9
|
+
/**
|
|
10
|
+
* Unique identifier of the business connection
|
|
11
|
+
*/
|
|
12
|
+
id: string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Business account user that created the business connection
|
|
16
|
+
*/
|
|
17
|
+
user: User;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Identifier of a private chat with the user who created the business connection. This number may have more than 32
|
|
21
|
+
* significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has
|
|
22
|
+
* at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this
|
|
23
|
+
* identifier.
|
|
24
|
+
*/
|
|
25
|
+
user_chat_id: number;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Date the connection was established in Unix time
|
|
29
|
+
*/
|
|
30
|
+
date: number;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Optional. Rights of the business bot
|
|
34
|
+
*/
|
|
35
|
+
rights?: BusinessBotRights;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* True, if the connection is active
|
|
39
|
+
*/
|
|
40
|
+
is_enabled: boolean;
|
|
41
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Sticker } from "./";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## BusinessIntro
|
|
5
|
+
* Contains information about the start page settings of a Telegram Business account.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#businessintro
|
|
7
|
+
*/
|
|
8
|
+
export type BusinessIntro = {
|
|
9
|
+
/**
|
|
10
|
+
* Optional. Title text of the business intro
|
|
11
|
+
*/
|
|
12
|
+
title?: string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Optional. Message text of the business intro
|
|
16
|
+
*/
|
|
17
|
+
message?: string;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Optional. Sticker of the business intro
|
|
21
|
+
*/
|
|
22
|
+
sticker?: Sticker;
|
|
23
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Location } from "./";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## BusinessLocation
|
|
5
|
+
* Contains information about the location of a Telegram Business account.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#businesslocation
|
|
7
|
+
*/
|
|
8
|
+
export type BusinessLocation = {
|
|
9
|
+
/**
|
|
10
|
+
* Address of the business
|
|
11
|
+
*/
|
|
12
|
+
address: string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Optional. Location of the business
|
|
16
|
+
*/
|
|
17
|
+
location?: Location;
|
|
18
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Chat } from "./";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## BusinessMessagesDeleted
|
|
5
|
+
* This object is received when messages are deleted from a connected business account.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#businessmessagesdeleted
|
|
7
|
+
*/
|
|
8
|
+
export type BusinessMessagesDeleted = {
|
|
9
|
+
/**
|
|
10
|
+
* Unique identifier of the business connection
|
|
11
|
+
*/
|
|
12
|
+
business_connection_id: string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Information about a chat in the business account. The bot may not have access to the chat or the corresponding
|
|
16
|
+
* user.
|
|
17
|
+
*/
|
|
18
|
+
chat: Chat;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The list of identifiers of deleted messages in the chat of the business account
|
|
22
|
+
*/
|
|
23
|
+
message_ids: number[];
|
|
24
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { BusinessOpeningHoursInterval } from "./";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## BusinessOpeningHours
|
|
5
|
+
* Describes the opening hours of a business.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#businessopeninghours
|
|
7
|
+
*/
|
|
8
|
+
export type BusinessOpeningHours = {
|
|
9
|
+
/**
|
|
10
|
+
* Unique name of the time zone for which the opening hours are defined
|
|
11
|
+
*/
|
|
12
|
+
time_zone_name: string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* List of time intervals describing business opening hours
|
|
16
|
+
*/
|
|
17
|
+
opening_hours: BusinessOpeningHoursInterval[];
|
|
18
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## BusinessOpeningHoursInterval
|
|
3
|
+
* Describes an interval of time during which a business is open.
|
|
4
|
+
* @see https://core.telegram.org/bots/api#businessopeninghoursinterval
|
|
5
|
+
*/
|
|
6
|
+
export type BusinessOpeningHoursInterval = {
|
|
7
|
+
/**
|
|
8
|
+
* The minute's sequence number in a week, starting on Monday, marking the start of the time interval during which the
|
|
9
|
+
* business is open; 0 - 7 * 24 * 60
|
|
10
|
+
*/
|
|
11
|
+
opening_minute: number;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The minute's sequence number in a week, starting on Monday, marking the end of the time interval during which the
|
|
15
|
+
* business is open; 0 - 8 * 24 * 60
|
|
16
|
+
*/
|
|
17
|
+
closing_minute: number;
|
|
18
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { MaybeInaccessibleMessage, User } from "./";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## answerCallbackQuery
|
|
5
|
+
* Use this method to send answers to callback queries sent from inline keyboards. The answer will be displayed to the
|
|
6
|
+
* user as a notification at the top of the chat screen or as an alert. On success, True is returned.
|
|
7
|
+
* > Alternatively, the user can be redirected to the specified Game URL. For this option to work, you must first create
|
|
8
|
+
* a game for your bot via @BotFather and accept the terms. Otherwise, you may use links like `t.me/your_bot?start=XXXX`
|
|
9
|
+
* that open your bot with a parameter.
|
|
10
|
+
* @see https://core.telegram.org/bots/api#callbackquery
|
|
11
|
+
*/
|
|
12
|
+
export type CallbackQuery = {
|
|
13
|
+
/**
|
|
14
|
+
* Unique identifier for this query
|
|
15
|
+
*/
|
|
16
|
+
id: string;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Sender
|
|
20
|
+
*/
|
|
21
|
+
from: User;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Optional. Message sent by the bot with the callback button that originated the query
|
|
25
|
+
*/
|
|
26
|
+
message?: MaybeInaccessibleMessage;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Optional. Identifier of the message sent via the bot in inline mode, that originated the query.
|
|
30
|
+
*/
|
|
31
|
+
inline_message_id?: string;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Global identifier, uniquely corresponding to the chat to which the message with the callback button was sent.
|
|
35
|
+
* Useful for high scores in games.
|
|
36
|
+
*/
|
|
37
|
+
chat_instance: string;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Optional. Data associated with the callback button. Be aware that the message originated the query can contain no
|
|
41
|
+
* callback buttons with this data.
|
|
42
|
+
*/
|
|
43
|
+
data?: string;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Optional. Short name of a Game to be returned, serves as the unique identifier for the game
|
|
47
|
+
*/
|
|
48
|
+
game_short_name?: string;
|
|
49
|
+
};
|
package/@types/Chat.ts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## Chat
|
|
3
|
+
* This object represents a chat.
|
|
4
|
+
* @see https://core.telegram.org/bots/api#chat
|
|
5
|
+
*/
|
|
6
|
+
export type Chat = {
|
|
7
|
+
/**
|
|
8
|
+
* Unique identifier for this chat. This number may have more than 32 significant bits and some programming languages
|
|
9
|
+
* may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit
|
|
10
|
+
* integer or double-precision float type are safe for storing this identifier.
|
|
11
|
+
*/
|
|
12
|
+
id: number;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Type of the chat, can be either “private”, “group”, “supergroup” or “channel”
|
|
16
|
+
*/
|
|
17
|
+
type: string;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Optional. Title, for supergroups, channels and group chats
|
|
21
|
+
*/
|
|
22
|
+
title?: string;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Optional. Username, for private chats, supergroups and channels if available
|
|
26
|
+
*/
|
|
27
|
+
username?: string;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Optional. First name of the other party in a private chat
|
|
31
|
+
*/
|
|
32
|
+
first_name?: string;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Optional. Last name of the other party in a private chat
|
|
36
|
+
*/
|
|
37
|
+
last_name?: string;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Optional. True, if the supergroup chat is a forum (has topics enabled)
|
|
41
|
+
*/
|
|
42
|
+
is_forum?: boolean;
|
|
43
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## ChatAdministratorRights
|
|
3
|
+
* Represents the rights of an administrator in a chat.
|
|
4
|
+
* @see https://core.telegram.org/bots/api#chatadministratorrights
|
|
5
|
+
*/
|
|
6
|
+
export type ChatAdministratorRights = {
|
|
7
|
+
/**
|
|
8
|
+
* True, if the user's presence in the chat is hidden
|
|
9
|
+
*/
|
|
10
|
+
is_anonymous: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* True, if the administrator can access the chat event log, get boost list, see hidden supergroup and channel
|
|
13
|
+
* members, report spam messages and ignore slow mode. Implied by any other administrator privilege.
|
|
14
|
+
*/
|
|
15
|
+
can_manage_chat: boolean;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* True, if the administrator can delete messages of other users
|
|
19
|
+
*/
|
|
20
|
+
can_delete_messages: boolean;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* True, if the administrator can manage video chats
|
|
24
|
+
*/
|
|
25
|
+
can_manage_video_chats: boolean;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* True, if the administrator can restrict, ban or unban chat members, or access supergroup statistics
|
|
29
|
+
*/
|
|
30
|
+
can_restrict_members: boolean;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* True, if the administrator can add new administrators with a subset of their own privileges or demote
|
|
34
|
+
* administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by
|
|
35
|
+
* the user)
|
|
36
|
+
*/
|
|
37
|
+
can_promote_members: boolean;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* True, if the user is allowed to change the chat title, photo and other settings
|
|
41
|
+
*/
|
|
42
|
+
can_change_info: boolean;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* True, if the user is allowed to invite new users to the chat
|
|
46
|
+
*/
|
|
47
|
+
can_invite_users: boolean;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* True, if the administrator can post stories to the chat
|
|
51
|
+
*/
|
|
52
|
+
can_post_stories: boolean;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* True, if the administrator can edit stories posted by other users, post stories to the chat page, pin chat
|
|
56
|
+
* stories, and access the chat's story archive
|
|
57
|
+
*/
|
|
58
|
+
can_edit_stories: boolean;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* True, if the administrator can delete stories posted by other users
|
|
62
|
+
*/
|
|
63
|
+
can_delete_stories: boolean;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* True, if the administrator can post messages in the channel, or access channel statistics; for channels only
|
|
67
|
+
*/
|
|
68
|
+
can_post_messages?: boolean;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Optional. True, if the administrator can edit messages of other users and can pin messages; for channels only
|
|
72
|
+
*/
|
|
73
|
+
can_edit_messages?: boolean;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Optional. True, if the user is allowed to pin messages; for groups and supergroups only
|
|
77
|
+
*/
|
|
78
|
+
can_pin_messages?: boolean;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Optional. True, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only
|
|
82
|
+
*/
|
|
83
|
+
can_manage_topics?: boolean;
|
|
84
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { BackgroundType } from "./";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## ChatBackground
|
|
5
|
+
* This object represents a chat background.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#chatbackground
|
|
7
|
+
*/
|
|
8
|
+
export type ChatBackground = {
|
|
9
|
+
/**
|
|
10
|
+
* Type of the background
|
|
11
|
+
*/
|
|
12
|
+
type: BackgroundType;
|
|
13
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ChatBoostSource } from "./";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## ChatBoost
|
|
5
|
+
* This object contains information about a chat boost.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#chatboost
|
|
7
|
+
*/
|
|
8
|
+
export type ChatBoost = {
|
|
9
|
+
/**
|
|
10
|
+
* Unique identifier of the boost
|
|
11
|
+
*/
|
|
12
|
+
boost_id: string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Point in time (Unix timestamp) when the chat was boosted
|
|
16
|
+
*/
|
|
17
|
+
add_date: number;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Point in time (Unix timestamp) when the boost will automatically expire, unless the booster's Telegram Premium
|
|
21
|
+
* subscription is prolonged
|
|
22
|
+
*/
|
|
23
|
+
expiration_date: number;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Source of the added boost
|
|
27
|
+
*/
|
|
28
|
+
source: ChatBoostSource;
|
|
29
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## ChatBoostAdded
|
|
3
|
+
* This object contains information about a chat boost.
|
|
4
|
+
* @see https://core.telegram.org/bots/api#chatboostadded
|
|
5
|
+
*/
|
|
6
|
+
export type ChatBoostAdded = {
|
|
7
|
+
/**
|
|
8
|
+
* Number of boosts added by the user
|
|
9
|
+
*/
|
|
10
|
+
boost_count: number;
|
|
11
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Chat, ChatBoostSource } from "./";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## ChatBoostRemoved
|
|
5
|
+
* This object represents a boost removed from a chat.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#chatboostremoved
|
|
7
|
+
*/
|
|
8
|
+
export type ChatBoostRemoved = {
|
|
9
|
+
/**
|
|
10
|
+
* Chat which was boosted
|
|
11
|
+
*/
|
|
12
|
+
chat: Chat;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Unique identifier of the boost
|
|
16
|
+
*/
|
|
17
|
+
boost_id: string;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Point in time (Unix timestamp) when the boost was removed
|
|
21
|
+
*/
|
|
22
|
+
remove_date: number;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Source of the removed boost
|
|
26
|
+
*/
|
|
27
|
+
source: ChatBoostSource;
|
|
28
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ChatBoostSourceGiftCode,
|
|
3
|
+
ChatBoostSourceGiveaway,
|
|
4
|
+
ChatBoostSourcePremium,
|
|
5
|
+
} from "./";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* ## ChatBoostSource
|
|
9
|
+
* This object describes the source of a chat boost. It can be one of
|
|
10
|
+
* - ChatBoostSourcePremium
|
|
11
|
+
* - ChatBoostSourceGiftCode
|
|
12
|
+
* - ChatBoostSourceGiveaway
|
|
13
|
+
* @see https://core.telegram.org/bots/api#chatboostsource
|
|
14
|
+
*/
|
|
15
|
+
export type ChatBoostSource =
|
|
16
|
+
| ChatBoostSourcePremium
|
|
17
|
+
| ChatBoostSourceGiftCode
|
|
18
|
+
| ChatBoostSourceGiveaway;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { User } from "./";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## ChatBoostSourceGiftCode
|
|
5
|
+
* The boost was obtained by the creation of Telegram Premium gift codes to boost a chat. Each such code boosts the chat
|
|
6
|
+
* 4 times for the duration of the corresponding Telegram Premium subscription.
|
|
7
|
+
* @see https://core.telegram.org/bots/api#chatboostsourcegiftcode
|
|
8
|
+
*/
|
|
9
|
+
export type ChatBoostSourceGiftCode = {
|
|
10
|
+
/**
|
|
11
|
+
* Source of the boost, always “gift_code”
|
|
12
|
+
*/
|
|
13
|
+
source: "gift_code";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* User for which the gift code was created
|
|
17
|
+
*/
|
|
18
|
+
user: User;
|
|
19
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { User } from "./";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## ChatBoostSourceGiveaway
|
|
5
|
+
* The boost was obtained by the creation of a Telegram Premium giveaway. This boosts the chat 4 times for the duration
|
|
6
|
+
* of the corresponding Telegram Premium subscription.
|
|
7
|
+
* @see https://core.telegram.org/bots/api#chatboostsourcegiveaway
|
|
8
|
+
*/
|
|
9
|
+
export type ChatBoostSourceGiveaway = {
|
|
10
|
+
/**
|
|
11
|
+
* Source of the boost, always “giveaway”
|
|
12
|
+
*/
|
|
13
|
+
source: "giveaway";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Identifier of a message in the chat with the giveaway; the message could have been deleted already. May be 0 if
|
|
17
|
+
* the message isn't sent yet.
|
|
18
|
+
*/
|
|
19
|
+
giveaway_message_id: number;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Optional. User that won the prize in the giveaway if any
|
|
23
|
+
*/
|
|
24
|
+
user?: User;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Optional. The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only
|
|
28
|
+
*/
|
|
29
|
+
prize_star_count?: number;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Optional. True, if the giveaway was completed, but there was no user to win the prize
|
|
33
|
+
*/
|
|
34
|
+
is_unclaimed?: boolean;
|
|
35
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { User } from "./";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## ChatBoostSourcePremium
|
|
5
|
+
* The boost was obtained by subscribing to Telegram Premium or by gifting a Telegram Premium subscription to another
|
|
6
|
+
* user.
|
|
7
|
+
* @see https://core.telegram.org/bots/api#chatboostsourcepremium
|
|
8
|
+
*/
|
|
9
|
+
export type ChatBoostSourcePremium = {
|
|
10
|
+
/**
|
|
11
|
+
* Source of the boost, always “premium”
|
|
12
|
+
*/
|
|
13
|
+
source: "premium";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* User that boosted the chat
|
|
17
|
+
*/
|
|
18
|
+
user: User;
|
|
19
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Chat, ChatBoost } from "./";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## ChatBoostUpdated
|
|
5
|
+
* This object represents a boost added to a chat or changed.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#chatboostupdated
|
|
7
|
+
*/
|
|
8
|
+
export type ChatBoostUpdated = {
|
|
9
|
+
/**
|
|
10
|
+
* Chat which was boosted
|
|
11
|
+
*/
|
|
12
|
+
chat: Chat;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Information about the chat boost
|
|
16
|
+
*/
|
|
17
|
+
boost: ChatBoost;
|
|
18
|
+
};
|