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,92 @@
|
|
|
1
|
+
const emojis = [
|
|
2
|
+
"👍",
|
|
3
|
+
"👎",
|
|
4
|
+
"❤",
|
|
5
|
+
"🔥",
|
|
6
|
+
"🥰",
|
|
7
|
+
"👏",
|
|
8
|
+
"😁",
|
|
9
|
+
"🤔",
|
|
10
|
+
"🤯",
|
|
11
|
+
"😱",
|
|
12
|
+
"🤬",
|
|
13
|
+
"😢",
|
|
14
|
+
"🎉",
|
|
15
|
+
"🤩",
|
|
16
|
+
"🤮",
|
|
17
|
+
"💩",
|
|
18
|
+
"🙏",
|
|
19
|
+
"👌",
|
|
20
|
+
"🕊",
|
|
21
|
+
"🤡",
|
|
22
|
+
"🥱",
|
|
23
|
+
"🥴",
|
|
24
|
+
"😍",
|
|
25
|
+
"🐳",
|
|
26
|
+
"❤🔥",
|
|
27
|
+
"🌚",
|
|
28
|
+
"🌭",
|
|
29
|
+
"💯",
|
|
30
|
+
"🤣",
|
|
31
|
+
"⚡",
|
|
32
|
+
"🍌",
|
|
33
|
+
"🏆",
|
|
34
|
+
"💔",
|
|
35
|
+
"🤨",
|
|
36
|
+
"😐",
|
|
37
|
+
"🍓",
|
|
38
|
+
"🍾",
|
|
39
|
+
"💋",
|
|
40
|
+
"🖕",
|
|
41
|
+
"😈",
|
|
42
|
+
"😴",
|
|
43
|
+
"😭",
|
|
44
|
+
"🤓",
|
|
45
|
+
"👻",
|
|
46
|
+
"👨💻",
|
|
47
|
+
"👀",
|
|
48
|
+
"🎃",
|
|
49
|
+
"🙈",
|
|
50
|
+
"😇",
|
|
51
|
+
"😨",
|
|
52
|
+
"🤝",
|
|
53
|
+
"✍",
|
|
54
|
+
"🤗",
|
|
55
|
+
"🫡",
|
|
56
|
+
"🎅",
|
|
57
|
+
"🎄",
|
|
58
|
+
"☃",
|
|
59
|
+
"💅",
|
|
60
|
+
"🤪",
|
|
61
|
+
"🗿",
|
|
62
|
+
"🆒",
|
|
63
|
+
"💘",
|
|
64
|
+
"🙉",
|
|
65
|
+
"🦄",
|
|
66
|
+
"😘",
|
|
67
|
+
"💊",
|
|
68
|
+
"🙊",
|
|
69
|
+
"😎",
|
|
70
|
+
"👾",
|
|
71
|
+
"🤷♂",
|
|
72
|
+
"🤷",
|
|
73
|
+
"🤷♀",
|
|
74
|
+
"😡",
|
|
75
|
+
] as const;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* ## ReactionTypeEmoji
|
|
79
|
+
* The reaction is based on an emoji.
|
|
80
|
+
* @see https://core.telegram.org/bots/api#reactiontypeemoji
|
|
81
|
+
*/
|
|
82
|
+
export type ReactionTypeEmoji = {
|
|
83
|
+
/**
|
|
84
|
+
* Type of the reaction, always “emoji”
|
|
85
|
+
*/
|
|
86
|
+
type: "emoji";
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Reaction emoji. Currently, it can be one of "👍", "👎" ...
|
|
90
|
+
*/
|
|
91
|
+
emoji: (typeof emojis)[number] | string;
|
|
92
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Currencies } from "./index";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## RefundedPayment
|
|
5
|
+
* This object contains basic information about a refunded payment.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#refundedpayment
|
|
7
|
+
*/
|
|
8
|
+
export type RefundedPayment = {
|
|
9
|
+
/**
|
|
10
|
+
* Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars. Currently, always “XTR”
|
|
11
|
+
*/
|
|
12
|
+
currency: Currencies | "XTR";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Total refunded price in the smallest units of the currency (integer, not float/double). For example, for a price
|
|
16
|
+
* of US$ 1.45, total_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the
|
|
17
|
+
* decimal point for each currency (2 for the majority of currencies).
|
|
18
|
+
*/
|
|
19
|
+
total_amount: number;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Bot-specified invoice payload
|
|
23
|
+
*/
|
|
24
|
+
invoice_payload: string;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Telegram payment identifier
|
|
28
|
+
*/
|
|
29
|
+
telegram_payment_charge_id: string;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Optional. Provider payment identifier
|
|
33
|
+
*/
|
|
34
|
+
provider_payment_charge_id?: string;
|
|
35
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { KeyboardButton } from "./KeyboardButton";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## ReplyKeyboardMarkup
|
|
5
|
+
* This object represents a custom keyboard with reply options (see Introduction to bots for details and examples). Not
|
|
6
|
+
* supported in channels and for messages sent on behalf of a Telegram Business account.
|
|
7
|
+
* @see https://core.telegram.org/bots/api#replykeyboardmarkup
|
|
8
|
+
*/
|
|
9
|
+
export type ReplyKeyboardMarkup = {
|
|
10
|
+
/**
|
|
11
|
+
* Array of button rows, each represented by an Array of KeyboardButton objects
|
|
12
|
+
*/
|
|
13
|
+
keyboard?: KeyboardButton[][];
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Optional. Requests clients to always show the keyboard when the regular keyboard is hidden. Defaults to false, in
|
|
17
|
+
* which case the custom keyboard can be hidden and opened with a keyboard icon.
|
|
18
|
+
*/
|
|
19
|
+
is_persistent?: boolean;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Optional. Requests clients to resize the keyboard vertically for optimal fit (e.g., make the keyboard smaller if
|
|
23
|
+
* there are just two rows of buttons). Defaults to false, in which case the custom keyboard is always of the same
|
|
24
|
+
* height as the app's standard keyboard.
|
|
25
|
+
*/
|
|
26
|
+
resize_keyboard?: boolean;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Optional. Requests clients to hide the keyboard as soon as it's been used. The keyboard will still be available,
|
|
30
|
+
* but clients will automatically display the usual letter-keyboard in the chat - the user can press a special button
|
|
31
|
+
* in the input field to see the custom keyboard again. Defaults to false.
|
|
32
|
+
*/
|
|
33
|
+
one_time_keyboard?: boolean;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Optional. The placeholder to be shown in the input field when the keyboard is active; 1-64 characters
|
|
37
|
+
*/
|
|
38
|
+
input_field_placeholder?: string;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Optional. Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that
|
|
42
|
+
* are @mentioned in the text of the Message object; 2) if the bot's message is a reply to a message in the same chat
|
|
43
|
+
* and forum topic, sender of the original message.
|
|
44
|
+
*
|
|
45
|
+
* Example: A user requests to change the bot's language, bot replies to the request with a keyboard to select the
|
|
46
|
+
* new language. Other users in the group don't see the keyboard.
|
|
47
|
+
*/
|
|
48
|
+
selective?: boolean;
|
|
49
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## ReplyKeyboardRemove
|
|
3
|
+
* Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the
|
|
4
|
+
* default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An
|
|
5
|
+
* exception is made for one-time keyboards that are hidden immediately after the user presses a button (see
|
|
6
|
+
* ReplyKeyboardMarkup). Not supported in channels and for messages sent on behalf of a Telegram Business account.
|
|
7
|
+
* @see https://core.telegram.org/bots/api#replykeyboardremove
|
|
8
|
+
*/
|
|
9
|
+
export type ReplyKeyboardRemove = {
|
|
10
|
+
/**
|
|
11
|
+
* Requests clients to remove the custom keyboard (user will not be able to summon this keyboard; if you want to hide
|
|
12
|
+
* the keyboard from sight but keep it accessible, use one_time_keyboard in ReplyKeyboardMarkup)
|
|
13
|
+
*/
|
|
14
|
+
remove_keyboard: true;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Optional. Use this parameter if you want to remove the keyboard for specific users only. Targets: 1) users that
|
|
18
|
+
* are @mentioned in the text of the Message object; 2) if the bot's message is a reply to a message in the same chat
|
|
19
|
+
* and forum topic, sender of the original message.
|
|
20
|
+
*
|
|
21
|
+
* Example: A user votes in a poll, bot returns confirmation message in reply to the vote and removes the keyboard for
|
|
22
|
+
* that user, while still showing the keyboard with poll options to users who haven't voted yet.
|
|
23
|
+
*/
|
|
24
|
+
selective?: boolean;
|
|
25
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { ParseMode } from "./index";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## ReplyParameters
|
|
5
|
+
* Describes reply parameters for the message that is being sent.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#replyparameters
|
|
7
|
+
*/
|
|
8
|
+
export type ReplyParameters = {
|
|
9
|
+
/**
|
|
10
|
+
* Identifier of the message that will be replied to in the current chat, or in the chat chat_id if it is specified
|
|
11
|
+
*/
|
|
12
|
+
message_id: number;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Optional. If the message to be replied to is from a different chat, unique identifier for the chat or username of
|
|
16
|
+
* the channel (in the format @channelusername). Not supported for messages sent on behalf of a business account.
|
|
17
|
+
*/
|
|
18
|
+
chat_id?: number | string;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Optional. Pass True if the message should be sent even if the specified message to be replied to is not found.
|
|
22
|
+
* Always False for replies in another chat or forum topic. Always True for messages sent on behalf of a business
|
|
23
|
+
* account.
|
|
24
|
+
*/
|
|
25
|
+
allow_sending_without_reply?: boolean;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Optional. Quoted part of the message to be replied to; 0-1024 characters after entities parsing. The quote must be
|
|
29
|
+
* an exact substring of the message to be replied to, including bold, italic, underline, strikethrough, spoiler, and
|
|
30
|
+
* custom_emoji entities. The message will fail to send if the quote isn't found in the original message.
|
|
31
|
+
*/
|
|
32
|
+
quote?: string;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Optional. Mode for parsing entities in the quote. See formatting options for more details.
|
|
36
|
+
*/
|
|
37
|
+
quote_parse_mode?: ParseMode;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Optional. A JSON-serialized list of special entities that appear in the quote. It can be specified instead of
|
|
41
|
+
* quote_parse_mode.
|
|
42
|
+
*/
|
|
43
|
+
quote_entities?: string; // todo: JSON Array of MessageEntity
|
|
44
|
+
/**
|
|
45
|
+
* Optional. Position of the quote in the original message in UTF-16 code units
|
|
46
|
+
*/
|
|
47
|
+
quote_position?: number;
|
|
48
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## ResponseParameters
|
|
3
|
+
* Describes why a request was unsuccessful.
|
|
4
|
+
* @see https://core.telegram.org/bots/api#responseparameters
|
|
5
|
+
*/
|
|
6
|
+
export type ResponseParameters = {
|
|
7
|
+
/**
|
|
8
|
+
* Optional. The group has been migrated to a supergroup with the specified identifier. This number may have more than
|
|
9
|
+
* 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it
|
|
10
|
+
* has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing
|
|
11
|
+
* this identifier.
|
|
12
|
+
*/
|
|
13
|
+
migrate_to_chat_id?: number;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Optional. In case of exceeding flood control, the number of seconds left to wait before the request can be repeated
|
|
17
|
+
*/
|
|
18
|
+
retry_after?: number;
|
|
19
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { RevenueWithdrawalStateFailed } from "./RevenueWithdrawalStateFailed";
|
|
2
|
+
import type { RevenueWithdrawalStatePending } from "./RevenueWithdrawalStatePending";
|
|
3
|
+
import type { RevenueWithdrawalStateSucceeded } from "./RevenueWithdrawalStateSucceeded";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* ## RevenueWithdrawalState
|
|
7
|
+
* This object describes the state of a revenue withdrawal operation. Currently, it can be one of
|
|
8
|
+
* @see https://core.telegram.org/bots/api#revenuewithdrawalstate
|
|
9
|
+
*/
|
|
10
|
+
export type RevenueWithdrawalState =
|
|
11
|
+
| RevenueWithdrawalStatePending
|
|
12
|
+
| RevenueWithdrawalStateSucceeded
|
|
13
|
+
| RevenueWithdrawalStateFailed;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RevenueWithdrawalStateFailed
|
|
3
|
+
* The withdrawal failed and the transaction was refunded.
|
|
4
|
+
* #see https://core.telegram.org/bots/api#revenuewithdrawalstatefailed
|
|
5
|
+
*/
|
|
6
|
+
export type RevenueWithdrawalStateFailed = {
|
|
7
|
+
/**
|
|
8
|
+
* Type of the state, always “failed”
|
|
9
|
+
*/
|
|
10
|
+
type: "failed";
|
|
11
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## RevenueWithdrawalStateSucceeded
|
|
3
|
+
* The withdrawal succeeded.
|
|
4
|
+
* @see https://core.telegram.org/bots/api#revenuewithdrawalstatesucceeded
|
|
5
|
+
*/
|
|
6
|
+
export type RevenueWithdrawalStateSucceeded = {
|
|
7
|
+
/**
|
|
8
|
+
* Type of the state, always “succeeded”
|
|
9
|
+
*/
|
|
10
|
+
type: "succeeded";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Date the withdrawal was completed in Unix time
|
|
14
|
+
*/
|
|
15
|
+
date: number;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* An HTTPS URL that can be used to see transaction details
|
|
19
|
+
*/
|
|
20
|
+
url: string;
|
|
21
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## SentWebAppMessage
|
|
3
|
+
* Describes an inline message sent by a Web App on behalf of a user.
|
|
4
|
+
* @see https://core.telegram.org/bots/api#sentwebappmessage
|
|
5
|
+
*/
|
|
6
|
+
export type SentWebAppMessage = {
|
|
7
|
+
/**
|
|
8
|
+
* Optional. Identifier of the sent inline message. Available only if there is an inline keyboard attached to the
|
|
9
|
+
* message.
|
|
10
|
+
*/
|
|
11
|
+
inline_message_id: string;
|
|
12
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { PhotoSize } from "./PhotoSize";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## SharedUser
|
|
5
|
+
* This object contains information about a user that was shared with the bot using a KeyboardButtonRequestUsers button.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#shareduser
|
|
7
|
+
*/
|
|
8
|
+
export type SharedUser = {
|
|
9
|
+
/**
|
|
10
|
+
* Identifier of the shared user. This number may have more than 32 significant bits and some programming languages
|
|
11
|
+
* may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so 64-bit integers
|
|
12
|
+
* or double-precision float types are safe for storing these identifiers. The bot may not have access to the user
|
|
13
|
+
* and could be unable to use this identifier, unless the user is already known to the bot by some other means.
|
|
14
|
+
*/
|
|
15
|
+
user_id: number;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Optional. First name of the user, if the name was requested by the bot
|
|
19
|
+
*/
|
|
20
|
+
first_name?: string;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Optional. Last name of the user, if the name was requested by the bot
|
|
24
|
+
*/
|
|
25
|
+
last_name?: string;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Optional. Username of the user, if the username was requested by the bot
|
|
29
|
+
*/
|
|
30
|
+
username?: string;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Optional. Available sizes of the chat photo, if the photo was requested by the bot
|
|
34
|
+
*/
|
|
35
|
+
photo?: PhotoSize[];
|
|
36
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## ShippingAddress
|
|
3
|
+
* This object represents a shipping address.
|
|
4
|
+
* @see https://core.telegram.org/bots/api#shippingaddress
|
|
5
|
+
*/
|
|
6
|
+
export type ShippingAddress = {
|
|
7
|
+
/**
|
|
8
|
+
* Two-letter ISO 3166-1 alpha-2 country code
|
|
9
|
+
*/
|
|
10
|
+
country_code: string;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* State, if applicable
|
|
14
|
+
*/
|
|
15
|
+
state: string;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* City
|
|
19
|
+
*/
|
|
20
|
+
city: string;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* First line for the address
|
|
24
|
+
*/
|
|
25
|
+
street_line1: string;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Second line for the address
|
|
29
|
+
*/
|
|
30
|
+
street_line2: string;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Address post code
|
|
34
|
+
*/
|
|
35
|
+
post_code: string;
|
|
36
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { LabeledPrice } from "./LabeledPrice";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## ShippingOption
|
|
5
|
+
* This object represents one shipping option.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#shippingoption
|
|
7
|
+
*/
|
|
8
|
+
export type ShippingOption = {
|
|
9
|
+
/**
|
|
10
|
+
* Shipping option identifier
|
|
11
|
+
*/
|
|
12
|
+
id: string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Option title
|
|
16
|
+
*/
|
|
17
|
+
title: string;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* List of price portions
|
|
21
|
+
*/
|
|
22
|
+
prices: LabeledPrice[];
|
|
23
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ShippingAddress, User } from "./";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## ShippingQuery
|
|
5
|
+
* This object contains information about an incoming shipping query.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#shippingquery
|
|
7
|
+
*/
|
|
8
|
+
export type ShippingQuery = {
|
|
9
|
+
/**
|
|
10
|
+
* Unique query identifier
|
|
11
|
+
*/
|
|
12
|
+
id: string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* User who sent the query
|
|
16
|
+
*/
|
|
17
|
+
from: User;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Bot-specified invoice payload
|
|
21
|
+
*/
|
|
22
|
+
invoice_payload: string;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* User specified shipping address
|
|
26
|
+
*/
|
|
27
|
+
shipping_address: ShippingAddress;
|
|
28
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## StarAmount
|
|
3
|
+
* Describes an amount of Telegram Stars.
|
|
4
|
+
* @see https://core.telegram.org/bots/api#staramount
|
|
5
|
+
*/
|
|
6
|
+
export type StarAmount = {
|
|
7
|
+
/**
|
|
8
|
+
* Integer amount of Telegram Stars, rounded to 0; can be negative
|
|
9
|
+
*/
|
|
10
|
+
amount: number;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Optional. The number of 1/1000000000 shares of Telegram Stars;
|
|
14
|
+
* from -999999999 to 999999999; can be negative if and only if amount is non-positive
|
|
15
|
+
*/
|
|
16
|
+
nanostar_amount?: number;
|
|
17
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { TransactionPartner } from "./";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## StarTransaction
|
|
5
|
+
* Describes a Telegram Star transaction.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#startransaction
|
|
7
|
+
*/
|
|
8
|
+
export type StarTransaction = {
|
|
9
|
+
/**
|
|
10
|
+
* Unique identifier of the transaction. Coincides with the identifer of the original transaction for refund
|
|
11
|
+
* transactions. Coincides with SuccessfulPayment.telegram_payment_charge_id for successful incoming payments from
|
|
12
|
+
* users.
|
|
13
|
+
*/
|
|
14
|
+
id: string;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Number of Telegram Stars transferred by the transaction
|
|
18
|
+
*/
|
|
19
|
+
amount: number;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Optional. The number of 1/1000000000 shares of Telegram Stars transferred by the transaction; from 0 to 999999999
|
|
23
|
+
*/
|
|
24
|
+
nanostar_amount?: number;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Date the transaction was created in Unix time
|
|
28
|
+
*/
|
|
29
|
+
date: number;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Optional. Source of an incoming transaction (e.g., a user purchasing goods or services, Fragment refunding a failed
|
|
33
|
+
* withdrawal). Only for incoming transactions
|
|
34
|
+
*/
|
|
35
|
+
source?: TransactionPartner;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Optional. Receiver of an outgoing transaction (e.g., a user for a purchase refund, Fragment for a withdrawal). Only
|
|
39
|
+
* for outgoing transactions
|
|
40
|
+
*/
|
|
41
|
+
receiver?: TransactionPartner;
|
|
42
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { StarTransaction } from "./StarTransaction";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## StarTransactions
|
|
5
|
+
* Contains a list of Telegram Star transactions.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#startransactions
|
|
7
|
+
*/
|
|
8
|
+
export type StarTransactions = {
|
|
9
|
+
/**
|
|
10
|
+
* The list of transactions
|
|
11
|
+
*/
|
|
12
|
+
transactions: StarTransaction[];
|
|
13
|
+
};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import type { File, MaskPosition, PhotoSize } from "./";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## Sticker
|
|
5
|
+
* This object represents a sticker.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#sticker
|
|
7
|
+
*/
|
|
8
|
+
export type Sticker = {
|
|
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
|
+
* Type of the sticker, currently one of “regular”, “mask”, “custom_emoji”. The type of the sticker is independent
|
|
22
|
+
* from its format, which is determined by the fields is_animated and is_video.
|
|
23
|
+
*/
|
|
24
|
+
type: "regular" | "mask" | "custom_emoji";
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Sticker width
|
|
28
|
+
*/
|
|
29
|
+
width: number;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Sticker height
|
|
33
|
+
*/
|
|
34
|
+
height: number;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* True, if the sticker is animated
|
|
38
|
+
*/
|
|
39
|
+
is_animated: boolean;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* True, if the sticker is a video sticker
|
|
43
|
+
*/
|
|
44
|
+
is_voice: boolean;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Optional. Sticker thumbnail in the .WEBP or .JPG format
|
|
48
|
+
*/
|
|
49
|
+
thumbnail?: PhotoSize;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Optional. Emoji associated with the sticker
|
|
53
|
+
*/
|
|
54
|
+
emoji?: string;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Optional. Name of the sticker set to which the sticker belongs
|
|
58
|
+
*/
|
|
59
|
+
set_name?: string;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Optional. For premium regular stickers, premium animation for the sticker
|
|
63
|
+
*/
|
|
64
|
+
premium_animation?: File;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Optional. For mask stickers, the position where the mask should be placed
|
|
68
|
+
*/
|
|
69
|
+
mask_position?: MaskPosition;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Optional. For custom emoji stickers, unique identifier of the custom emoji
|
|
73
|
+
*/
|
|
74
|
+
custom_emoji_id?: string;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Optional. True, if the sticker must be repainted to a text color in messages, the color of the Telegram Premium
|
|
78
|
+
* badge in emoji status, white color on chat photos, or another appropriate color in other places
|
|
79
|
+
*/
|
|
80
|
+
needs_repainting?: boolean;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Optional. File size in bytes
|
|
84
|
+
*/
|
|
85
|
+
file_size?: number;
|
|
86
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { PhotoSize, Sticker } from "./";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ## StickerSet
|
|
5
|
+
* This object represents a sticker set.
|
|
6
|
+
* @see https://core.telegram.org/bots/api#stickerset
|
|
7
|
+
*/
|
|
8
|
+
export type StickerSet = {
|
|
9
|
+
/**
|
|
10
|
+
* Sticker set name
|
|
11
|
+
*/
|
|
12
|
+
name: string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Sticker set title
|
|
16
|
+
*/
|
|
17
|
+
title: string;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Type of stickers in the set, currently one of “regular”, “mask”, “custom_emoji”
|
|
21
|
+
*/
|
|
22
|
+
sticker_type: Sticker["type"];
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* List of all set stickers
|
|
26
|
+
*/
|
|
27
|
+
stickers: Sticker[];
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Optional. Sticker set thumbnail in the .WEBP, .TGS, or .WEBM format
|
|
31
|
+
*/
|
|
32
|
+
thumbnail?: PhotoSize;
|
|
33
|
+
};
|