nyx-bot-client 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.sample +4 -0
- package/.vscode/extensions.json +11 -0
- package/.vscode/settings.json +17 -0
- package/.zed/settings.json +20 -0
- package/@types/AcceptedGiftTypes.ts +26 -0
- package/@types/AffiliateInfo.ts +35 -0
- package/@types/Animation.ts +56 -0
- package/@types/Audio.ts +56 -0
- package/@types/BackgroundFill.ts +18 -0
- package/@types/BackgroundFillFreeformGradient.ts +16 -0
- package/@types/BackgroundFillGradient.ts +26 -0
- package/@types/BackgroundFillSolid.ts +16 -0
- package/@types/BackgroundType.ts +21 -0
- package/@types/BackgroundTypeChatTheme.ts +16 -0
- package/@types/BackgroundTypeFill.ts +23 -0
- package/@types/BackgroundTypePattern.ts +40 -0
- package/@types/BackgroundTypeWallpaper.ts +33 -0
- package/@types/Birthdate.ts +21 -0
- package/@types/BotCommand.ts +16 -0
- package/@types/BotCommandScope.ts +30 -0
- package/@types/BotCommandScopeAllChatAdministrators.ts +11 -0
- package/@types/BotCommandScopeAllGroupChats.ts +11 -0
- package/@types/BotCommandScopeAllPrivateChats.ts +11 -0
- package/@types/BotCommandScopeChat.ts +16 -0
- package/@types/BotCommandScopeChatAdministrators.ts +16 -0
- package/@types/BotCommandScopeChatMember.ts +21 -0
- package/@types/BotCommandScopeDefault.ts +12 -0
- package/@types/BotDescription.ts +11 -0
- package/@types/BotName.ts +11 -0
- package/@types/BotShortDescription.ts +11 -0
- package/@types/BusinessBotRights.ts +65 -0
- package/@types/BusinessConnection.ts +41 -0
- package/@types/BusinessIntro.ts +23 -0
- package/@types/BusinessLocation.ts +18 -0
- package/@types/BusinessMessagesDeleted.ts +24 -0
- package/@types/BusinessOpeningHours.ts +18 -0
- package/@types/BusinessOpeningHoursInterval.ts +18 -0
- package/@types/CallbackGame.ts +6 -0
- package/@types/CallbackQuery.ts +49 -0
- package/@types/Chat.ts +43 -0
- package/@types/ChatAdministratorRights.ts +84 -0
- package/@types/ChatBackground.ts +13 -0
- package/@types/ChatBoost.ts +29 -0
- package/@types/ChatBoostAdded.ts +11 -0
- package/@types/ChatBoostRemoved.ts +28 -0
- package/@types/ChatBoostSource.ts +18 -0
- package/@types/ChatBoostSourceGiftCode.ts +19 -0
- package/@types/ChatBoostSourceGiveaway.ts +35 -0
- package/@types/ChatBoostSourcePremium.ts +19 -0
- package/@types/ChatBoostUpdated.ts +18 -0
- package/@types/ChatFullInfo.ts +260 -0
- package/@types/ChatInviteLink.ts +66 -0
- package/@types/ChatJoinRequest.ts +42 -0
- package/@types/ChatLocation.ts +16 -0
- package/@types/ChatMember.ts +28 -0
- package/@types/ChatMemberAdministrator.ts +107 -0
- package/@types/ChatMemberBanned.ts +23 -0
- package/@types/ChatMemberLeft.ts +18 -0
- package/@types/ChatMemberMember.ts +23 -0
- package/@types/ChatMemberOwner.ts +28 -0
- package/@types/ChatMemberRestricted.ts +99 -0
- package/@types/ChatMemberUpdated.ts +49 -0
- package/@types/ChatPermissions.ts +78 -0
- package/@types/ChatPhoto.ts +30 -0
- package/@types/ChatShared.ts +36 -0
- package/@types/Checklist.ts +33 -0
- package/@types/ChecklistTask.ts +33 -0
- package/@types/ChecklistTasksAdded.ts +19 -0
- package/@types/ChecklistTasksDone.ts +24 -0
- package/@types/ChosenInlineResult.ts +34 -0
- package/@types/Contact.ts +33 -0
- package/@types/CopyTextButton.ts +11 -0
- package/@types/Dice.ts +17 -0
- package/@types/DirectMessagePriceChanged.ts +17 -0
- package/@types/Document.ts +41 -0
- package/@types/EncryptedCredentials.ts +23 -0
- package/@types/EncryptedPassportElement.ts +357 -0
- package/@types/ExternalReplyInfo.ts +159 -0
- package/@types/File.ts +33 -0
- package/@types/ForceReply.ts +26 -0
- package/@types/ForumTopic.ts +26 -0
- package/@types/ForumTopicClosed.ts +6 -0
- package/@types/ForumTopicCreated.ts +21 -0
- package/@types/ForumTopicEdited.ts +17 -0
- package/@types/ForumTopicReopened.ts +6 -0
- package/@types/Game.ts +41 -0
- package/@types/GameHighScore.ts +23 -0
- package/@types/GeneralForumTopicHidden.ts +7 -0
- package/@types/GeneralForumTopicUnhidden.ts +7 -0
- package/@types/Gift.ts +38 -0
- package/@types/GiftInfo.ts +52 -0
- package/@types/Gifts.ts +13 -0
- package/@types/Giveaway.ts +55 -0
- package/@types/GiveawayCompleted.ts +29 -0
- package/@types/GiveawayCreated.ts +11 -0
- package/@types/GiveawayWinners.ts +68 -0
- package/@types/InaccessibleMessage.ts +23 -0
- package/@types/InlineKeyboardButton.ts +88 -0
- package/@types/InlineKeyboardMarkup.ts +13 -0
- package/@types/InlineQuery.ts +41 -0
- package/@types/InlineQueryResult.ts +70 -0
- package/@types/InlineQueryResultArticle.ts +58 -0
- package/@types/InlineQueryResultAudio.ts +69 -0
- package/@types/InlineQueryResultCachedAudio.ts +55 -0
- package/@types/InlineQueryResultCachedDocument.ts +65 -0
- package/@types/InlineQueryResultCachedGif.ts +65 -0
- package/@types/InlineQueryResultCachedMpeg4Gif.ts +65 -0
- package/@types/InlineQueryResultCachedPhoto.ts +70 -0
- package/@types/InlineQueryResultCachedSticker.ts +34 -0
- package/@types/InlineQueryResultCachedVideo.ts +70 -0
- package/@types/InlineQueryResultCachedVoice.ts +60 -0
- package/@types/InlineQueryResultContact.ts +64 -0
- package/@types/InlineQueryResultDocument.ts +85 -0
- package/@types/InlineQueryResultGame.ts +29 -0
- package/@types/InlineQueryResultGif.ts +91 -0
- package/@types/InlineQueryResultLocation.ts +82 -0
- package/@types/InlineQueryResultMpeg4Gif.ts +91 -0
- package/@types/InlineQueryResultPhoto.ts +84 -0
- package/@types/InlineQueryResultVenue.ts +80 -0
- package/@types/InlineQueryResultVideo.ts +98 -0
- package/@types/InlineQueryResultVoice.ts +65 -0
- package/@types/InlineQueryResultsButton.ts +34 -0
- package/@types/InputChecklist.ts +39 -0
- package/@types/InputChecklistTask.ts +30 -0
- package/@types/InputContactMessageContent.ts +27 -0
- package/@types/InputFile.ts +10 -0
- package/@types/InputInvoiceMessageContent.ts +120 -0
- package/@types/InputLocationMessageContent.ts +39 -0
- package/@types/InputMedia.ts +24 -0
- package/@types/InputMediaAnimation.ts +68 -0
- package/@types/InputMediaAudio.ts +58 -0
- package/@types/InputMediaDocument.ts +49 -0
- package/@types/InputMediaPhoto.ts +45 -0
- package/@types/InputMediaVideo.ts +85 -0
- package/@types/InputMessageContent.ts +25 -0
- package/@types/InputPaidMedia.ts +11 -0
- package/@types/InputPaidMediaPhoto.ts +21 -0
- package/@types/InputPaidMediaVideo.ts +64 -0
- package/@types/InputPollOption.ts +25 -0
- package/@types/InputProfilePhoto.ts +10 -0
- package/@types/InputProfilePhotoAnimated.ts +23 -0
- package/@types/InputProfilePhotoStatic.ts +18 -0
- package/@types/InputSticker.ts +38 -0
- package/@types/InputStoryContent.ts +11 -0
- package/@types/InputStoryContentPhoto.ts +29 -0
- package/@types/InputStoryContentVideo.ts +49 -0
- package/@types/InputTextMessageContent.ts +28 -0
- package/@types/InputVenueMessageContent.ts +47 -0
- package/@types/Invoice.ts +35 -0
- package/@types/KeyboardButton.ts +61 -0
- package/@types/KeyboardButtonPollType.ts +13 -0
- package/@types/KeyboardButtonRequestChat.ts +68 -0
- package/@types/KeyboardButtonRequestUsers.ts +45 -0
- package/@types/LabeledPrice.ts +18 -0
- package/@types/LinkPreviewOptions.ts +32 -0
- package/@types/Location.ts +38 -0
- package/@types/LocationAddress.ts +26 -0
- package/@types/LoginUrl.ts +37 -0
- package/@types/MaskPosition.ts +28 -0
- package/@types/MaybeInaccessibleMessage.ts +8 -0
- package/@types/MenuButton.ts +20 -0
- package/@types/MenuButtonCommands.ts +11 -0
- package/@types/MenuButtonDefault.ts +11 -0
- package/@types/MenuButtonWebApp.ts +26 -0
- package/@types/Message.ts +608 -0
- package/@types/MessageAutoDeleteTimerChanged.ts +11 -0
- package/@types/MessageEntity.ts +109 -0
- package/@types/MessageId.ts +11 -0
- package/@types/MessageOrigin.ts +21 -0
- package/@types/MessageOriginChannel.ts +33 -0
- package/@types/MessageOriginChat.ts +28 -0
- package/@types/MessageOriginHiddenUser.ts +21 -0
- package/@types/MessageOriginUser.ts +23 -0
- package/@types/MessageReactionCountUpdated.ts +28 -0
- package/@types/MessageReactionUpdated.ts +43 -0
- package/@types/OrderInfo.ts +28 -0
- package/@types/OwnedGift.ts +11 -0
- package/@types/OwnedGiftRegular.ts +77 -0
- package/@types/OwnedGiftUnique.ts +57 -0
- package/@types/OwnedGifts.ts +23 -0
- package/@types/PaidMedia.ts +13 -0
- package/@types/PaidMediaInfo.ts +18 -0
- package/@types/PaidMediaPhoto.ts +18 -0
- package/@types/PaidMediaPreview.ts +26 -0
- package/@types/PaidMediaPurchased.ts +18 -0
- package/@types/PaidMediaVideo.ts +18 -0
- package/@types/PaidMessagePriceChanged.ts +16 -0
- package/@types/PassportData.ts +18 -0
- package/@types/PassportElementError.ts +37 -0
- package/@types/PassportElementErrorDataField.ts +39 -0
- package/@types/PassportElementErrorFile.ts +33 -0
- package/@types/PassportElementErrorFiles.ts +33 -0
- package/@types/PassportElementErrorFrontSide.ts +28 -0
- package/@types/PassportElementErrorReverseSide.ts +27 -0
- package/@types/PassportElementErrorSelfie.ts +28 -0
- package/@types/PassportElementErrorTranslationFile.ts +38 -0
- package/@types/PassportElementErrorTranslationFiles.ts +38 -0
- package/@types/PassportElementErrorUnspecified.ts +49 -0
- package/@types/PassportFile.ts +28 -0
- package/@types/PhotoSize.ts +32 -0
- package/@types/Poll.ts +81 -0
- package/@types/PollAnswer.ts +28 -0
- package/@types/PollOption.ts +24 -0
- package/@types/PreCheckoutQuery.ts +45 -0
- package/@types/ProximityAlertTriggered.ts +24 -0
- package/@types/ReactionCount.ts +18 -0
- package/@types/ReactionType.ts +18 -0
- package/@types/ReactionTypeCustomEmoji.ts +16 -0
- package/@types/ReactionTypeEmoji.ts +92 -0
- package/@types/ReactionTypePaid.ts +11 -0
- package/@types/RefundedPayment.ts +35 -0
- package/@types/ReplyKeyboardMarkup.ts +49 -0
- package/@types/ReplyKeyboardRemove.ts +25 -0
- package/@types/ReplyParameters.ts +48 -0
- package/@types/ResponseParameters.ts +19 -0
- package/@types/RevenueWithdrawalState.ts +13 -0
- package/@types/RevenueWithdrawalStateFailed.ts +11 -0
- package/@types/RevenueWithdrawalStatePending.ts +10 -0
- package/@types/RevenueWithdrawalStateSucceeded.ts +21 -0
- package/@types/SentWebAppMessage.ts +12 -0
- package/@types/SharedUser.ts +36 -0
- package/@types/ShippingAddress.ts +36 -0
- package/@types/ShippingOption.ts +23 -0
- package/@types/ShippingQuery.ts +28 -0
- package/@types/StarAmount.ts +17 -0
- package/@types/StarTransaction.ts +42 -0
- package/@types/StarTransactions.ts +13 -0
- package/@types/Sticker.ts +86 -0
- package/@types/StickerSet.ts +33 -0
- package/@types/Story.ts +18 -0
- package/@types/StoryArea.ts +18 -0
- package/@types/StoryAreaPosition.ts +36 -0
- package/@types/StoryAreaType.ts +24 -0
- package/@types/StoryAreaTypeLink.ts +16 -0
- package/@types/StoryAreaTypeLocation.ts +28 -0
- package/@types/StoryAreaTypeSuggestedReaction.ts +29 -0
- package/@types/StoryAreaTypeUniqueGift.ts +16 -0
- package/@types/StoryAreaTypeWeather.ts +26 -0
- package/@types/SuccessfulPayment.ts +60 -0
- package/@types/SwitchInlineQueryChosenChat.ts +33 -0
- package/@types/TextQuote.ts +30 -0
- package/@types/TransactionPartner.ts +31 -0
- package/@types/TransactionPartnerAffiliateProgram.ts +24 -0
- package/@types/TransactionPartnerChat.ts +21 -0
- package/@types/TransactionPartnerFragment.ts +18 -0
- package/@types/TransactionPartnerOther.ts +11 -0
- package/@types/TransactionPartnerTelegramAds.ts +11 -0
- package/@types/TransactionPartnerTelegramApi.ts +16 -0
- package/@types/TransactionPartnerUser.ts +70 -0
- package/@types/UniqueGift.ts +38 -0
- package/@types/UniqueGiftBackdrop.ts +23 -0
- package/@types/UniqueGiftBackdropColors.ts +26 -0
- package/@types/UniqueGiftInfo.ts +42 -0
- package/@types/UniqueGiftModel.ts +23 -0
- package/@types/UniqueGiftSymbol.ts +23 -0
- package/@types/Update.ts +177 -0
- package/@types/User.ts +74 -0
- package/@types/UserProfilePhotos.ts +18 -0
- package/@types/UsersShared.ts +19 -0
- package/@types/Venue.ts +48 -0
- package/@types/Video.ts +66 -0
- package/@types/VideoChatEnded.ts +11 -0
- package/@types/VideoChatParticipantsInvited.ts +13 -0
- package/@types/VideoChatScheduled.ts +11 -0
- package/@types/VideoChatStarted.ts +6 -0
- package/@types/VideoNote.ts +39 -0
- package/@types/Voice.ts +34 -0
- package/@types/WebAppData.ts +17 -0
- package/@types/WebAppInfo.ts +11 -0
- package/@types/WebhookInfo.ts +54 -0
- package/@types/WriteAccessAllowed.ts +23 -0
- package/@types/index.ts +395 -0
- package/@types/utils.ts +17 -0
- package/biome.json +58 -0
- package/bun.lock +105 -0
- package/cron/actions-server.ts +87 -0
- package/index.ts +9 -0
- package/nyx-client.ts +133 -0
- package/package.json +22 -0
- package/tsconfig.json +28 -0
- package/types.d.ts +35 -0
- package/utils/actions.ts +30 -0
- package/utils/api.ts +27 -0
- package/utils/enum.ts +5 -0
- package/utils/helpers.ts +71 -0
- package/utils/methods.ts +1943 -0
- package/utils/objects.ts +37 -0
- package/utils/table.ts +72 -0
package/utils/methods.ts
ADDED
|
@@ -0,0 +1,1943 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
BotCommand,
|
|
3
|
+
BotCommandScope,
|
|
4
|
+
BotDescription,
|
|
5
|
+
BotName,
|
|
6
|
+
BotShortDescription,
|
|
7
|
+
BusinessConnection,
|
|
8
|
+
ChatAdministratorRights,
|
|
9
|
+
ChatFullInfo,
|
|
10
|
+
ChatInviteLink,
|
|
11
|
+
ChatMember,
|
|
12
|
+
ChatPermissions,
|
|
13
|
+
File,
|
|
14
|
+
ForceReply,
|
|
15
|
+
ForumTopic,
|
|
16
|
+
GameHighScore,
|
|
17
|
+
Gifts,
|
|
18
|
+
InlineKeyboardMarkup,
|
|
19
|
+
InlineQueryResult,
|
|
20
|
+
InlineQueryResultsButton,
|
|
21
|
+
InputFile,
|
|
22
|
+
InputMedia,
|
|
23
|
+
InputMediaAudio,
|
|
24
|
+
InputMediaDocument,
|
|
25
|
+
InputMediaPhoto,
|
|
26
|
+
InputMediaVideo,
|
|
27
|
+
InputPaidMedia,
|
|
28
|
+
InputPollOption,
|
|
29
|
+
InputSticker,
|
|
30
|
+
LabeledPrice,
|
|
31
|
+
LinkPreviewOptions,
|
|
32
|
+
MaskPosition,
|
|
33
|
+
MenuButton,
|
|
34
|
+
Message,
|
|
35
|
+
MessageEntity,
|
|
36
|
+
MessageId,
|
|
37
|
+
PassportElementError,
|
|
38
|
+
Poll,
|
|
39
|
+
ReactionType,
|
|
40
|
+
ReplyKeyboardMarkup,
|
|
41
|
+
ReplyKeyboardRemove,
|
|
42
|
+
ReplyParameters,
|
|
43
|
+
SentWebAppMessage,
|
|
44
|
+
ShippingOption,
|
|
45
|
+
StarTransaction,
|
|
46
|
+
Sticker,
|
|
47
|
+
StickerSet,
|
|
48
|
+
Story,
|
|
49
|
+
Update,
|
|
50
|
+
User,
|
|
51
|
+
UserProfilePhotos,
|
|
52
|
+
WebhookInfo,
|
|
53
|
+
} from "../@types";
|
|
54
|
+
import { requestTelegramAPI } from "./api";
|
|
55
|
+
|
|
56
|
+
export type methodParams = {
|
|
57
|
+
bot_token?: string;
|
|
58
|
+
bot_api_server?: string;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export type ResponseSuccess<T> = {
|
|
62
|
+
ok: true;
|
|
63
|
+
result: T;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export type ResponseError = {
|
|
67
|
+
ok: false;
|
|
68
|
+
error_code: number;
|
|
69
|
+
description: string;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export type APIResponse<T = true> = Promise<ResponseSuccess<T> | ResponseError>;
|
|
73
|
+
|
|
74
|
+
export type getUpdatesParams = {
|
|
75
|
+
offset?: number;
|
|
76
|
+
limit?: number;
|
|
77
|
+
timeout?: number;
|
|
78
|
+
allowed_updates?: string[];
|
|
79
|
+
} & methodParams;
|
|
80
|
+
|
|
81
|
+
export const getUpdates = (params: getUpdatesParams): APIResponse<Update> =>
|
|
82
|
+
requestTelegramAPI("getUpdates", params);
|
|
83
|
+
|
|
84
|
+
export type sendMessageParams = {
|
|
85
|
+
chat_id: number | string;
|
|
86
|
+
text: string | object;
|
|
87
|
+
business_connection_id?: string;
|
|
88
|
+
message_thread_id?: number;
|
|
89
|
+
parse_mode?: string;
|
|
90
|
+
entities?: MessageEntity[];
|
|
91
|
+
link_preview_options?: LinkPreviewOptions;
|
|
92
|
+
disable_notification?: boolean;
|
|
93
|
+
protect_content?: boolean;
|
|
94
|
+
allow_paid_broadcast?: boolean;
|
|
95
|
+
message_effect_id?: string;
|
|
96
|
+
reply_parameters?: ReplyParameters;
|
|
97
|
+
reply_markup?:
|
|
98
|
+
| InlineKeyboardMarkup
|
|
99
|
+
| ReplyKeyboardMarkup
|
|
100
|
+
| ReplyKeyboardRemove
|
|
101
|
+
| ForceReply;
|
|
102
|
+
} & methodParams;
|
|
103
|
+
|
|
104
|
+
export const sendMessage = (
|
|
105
|
+
params: sendMessageParams,
|
|
106
|
+
): APIResponse<Message> => {
|
|
107
|
+
if (typeof params.text === "object") {
|
|
108
|
+
params.text = JSON.stringify(params.text);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
params.parse_mode ||= "HTML";
|
|
112
|
+
|
|
113
|
+
return requestTelegramAPI("sendMessage", params);
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
export type setWebhookParams = {
|
|
117
|
+
url: string;
|
|
118
|
+
certificate?: InputFile;
|
|
119
|
+
ip_address?: string;
|
|
120
|
+
max_connections?: number;
|
|
121
|
+
allowed_updates?: string[];
|
|
122
|
+
drop_pending_updates?: boolean;
|
|
123
|
+
secret_token?: string;
|
|
124
|
+
} & methodParams;
|
|
125
|
+
|
|
126
|
+
export const setWebhook = (params: setWebhookParams): APIResponse =>
|
|
127
|
+
requestTelegramAPI("setWebhook", params);
|
|
128
|
+
|
|
129
|
+
export type deleteWebhookParams = {
|
|
130
|
+
drop_pending_updates?: boolean;
|
|
131
|
+
} & methodParams;
|
|
132
|
+
|
|
133
|
+
export const deleteWebhook = (params: deleteWebhookParams): APIResponse =>
|
|
134
|
+
requestTelegramAPI("deleteWebhook", params);
|
|
135
|
+
|
|
136
|
+
export type getWebhookInfoParams = {} & methodParams;
|
|
137
|
+
|
|
138
|
+
export const getWebhookInfo = (
|
|
139
|
+
params: getWebhookInfoParams,
|
|
140
|
+
): APIResponse<WebhookInfo> => requestTelegramAPI("getWebhookInfo", params);
|
|
141
|
+
|
|
142
|
+
export type getMeParams = {} & methodParams;
|
|
143
|
+
|
|
144
|
+
export const getMe = (params: getMeParams): APIResponse<User> =>
|
|
145
|
+
requestTelegramAPI("getMe", params);
|
|
146
|
+
|
|
147
|
+
export type logOutParams = {} & methodParams;
|
|
148
|
+
|
|
149
|
+
export const logOut = (params: logOutParams): APIResponse =>
|
|
150
|
+
requestTelegramAPI("logOut", params);
|
|
151
|
+
|
|
152
|
+
export type closeParams = {} & methodParams;
|
|
153
|
+
|
|
154
|
+
export const close = (params: closeParams): APIResponse =>
|
|
155
|
+
requestTelegramAPI("close", params);
|
|
156
|
+
|
|
157
|
+
export type forwardMessageParams = {
|
|
158
|
+
chat_id: string | number;
|
|
159
|
+
from_chat_id: string | number;
|
|
160
|
+
message_id: number;
|
|
161
|
+
message_thread_id?: number;
|
|
162
|
+
video_start_timestamp?: number;
|
|
163
|
+
disable_notification?: boolean;
|
|
164
|
+
protect_content?: boolean;
|
|
165
|
+
} & methodParams;
|
|
166
|
+
|
|
167
|
+
export const forwardMessage = (
|
|
168
|
+
params: forwardMessageParams,
|
|
169
|
+
): APIResponse<Message> => requestTelegramAPI("forwardMessage", params);
|
|
170
|
+
|
|
171
|
+
export type forwardMessagesParams = {
|
|
172
|
+
chat_id: string | number;
|
|
173
|
+
from_chat_id: string | number;
|
|
174
|
+
message_ids: number[];
|
|
175
|
+
message_thread_id?: number;
|
|
176
|
+
disable_notification?: boolean;
|
|
177
|
+
protect_content?: boolean;
|
|
178
|
+
} & methodParams;
|
|
179
|
+
|
|
180
|
+
export const forwardMessages = (
|
|
181
|
+
params: forwardMessagesParams,
|
|
182
|
+
): APIResponse<MessageId[]> => requestTelegramAPI("forwardMessages", params);
|
|
183
|
+
|
|
184
|
+
export type copyMessageParams = {
|
|
185
|
+
chat_id: string | number;
|
|
186
|
+
from_chat_id: string | number;
|
|
187
|
+
message_id: number;
|
|
188
|
+
message_thread_id?: number;
|
|
189
|
+
video_start_timestamp?: number;
|
|
190
|
+
caption?: string;
|
|
191
|
+
parse_mode?: string;
|
|
192
|
+
caption_entities?: MessageEntity[];
|
|
193
|
+
show_caption_above_media?: boolean;
|
|
194
|
+
disable_notification?: boolean;
|
|
195
|
+
protect_content?: boolean;
|
|
196
|
+
allow_paid_broadcast?: boolean;
|
|
197
|
+
reply_parameters?: ReplyParameters;
|
|
198
|
+
reply_markup?:
|
|
199
|
+
| InlineKeyboardMarkup
|
|
200
|
+
| ReplyKeyboardMarkup
|
|
201
|
+
| ReplyKeyboardRemove
|
|
202
|
+
| ForceReply;
|
|
203
|
+
} & methodParams;
|
|
204
|
+
|
|
205
|
+
export const copyMessage = (
|
|
206
|
+
params: copyMessageParams,
|
|
207
|
+
): APIResponse<MessageId> => {
|
|
208
|
+
params.parse_mode ||= "HTML";
|
|
209
|
+
return requestTelegramAPI("copyMessage", params);
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
export type copyMessagesParams = {
|
|
213
|
+
chat_id: string | number;
|
|
214
|
+
from_chat_id: string | number;
|
|
215
|
+
message_ids: number[];
|
|
216
|
+
message_thread_id?: number;
|
|
217
|
+
disable_notification?: boolean;
|
|
218
|
+
protect_content?: boolean;
|
|
219
|
+
remove_caption?: boolean;
|
|
220
|
+
} & methodParams;
|
|
221
|
+
|
|
222
|
+
export const copyMessages = (
|
|
223
|
+
params: copyMessagesParams,
|
|
224
|
+
): APIResponse<MessageId[]> => requestTelegramAPI("copyMessages", params);
|
|
225
|
+
|
|
226
|
+
export type sendPhotoParams = {
|
|
227
|
+
chat_id: string | number;
|
|
228
|
+
photo: InputFile | string;
|
|
229
|
+
business_connection_id?: string;
|
|
230
|
+
message_thread_id?: number;
|
|
231
|
+
caption?: string;
|
|
232
|
+
parse_mode?: string;
|
|
233
|
+
caption_entities?: MessageEntity[];
|
|
234
|
+
show_caption_above_media?: boolean;
|
|
235
|
+
has_spoiler?: boolean;
|
|
236
|
+
disable_notification?: boolean;
|
|
237
|
+
protect_content?: boolean;
|
|
238
|
+
allow_paid_broadcast?: boolean;
|
|
239
|
+
message_effect_id?: string;
|
|
240
|
+
reply_parameters?: ReplyParameters;
|
|
241
|
+
reply_markup?:
|
|
242
|
+
| InlineKeyboardMarkup
|
|
243
|
+
| ReplyKeyboardMarkup
|
|
244
|
+
| ReplyKeyboardRemove
|
|
245
|
+
| ForceReply;
|
|
246
|
+
} & methodParams;
|
|
247
|
+
|
|
248
|
+
export const sendPhoto = (params: sendPhotoParams): APIResponse<Message> => {
|
|
249
|
+
params.parse_mode ||= "HTML";
|
|
250
|
+
return requestTelegramAPI("sendPhoto", params);
|
|
251
|
+
};
|
|
252
|
+
|
|
253
|
+
export type sendAudioParams = {
|
|
254
|
+
chat_id: string | number;
|
|
255
|
+
audio: InputFile | string;
|
|
256
|
+
business_connection_id?: string;
|
|
257
|
+
message_thread_id?: number;
|
|
258
|
+
caption?: string;
|
|
259
|
+
parse_mode?: string;
|
|
260
|
+
caption_entities?: MessageEntity[];
|
|
261
|
+
duration?: number;
|
|
262
|
+
performer?: string;
|
|
263
|
+
title?: string;
|
|
264
|
+
thumbnail?: InputFile | string;
|
|
265
|
+
disable_notification?: boolean;
|
|
266
|
+
protect_content?: boolean;
|
|
267
|
+
allow_paid_broadcast?: boolean;
|
|
268
|
+
message_effect_id?: string;
|
|
269
|
+
reply_parameters?: ReplyParameters;
|
|
270
|
+
reply_markup?:
|
|
271
|
+
| InlineKeyboardMarkup
|
|
272
|
+
| ReplyKeyboardMarkup
|
|
273
|
+
| ReplyKeyboardRemove
|
|
274
|
+
| ForceReply;
|
|
275
|
+
} & methodParams;
|
|
276
|
+
|
|
277
|
+
export const sendAudio = (params: sendAudioParams): APIResponse<Message> => {
|
|
278
|
+
params.parse_mode ||= "HTML";
|
|
279
|
+
return requestTelegramAPI("sendAudio", params);
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
export type sendDocumentParams = {
|
|
283
|
+
chat_id: string | number;
|
|
284
|
+
document: InputFile | string;
|
|
285
|
+
business_connection_id?: string;
|
|
286
|
+
message_thread_id?: number;
|
|
287
|
+
thumbnail?: InputFile | string;
|
|
288
|
+
caption?: string;
|
|
289
|
+
parse_mode?: string;
|
|
290
|
+
caption_entities?: MessageEntity[];
|
|
291
|
+
disable_content_type_detection?: boolean;
|
|
292
|
+
disable_notification?: boolean;
|
|
293
|
+
protect_content?: boolean;
|
|
294
|
+
allow_paid_broadcast?: boolean;
|
|
295
|
+
message_effect_id?: string;
|
|
296
|
+
reply_parameters?: ReplyParameters;
|
|
297
|
+
reply_markup?:
|
|
298
|
+
| InlineKeyboardMarkup
|
|
299
|
+
| ReplyKeyboardMarkup
|
|
300
|
+
| ReplyKeyboardRemove
|
|
301
|
+
| ForceReply;
|
|
302
|
+
} & methodParams;
|
|
303
|
+
|
|
304
|
+
export const sendDocument = (
|
|
305
|
+
params: sendDocumentParams,
|
|
306
|
+
): APIResponse<Message> => {
|
|
307
|
+
params.parse_mode ||= "HTML";
|
|
308
|
+
return requestTelegramAPI("sendDocument", params);
|
|
309
|
+
};
|
|
310
|
+
|
|
311
|
+
export type sendVideoParams = {
|
|
312
|
+
chat_id: string | number;
|
|
313
|
+
video: InputFile | string;
|
|
314
|
+
business_connection_id?: string;
|
|
315
|
+
message_thread_id?: number;
|
|
316
|
+
duration?: number;
|
|
317
|
+
width?: number;
|
|
318
|
+
height?: number;
|
|
319
|
+
thumbnail?: InputFile | string;
|
|
320
|
+
cover?: InputFile | string;
|
|
321
|
+
start_timestamp?: number;
|
|
322
|
+
caption?: string;
|
|
323
|
+
parse_mode?: string;
|
|
324
|
+
caption_entities?: MessageEntity[];
|
|
325
|
+
show_caption_above_media?: boolean;
|
|
326
|
+
has_spoiler?: boolean;
|
|
327
|
+
supports_streaming?: boolean;
|
|
328
|
+
disable_notification?: boolean;
|
|
329
|
+
protect_content?: boolean;
|
|
330
|
+
allow_paid_broadcast?: boolean;
|
|
331
|
+
message_effect_id?: string;
|
|
332
|
+
reply_parameters?: ReplyParameters;
|
|
333
|
+
reply_markup?:
|
|
334
|
+
| InlineKeyboardMarkup
|
|
335
|
+
| ReplyKeyboardMarkup
|
|
336
|
+
| ReplyKeyboardRemove
|
|
337
|
+
| ForceReply;
|
|
338
|
+
} & methodParams;
|
|
339
|
+
|
|
340
|
+
export const sendVideo = (params: sendVideoParams): APIResponse<Message> => {
|
|
341
|
+
params.parse_mode ||= "HTML";
|
|
342
|
+
return requestTelegramAPI("sendVideo", params);
|
|
343
|
+
};
|
|
344
|
+
|
|
345
|
+
export type sendAnimationParams = {
|
|
346
|
+
chat_id: string | number;
|
|
347
|
+
animation: InputFile | string;
|
|
348
|
+
business_connection_id?: string;
|
|
349
|
+
message_thread_id?: number;
|
|
350
|
+
duration?: number;
|
|
351
|
+
width?: number;
|
|
352
|
+
height?: number;
|
|
353
|
+
thumbnail?: InputFile | string;
|
|
354
|
+
caption?: string;
|
|
355
|
+
parse_mode?: string;
|
|
356
|
+
caption_entities?: MessageEntity[];
|
|
357
|
+
show_caption_above_media?: boolean;
|
|
358
|
+
has_spoiler?: boolean;
|
|
359
|
+
disable_notification?: boolean;
|
|
360
|
+
protect_content?: boolean;
|
|
361
|
+
allow_paid_broadcast?: boolean;
|
|
362
|
+
message_effect_id?: string;
|
|
363
|
+
reply_parameters?: ReplyParameters;
|
|
364
|
+
reply_markup?:
|
|
365
|
+
| InlineKeyboardMarkup
|
|
366
|
+
| ReplyKeyboardMarkup
|
|
367
|
+
| ReplyKeyboardRemove
|
|
368
|
+
| ForceReply;
|
|
369
|
+
} & methodParams;
|
|
370
|
+
|
|
371
|
+
export const sendAnimation = (
|
|
372
|
+
params: sendAnimationParams,
|
|
373
|
+
): APIResponse<Message> => {
|
|
374
|
+
params.parse_mode ||= "HTML";
|
|
375
|
+
return requestTelegramAPI("sendAnimation", params);
|
|
376
|
+
};
|
|
377
|
+
|
|
378
|
+
export type sendVoiceParams = {
|
|
379
|
+
chat_id: string | number;
|
|
380
|
+
voice: InputFile | string;
|
|
381
|
+
business_connection_id?: string;
|
|
382
|
+
message_thread_id?: number;
|
|
383
|
+
caption?: string;
|
|
384
|
+
parse_mode?: string;
|
|
385
|
+
caption_entities?: MessageEntity[];
|
|
386
|
+
duration?: number;
|
|
387
|
+
disable_notification?: boolean;
|
|
388
|
+
protect_content?: boolean;
|
|
389
|
+
allow_paid_broadcast?: boolean;
|
|
390
|
+
message_effect_id?: string;
|
|
391
|
+
reply_parameters?: ReplyParameters;
|
|
392
|
+
reply_markup?:
|
|
393
|
+
| InlineKeyboardMarkup
|
|
394
|
+
| ReplyKeyboardMarkup
|
|
395
|
+
| ReplyKeyboardRemove
|
|
396
|
+
| ForceReply;
|
|
397
|
+
} & methodParams;
|
|
398
|
+
|
|
399
|
+
export const sendVoice = (params: sendVoiceParams): APIResponse<Message> => {
|
|
400
|
+
params.parse_mode ||= "HTML";
|
|
401
|
+
return requestTelegramAPI("sendVoice", params);
|
|
402
|
+
};
|
|
403
|
+
|
|
404
|
+
export type sendVideoNoteParams = {
|
|
405
|
+
chat_id: string | number;
|
|
406
|
+
video_note: InputFile | string;
|
|
407
|
+
business_connection_id?: string;
|
|
408
|
+
message_thread_id?: number;
|
|
409
|
+
duration?: number;
|
|
410
|
+
length?: number;
|
|
411
|
+
thumbnail?: InputFile | string;
|
|
412
|
+
disable_notification?: boolean;
|
|
413
|
+
protect_content?: boolean;
|
|
414
|
+
allow_paid_broadcast?: boolean;
|
|
415
|
+
message_effect_id?: string;
|
|
416
|
+
reply_parameters?: ReplyParameters;
|
|
417
|
+
reply_markup?:
|
|
418
|
+
| InlineKeyboardMarkup
|
|
419
|
+
| ReplyKeyboardMarkup
|
|
420
|
+
| ReplyKeyboardRemove
|
|
421
|
+
| ForceReply;
|
|
422
|
+
} & methodParams;
|
|
423
|
+
|
|
424
|
+
export const sendVideoNote = (
|
|
425
|
+
params: sendVideoNoteParams,
|
|
426
|
+
): APIResponse<Message> => requestTelegramAPI("sendVideoNote", params);
|
|
427
|
+
|
|
428
|
+
export type sendPaidMediaParams = {
|
|
429
|
+
chat_id: string | number;
|
|
430
|
+
star_count: number;
|
|
431
|
+
media: InputPaidMedia[];
|
|
432
|
+
payload?: string;
|
|
433
|
+
business_connection_id?: string;
|
|
434
|
+
message_thread_id?: number;
|
|
435
|
+
caption?: string;
|
|
436
|
+
parse_mode?: string;
|
|
437
|
+
caption_entities?: MessageEntity[];
|
|
438
|
+
show_caption_above_media?: boolean;
|
|
439
|
+
disable_notification?: boolean;
|
|
440
|
+
protect_content?: boolean;
|
|
441
|
+
allow_paid_broadcast?: boolean;
|
|
442
|
+
message_effect_id?: string;
|
|
443
|
+
reply_parameters?: ReplyParameters;
|
|
444
|
+
reply_markup?:
|
|
445
|
+
| InlineKeyboardMarkup
|
|
446
|
+
| ReplyKeyboardMarkup
|
|
447
|
+
| ReplyKeyboardRemove
|
|
448
|
+
| ForceReply;
|
|
449
|
+
} & methodParams;
|
|
450
|
+
|
|
451
|
+
export const sendPaidMedia = (
|
|
452
|
+
params: sendPaidMediaParams,
|
|
453
|
+
): APIResponse<Message> => {
|
|
454
|
+
params.parse_mode ||= "HTML";
|
|
455
|
+
return requestTelegramAPI("sendPaidMedia", params);
|
|
456
|
+
};
|
|
457
|
+
|
|
458
|
+
export type sendMediaGroupParams = {
|
|
459
|
+
chat_id: string | number;
|
|
460
|
+
media:
|
|
461
|
+
| InputMediaAudio[]
|
|
462
|
+
| InputMediaDocument[]
|
|
463
|
+
| InputMediaPhoto[]
|
|
464
|
+
| InputMediaVideo[];
|
|
465
|
+
business_connection_id?: string;
|
|
466
|
+
message_thread_id?: number;
|
|
467
|
+
disable_notification?: boolean;
|
|
468
|
+
protect_content?: boolean;
|
|
469
|
+
allow_paid_broadcast?: boolean;
|
|
470
|
+
message_effect_id?: string;
|
|
471
|
+
reply_parameters?: ReplyParameters;
|
|
472
|
+
reply_markup?:
|
|
473
|
+
| InlineKeyboardMarkup
|
|
474
|
+
| ReplyKeyboardMarkup
|
|
475
|
+
| ReplyKeyboardRemove
|
|
476
|
+
| ForceReply;
|
|
477
|
+
} & methodParams;
|
|
478
|
+
|
|
479
|
+
export const sendMediaGroup = (
|
|
480
|
+
params: sendMediaGroupParams,
|
|
481
|
+
): APIResponse<Message[]> => requestTelegramAPI("sendMediaGroup", params);
|
|
482
|
+
|
|
483
|
+
export type sendLocationParams = {
|
|
484
|
+
chat_id: string | number;
|
|
485
|
+
latitude: number;
|
|
486
|
+
longitude: number;
|
|
487
|
+
business_connection_id?: string;
|
|
488
|
+
message_thread_id?: number;
|
|
489
|
+
horizontal_accuracy?: number;
|
|
490
|
+
live_period?: number;
|
|
491
|
+
heading?: number;
|
|
492
|
+
proximity_alert_radius?: number;
|
|
493
|
+
disable_notification?: boolean;
|
|
494
|
+
protect_content?: boolean;
|
|
495
|
+
allow_paid_broadcast?: boolean;
|
|
496
|
+
message_effect_id?: string;
|
|
497
|
+
reply_parameters?: ReplyParameters;
|
|
498
|
+
reply_markup?:
|
|
499
|
+
| InlineKeyboardMarkup
|
|
500
|
+
| ReplyKeyboardMarkup
|
|
501
|
+
| ReplyKeyboardRemove
|
|
502
|
+
| ForceReply;
|
|
503
|
+
} & methodParams;
|
|
504
|
+
|
|
505
|
+
export const sendLocation = (
|
|
506
|
+
params: sendLocationParams,
|
|
507
|
+
): APIResponse<Message> => requestTelegramAPI("sendLocation", params);
|
|
508
|
+
|
|
509
|
+
export type sendVenueParams = {
|
|
510
|
+
chat_id: string | number;
|
|
511
|
+
latitude: number;
|
|
512
|
+
longitude: number;
|
|
513
|
+
title: string;
|
|
514
|
+
address: string;
|
|
515
|
+
business_connection_id?: string;
|
|
516
|
+
message_thread_id?: number;
|
|
517
|
+
foursquare_id?: string;
|
|
518
|
+
foursquare_type?: string;
|
|
519
|
+
google_place_id?: string;
|
|
520
|
+
google_place_type?: string;
|
|
521
|
+
disable_notification?: boolean;
|
|
522
|
+
protect_content?: boolean;
|
|
523
|
+
allow_paid_broadcast?: boolean;
|
|
524
|
+
message_effect_id?: string;
|
|
525
|
+
reply_parameters?: ReplyParameters;
|
|
526
|
+
reply_markup?:
|
|
527
|
+
| InlineKeyboardMarkup
|
|
528
|
+
| ReplyKeyboardMarkup
|
|
529
|
+
| ReplyKeyboardRemove
|
|
530
|
+
| ForceReply;
|
|
531
|
+
} & methodParams;
|
|
532
|
+
|
|
533
|
+
export const sendVenue = (params: sendVenueParams): APIResponse<Message> =>
|
|
534
|
+
requestTelegramAPI("sendVenue", params);
|
|
535
|
+
|
|
536
|
+
export type sendContactParams = {
|
|
537
|
+
chat_id: string | number;
|
|
538
|
+
phone_number: string;
|
|
539
|
+
first_name: string;
|
|
540
|
+
last_name?: string;
|
|
541
|
+
vcard?: string;
|
|
542
|
+
business_connection_id?: string;
|
|
543
|
+
message_thread_id?: number;
|
|
544
|
+
disable_notification?: boolean;
|
|
545
|
+
protect_content?: boolean;
|
|
546
|
+
allow_paid_broadcast?: boolean;
|
|
547
|
+
message_effect_id?: string;
|
|
548
|
+
reply_parameters?: ReplyParameters;
|
|
549
|
+
reply_markup?:
|
|
550
|
+
| InlineKeyboardMarkup
|
|
551
|
+
| ReplyKeyboardMarkup
|
|
552
|
+
| ReplyKeyboardRemove
|
|
553
|
+
| ForceReply;
|
|
554
|
+
} & methodParams;
|
|
555
|
+
|
|
556
|
+
export const sendContact = (params: sendContactParams): APIResponse<Message> =>
|
|
557
|
+
requestTelegramAPI("sendContact", params);
|
|
558
|
+
|
|
559
|
+
export type sendPollParams = {
|
|
560
|
+
chat_id: string | number;
|
|
561
|
+
question: string;
|
|
562
|
+
options: InputPollOption[];
|
|
563
|
+
business_connection_id?: string;
|
|
564
|
+
message_thread_id?: number;
|
|
565
|
+
question_parse_mode?: string;
|
|
566
|
+
question_entities?: MessageEntity[];
|
|
567
|
+
is_anonymous?: boolean;
|
|
568
|
+
type?: string;
|
|
569
|
+
allows_multiple_answers?: boolean;
|
|
570
|
+
correct_option_id?: number;
|
|
571
|
+
explanation?: string;
|
|
572
|
+
explanation_parse_mode?: string;
|
|
573
|
+
explanation_entities?: MessageEntity[];
|
|
574
|
+
open_period?: number;
|
|
575
|
+
close_date?: number;
|
|
576
|
+
is_closed?: boolean;
|
|
577
|
+
disable_notification?: boolean;
|
|
578
|
+
protect_content?: boolean;
|
|
579
|
+
allow_paid_broadcast?: boolean;
|
|
580
|
+
message_effect_id?: string;
|
|
581
|
+
reply_parameters?: ReplyParameters;
|
|
582
|
+
reply_markup?:
|
|
583
|
+
| InlineKeyboardMarkup
|
|
584
|
+
| ReplyKeyboardMarkup
|
|
585
|
+
| ReplyKeyboardRemove
|
|
586
|
+
| ForceReply;
|
|
587
|
+
} & methodParams;
|
|
588
|
+
|
|
589
|
+
export const sendPoll = (params: sendPollParams): APIResponse<Message> => {
|
|
590
|
+
params.question_parse_mode ||= "HTML";
|
|
591
|
+
params.explanation_parse_mode ||= "HTML";
|
|
592
|
+
return requestTelegramAPI("sendPoll", params);
|
|
593
|
+
};
|
|
594
|
+
|
|
595
|
+
export type sendDiceParams = {
|
|
596
|
+
chat_id: string | number;
|
|
597
|
+
emoji: string;
|
|
598
|
+
business_connection_id?: string;
|
|
599
|
+
message_thread_id?: number;
|
|
600
|
+
disable_notification?: boolean;
|
|
601
|
+
protect_content?: boolean;
|
|
602
|
+
allow_paid_broadcast?: boolean;
|
|
603
|
+
message_effect_id?: string;
|
|
604
|
+
reply_parameters?: ReplyParameters;
|
|
605
|
+
reply_markup?:
|
|
606
|
+
| InlineKeyboardMarkup
|
|
607
|
+
| ReplyKeyboardMarkup
|
|
608
|
+
| ReplyKeyboardRemove
|
|
609
|
+
| ForceReply;
|
|
610
|
+
} & methodParams;
|
|
611
|
+
|
|
612
|
+
export const sendDice = (params: sendDiceParams): APIResponse<Message> =>
|
|
613
|
+
requestTelegramAPI("sendDice", params);
|
|
614
|
+
|
|
615
|
+
export type sendChatActionParams = {
|
|
616
|
+
chat_id: string | number;
|
|
617
|
+
action: string;
|
|
618
|
+
business_connection_id?: string;
|
|
619
|
+
message_thread_id?: number;
|
|
620
|
+
} & methodParams;
|
|
621
|
+
|
|
622
|
+
export const sendChatAction = (params: sendChatActionParams): APIResponse =>
|
|
623
|
+
requestTelegramAPI("sendChatAction", params);
|
|
624
|
+
|
|
625
|
+
export type setMessageReactionParams = {
|
|
626
|
+
chat_id: string | number;
|
|
627
|
+
message_id: number;
|
|
628
|
+
reaction?: ReactionType[];
|
|
629
|
+
is_big?: boolean;
|
|
630
|
+
} & methodParams;
|
|
631
|
+
|
|
632
|
+
export const setMessageReaction = (
|
|
633
|
+
params: setMessageReactionParams,
|
|
634
|
+
): APIResponse => requestTelegramAPI("setMessageReaction", params);
|
|
635
|
+
|
|
636
|
+
export type getUserProfilePhotosParams = {
|
|
637
|
+
user_id: number;
|
|
638
|
+
offset?: number;
|
|
639
|
+
limit?: number;
|
|
640
|
+
} & methodParams;
|
|
641
|
+
|
|
642
|
+
export const getUserProfilePhotos = (
|
|
643
|
+
params: getUserProfilePhotosParams,
|
|
644
|
+
): APIResponse<UserProfilePhotos> =>
|
|
645
|
+
requestTelegramAPI("getUserProfilePhotos", params);
|
|
646
|
+
|
|
647
|
+
export type setUserEmojiStatusParams = {
|
|
648
|
+
user_id: number;
|
|
649
|
+
emoji_status_custom_emoji_id?: string;
|
|
650
|
+
emoji_status_expiration_date?: string;
|
|
651
|
+
} & methodParams;
|
|
652
|
+
|
|
653
|
+
export const setUserEmojiStatus = (
|
|
654
|
+
params: setUserEmojiStatusParams,
|
|
655
|
+
): APIResponse => requestTelegramAPI("setUserEmojiStatus", params);
|
|
656
|
+
|
|
657
|
+
export type getFileParams = {
|
|
658
|
+
file_id: string;
|
|
659
|
+
} & methodParams;
|
|
660
|
+
|
|
661
|
+
export const getFile = (params: getFileParams): APIResponse<File> =>
|
|
662
|
+
requestTelegramAPI("getFile", params);
|
|
663
|
+
|
|
664
|
+
export type banChatMemberParams = {
|
|
665
|
+
chat_id: string | number;
|
|
666
|
+
user_id: number;
|
|
667
|
+
until_date?: number;
|
|
668
|
+
revoke_messages?: boolean;
|
|
669
|
+
} & methodParams;
|
|
670
|
+
|
|
671
|
+
export const banChatMember = (params: banChatMemberParams): APIResponse =>
|
|
672
|
+
requestTelegramAPI("banChatMember", params);
|
|
673
|
+
|
|
674
|
+
export type unbanChatMemberParams = {
|
|
675
|
+
chat_id: string | number;
|
|
676
|
+
user_id: number;
|
|
677
|
+
only_if_banned?: boolean;
|
|
678
|
+
} & methodParams;
|
|
679
|
+
|
|
680
|
+
export const unbanChatMember = (params: unbanChatMemberParams): APIResponse =>
|
|
681
|
+
requestTelegramAPI("unbanChatMember", params);
|
|
682
|
+
|
|
683
|
+
export type restrictChatMemberParams = {
|
|
684
|
+
chat_id: string | number;
|
|
685
|
+
user_id: number;
|
|
686
|
+
permissions: ChatPermissions;
|
|
687
|
+
use_independent_chat_permissions?: boolean;
|
|
688
|
+
until_date?: number;
|
|
689
|
+
} & methodParams;
|
|
690
|
+
|
|
691
|
+
export const restrictChatMember = (
|
|
692
|
+
params: restrictChatMemberParams,
|
|
693
|
+
): APIResponse => requestTelegramAPI("restrictChatMember", params);
|
|
694
|
+
|
|
695
|
+
export type promoteChatMemberParams = {
|
|
696
|
+
chat_id: string | number;
|
|
697
|
+
user_id: number;
|
|
698
|
+
is_anonymous?: boolean;
|
|
699
|
+
can_manage_chat?: boolean;
|
|
700
|
+
can_delete_messages?: boolean;
|
|
701
|
+
can_manage_video_chats?: boolean;
|
|
702
|
+
can_restrict_members?: boolean;
|
|
703
|
+
can_promote_members?: boolean;
|
|
704
|
+
can_change_info?: boolean;
|
|
705
|
+
can_invite_users?: boolean;
|
|
706
|
+
can_post_stories?: boolean;
|
|
707
|
+
can_edit_stories?: boolean;
|
|
708
|
+
can_delete_stories?: boolean;
|
|
709
|
+
can_post_messages?: boolean;
|
|
710
|
+
can_edit_messages?: boolean;
|
|
711
|
+
can_pin_messages?: boolean;
|
|
712
|
+
can_manage_topics?: boolean;
|
|
713
|
+
} & methodParams;
|
|
714
|
+
|
|
715
|
+
export const promoteChatMember = (
|
|
716
|
+
params: promoteChatMemberParams,
|
|
717
|
+
): APIResponse => requestTelegramAPI("promoteChatMember", params);
|
|
718
|
+
|
|
719
|
+
export type setChatAdministratorCustomTitleParams = {
|
|
720
|
+
chat_id: string | number;
|
|
721
|
+
user_id: number;
|
|
722
|
+
custom_title: string;
|
|
723
|
+
} & methodParams;
|
|
724
|
+
|
|
725
|
+
export const setChatAdministratorCustomTitle = (
|
|
726
|
+
params: setChatAdministratorCustomTitleParams,
|
|
727
|
+
): APIResponse => requestTelegramAPI("setChatAdministratorCustomTitle", params);
|
|
728
|
+
|
|
729
|
+
export type banChatSenderChatParams = {
|
|
730
|
+
chat_id: string | number;
|
|
731
|
+
sender_chat_id: number;
|
|
732
|
+
} & methodParams;
|
|
733
|
+
|
|
734
|
+
export const banChatSenderChat = (
|
|
735
|
+
params: banChatSenderChatParams,
|
|
736
|
+
): APIResponse => requestTelegramAPI("banChatSenderChat", params);
|
|
737
|
+
|
|
738
|
+
export type unbanChatSenderChatParams = {
|
|
739
|
+
chat_id: string | number;
|
|
740
|
+
sender_chat_id: number;
|
|
741
|
+
} & methodParams;
|
|
742
|
+
|
|
743
|
+
export const unbanChatSenderChat = (
|
|
744
|
+
params: unbanChatSenderChatParams,
|
|
745
|
+
): APIResponse => requestTelegramAPI("unbanChatSenderChat", params);
|
|
746
|
+
|
|
747
|
+
export type setChatPermissionsParams = {
|
|
748
|
+
chat_id: string | number;
|
|
749
|
+
permissions: ChatPermissions;
|
|
750
|
+
use_independent_chat_permissions?: boolean;
|
|
751
|
+
} & methodParams;
|
|
752
|
+
|
|
753
|
+
export const setChatPermissions = (
|
|
754
|
+
params: setChatPermissionsParams,
|
|
755
|
+
): APIResponse => requestTelegramAPI("setChatPermissions", params);
|
|
756
|
+
|
|
757
|
+
export type exportChatInviteLinkParams = {
|
|
758
|
+
chat_id: string | number;
|
|
759
|
+
} & methodParams;
|
|
760
|
+
|
|
761
|
+
export const exportChatInviteLink = (
|
|
762
|
+
params: exportChatInviteLinkParams,
|
|
763
|
+
): APIResponse<string> => requestTelegramAPI("exportChatInviteLink", params);
|
|
764
|
+
|
|
765
|
+
export type createChatInviteLinkParams = {
|
|
766
|
+
chat_id: string | number;
|
|
767
|
+
name?: string;
|
|
768
|
+
expire_date?: number;
|
|
769
|
+
member_limit?: number;
|
|
770
|
+
creates_join_request?: number;
|
|
771
|
+
} & methodParams;
|
|
772
|
+
|
|
773
|
+
export const createChatInviteLink = (
|
|
774
|
+
params: createChatInviteLinkParams,
|
|
775
|
+
): APIResponse<ChatInviteLink> =>
|
|
776
|
+
requestTelegramAPI("createChatInviteLink", params);
|
|
777
|
+
|
|
778
|
+
export type editChatInviteLinkParams = {
|
|
779
|
+
chat_id: string | number;
|
|
780
|
+
invite_link: string;
|
|
781
|
+
name?: string;
|
|
782
|
+
expire_date?: number;
|
|
783
|
+
member_limit?: number;
|
|
784
|
+
creates_join_request?: number;
|
|
785
|
+
} & methodParams;
|
|
786
|
+
|
|
787
|
+
export const editChatInviteLink = (
|
|
788
|
+
params: editChatInviteLinkParams,
|
|
789
|
+
): APIResponse<ChatInviteLink> =>
|
|
790
|
+
requestTelegramAPI("editChatInviteLink", params);
|
|
791
|
+
|
|
792
|
+
export type createChatSubscriptionInviteLinkParams = {
|
|
793
|
+
chat_id: string | number;
|
|
794
|
+
name?: string;
|
|
795
|
+
subscription_period: number;
|
|
796
|
+
subscription_price: number;
|
|
797
|
+
} & methodParams;
|
|
798
|
+
|
|
799
|
+
export const createChatSubscriptionInviteLink = (
|
|
800
|
+
params: createChatSubscriptionInviteLinkParams,
|
|
801
|
+
): APIResponse<ChatInviteLink> =>
|
|
802
|
+
requestTelegramAPI("createChatSubscriptionInviteLink", params);
|
|
803
|
+
|
|
804
|
+
export type editChatSubscriptionInviteLinkParams = {
|
|
805
|
+
chat_id: string | number;
|
|
806
|
+
invite_link: string;
|
|
807
|
+
name?: string;
|
|
808
|
+
} & methodParams;
|
|
809
|
+
|
|
810
|
+
export const editChatSubscriptionInviteLink = (
|
|
811
|
+
params: editChatSubscriptionInviteLinkParams,
|
|
812
|
+
): APIResponse<ChatInviteLink> =>
|
|
813
|
+
requestTelegramAPI("editChatSubscriptionInviteLink", params);
|
|
814
|
+
|
|
815
|
+
export type revokeChatInviteLinkParams = {
|
|
816
|
+
chat_id: string | number;
|
|
817
|
+
invite_link: string;
|
|
818
|
+
} & methodParams;
|
|
819
|
+
|
|
820
|
+
export const revokeChatInviteLink = (
|
|
821
|
+
params: revokeChatInviteLinkParams,
|
|
822
|
+
): APIResponse<ChatInviteLink> =>
|
|
823
|
+
requestTelegramAPI("revokeChatInviteLink", params);
|
|
824
|
+
|
|
825
|
+
export type approveChatJoinRequestParams = {
|
|
826
|
+
chat_id: string | number;
|
|
827
|
+
user_id: number;
|
|
828
|
+
} & methodParams;
|
|
829
|
+
|
|
830
|
+
export const approveChatJoinRequest = (
|
|
831
|
+
params: approveChatJoinRequestParams,
|
|
832
|
+
): APIResponse => requestTelegramAPI("approveChatJoinRequest", params);
|
|
833
|
+
|
|
834
|
+
export type declineChatJoinRequestParams = {
|
|
835
|
+
chat_id: string | number;
|
|
836
|
+
user_id: number;
|
|
837
|
+
} & methodParams;
|
|
838
|
+
|
|
839
|
+
export const declineChatJoinRequest = (
|
|
840
|
+
params: declineChatJoinRequestParams,
|
|
841
|
+
): APIResponse => requestTelegramAPI("declineChatJoinRequest", params);
|
|
842
|
+
|
|
843
|
+
export type setChatPhotoParams = {
|
|
844
|
+
chat_id: string | number;
|
|
845
|
+
photo: InputFile;
|
|
846
|
+
} & methodParams;
|
|
847
|
+
|
|
848
|
+
export const setChatPhoto = (params: setChatPhotoParams): APIResponse =>
|
|
849
|
+
requestTelegramAPI("setChatPhoto", params);
|
|
850
|
+
|
|
851
|
+
export type deleteChatPhotoParams = {
|
|
852
|
+
chat_id: string | number;
|
|
853
|
+
} & methodParams;
|
|
854
|
+
|
|
855
|
+
export const deleteChatPhoto = (params: deleteChatPhotoParams): APIResponse =>
|
|
856
|
+
requestTelegramAPI("deleteChatPhoto", params);
|
|
857
|
+
|
|
858
|
+
export type setChatTitleParams = {
|
|
859
|
+
chat_id: string | number;
|
|
860
|
+
title: string;
|
|
861
|
+
} & methodParams;
|
|
862
|
+
|
|
863
|
+
export const setChatTitle = (params: setChatTitleParams): APIResponse =>
|
|
864
|
+
requestTelegramAPI("setChatTitle", params);
|
|
865
|
+
|
|
866
|
+
export type setChatDescriptionParams = {
|
|
867
|
+
chat_id: string | number;
|
|
868
|
+
description: string;
|
|
869
|
+
} & methodParams;
|
|
870
|
+
|
|
871
|
+
export const setChatDescription = (
|
|
872
|
+
params: setChatDescriptionParams,
|
|
873
|
+
): APIResponse => requestTelegramAPI("setChatDescription", params);
|
|
874
|
+
|
|
875
|
+
export type pinChatMessageParams = {
|
|
876
|
+
chat_id: string | number;
|
|
877
|
+
message_id: number;
|
|
878
|
+
business_connection_id?: string;
|
|
879
|
+
disable_notification?: boolean;
|
|
880
|
+
} & methodParams;
|
|
881
|
+
|
|
882
|
+
export const pinChatMessage = (params: pinChatMessageParams): APIResponse =>
|
|
883
|
+
requestTelegramAPI("pinChatMessage", params);
|
|
884
|
+
|
|
885
|
+
export type unpinChatMessageParams = {
|
|
886
|
+
chat_id: string | number;
|
|
887
|
+
message_id?: number;
|
|
888
|
+
business_connection_id?: string;
|
|
889
|
+
} & methodParams;
|
|
890
|
+
|
|
891
|
+
export const unpinChatMessage = (params: unpinChatMessageParams): APIResponse =>
|
|
892
|
+
requestTelegramAPI("unpinChatMessage", params);
|
|
893
|
+
|
|
894
|
+
export type unpinAllChatMessagesParams = {
|
|
895
|
+
chat_id: string | number;
|
|
896
|
+
} & methodParams;
|
|
897
|
+
|
|
898
|
+
export const unpinAllChatMessages = (
|
|
899
|
+
params: unpinAllChatMessagesParams,
|
|
900
|
+
): APIResponse => requestTelegramAPI("unpinAllChatMessages", params);
|
|
901
|
+
|
|
902
|
+
export type leaveChatParams = {
|
|
903
|
+
chat_id: string | number;
|
|
904
|
+
} & methodParams;
|
|
905
|
+
|
|
906
|
+
export const leaveChat = (params: leaveChatParams): APIResponse =>
|
|
907
|
+
requestTelegramAPI("leaveChat", params);
|
|
908
|
+
|
|
909
|
+
export type getChatParams = {
|
|
910
|
+
chat_id: string | number;
|
|
911
|
+
} & methodParams;
|
|
912
|
+
|
|
913
|
+
export const getChat = (params: getChatParams): APIResponse<ChatFullInfo> =>
|
|
914
|
+
requestTelegramAPI("getChat", params);
|
|
915
|
+
|
|
916
|
+
export type getChatAdministratorsParams = {
|
|
917
|
+
chat_id: string | number;
|
|
918
|
+
} & methodParams;
|
|
919
|
+
|
|
920
|
+
export const getChatAdministrators = (
|
|
921
|
+
params: getChatAdministratorsParams,
|
|
922
|
+
): APIResponse<ChatMember[]> =>
|
|
923
|
+
requestTelegramAPI("getChatAdministrators", params);
|
|
924
|
+
|
|
925
|
+
export type getChatMemberCountParams = {
|
|
926
|
+
chat_id: string | number;
|
|
927
|
+
} & methodParams;
|
|
928
|
+
|
|
929
|
+
export const getChatMemberCount = (
|
|
930
|
+
params: getChatMemberCountParams,
|
|
931
|
+
): APIResponse<number> => requestTelegramAPI("getChatMemberCount", params);
|
|
932
|
+
|
|
933
|
+
export type getChatMemberParams = {
|
|
934
|
+
chat_id: string | number;
|
|
935
|
+
user_id: number;
|
|
936
|
+
} & methodParams;
|
|
937
|
+
|
|
938
|
+
export const getChatMember = (
|
|
939
|
+
params: getChatMemberParams,
|
|
940
|
+
): APIResponse<ChatMember> => requestTelegramAPI("getChatMember", params);
|
|
941
|
+
|
|
942
|
+
export type setChatStickerSetParams = {
|
|
943
|
+
chat_id: string | number;
|
|
944
|
+
sticker_set_name: string;
|
|
945
|
+
} & methodParams;
|
|
946
|
+
|
|
947
|
+
export const setChatStickerSet = (
|
|
948
|
+
params: setChatStickerSetParams,
|
|
949
|
+
): APIResponse => requestTelegramAPI("setChatStickerSet", params);
|
|
950
|
+
|
|
951
|
+
export type deleteChatStickerSetParams = {
|
|
952
|
+
chat_id: string | number;
|
|
953
|
+
} & methodParams;
|
|
954
|
+
|
|
955
|
+
export const deleteChatStickerSet = (
|
|
956
|
+
params: deleteChatStickerSetParams,
|
|
957
|
+
): APIResponse => requestTelegramAPI("deleteChatStickerSet", params);
|
|
958
|
+
|
|
959
|
+
export type getForumTopicIconStickersParams = {} & methodParams;
|
|
960
|
+
|
|
961
|
+
export const getForumTopicIconStickers = (
|
|
962
|
+
params: getForumTopicIconStickersParams,
|
|
963
|
+
): APIResponse<Sticker[]> =>
|
|
964
|
+
requestTelegramAPI("getForumTopicIconStickers", params);
|
|
965
|
+
|
|
966
|
+
export type createForumTopicParams = {
|
|
967
|
+
chat_id: string | number;
|
|
968
|
+
name: string;
|
|
969
|
+
icon_color?: number;
|
|
970
|
+
icon_custom_emoji_id?: string;
|
|
971
|
+
} & methodParams;
|
|
972
|
+
|
|
973
|
+
export const createForumTopic = (
|
|
974
|
+
params: createForumTopicParams,
|
|
975
|
+
): APIResponse<ForumTopic> => requestTelegramAPI("createForumTopic", params);
|
|
976
|
+
|
|
977
|
+
export type editForumTopicParams = {
|
|
978
|
+
chat_id: string | number;
|
|
979
|
+
message_thread_id: number;
|
|
980
|
+
name?: string;
|
|
981
|
+
icon_custom_emoji_id?: string;
|
|
982
|
+
} & methodParams;
|
|
983
|
+
|
|
984
|
+
export const editForumTopic = (params: editForumTopicParams): APIResponse =>
|
|
985
|
+
requestTelegramAPI("editForumTopic", params);
|
|
986
|
+
|
|
987
|
+
export type closeForumTopicParams = {
|
|
988
|
+
chat_id: string | number;
|
|
989
|
+
message_thread_id: number;
|
|
990
|
+
} & methodParams;
|
|
991
|
+
|
|
992
|
+
export const closeForumTopic = (params: closeForumTopicParams): APIResponse =>
|
|
993
|
+
requestTelegramAPI("closeForumTopic", params);
|
|
994
|
+
|
|
995
|
+
export type reopenForumTopicParams = {
|
|
996
|
+
chat_id: string | number;
|
|
997
|
+
message_thread_id: number;
|
|
998
|
+
} & methodParams;
|
|
999
|
+
|
|
1000
|
+
export const reopenForumTopic = (params: reopenForumTopicParams): APIResponse =>
|
|
1001
|
+
requestTelegramAPI("reopenForumTopic", params);
|
|
1002
|
+
|
|
1003
|
+
export type deleteForumTopicParams = {
|
|
1004
|
+
chat_id: string | number;
|
|
1005
|
+
message_thread_id: number;
|
|
1006
|
+
} & methodParams;
|
|
1007
|
+
|
|
1008
|
+
export const deleteForumTopic = (params: deleteForumTopicParams): APIResponse =>
|
|
1009
|
+
requestTelegramAPI("deleteForumTopic", params);
|
|
1010
|
+
|
|
1011
|
+
export type unpinAllForumTopicMessagesParams = {
|
|
1012
|
+
chat_id: string | number;
|
|
1013
|
+
message_thread_id: number;
|
|
1014
|
+
} & methodParams;
|
|
1015
|
+
|
|
1016
|
+
export const unpinAllForumTopicMessages = (
|
|
1017
|
+
params: unpinAllForumTopicMessagesParams,
|
|
1018
|
+
): APIResponse => requestTelegramAPI("unpinAllForumTopicMessages", params);
|
|
1019
|
+
|
|
1020
|
+
export type editGeneralForumTopicParams = {
|
|
1021
|
+
chat_id: string | number;
|
|
1022
|
+
name: string;
|
|
1023
|
+
} & methodParams;
|
|
1024
|
+
|
|
1025
|
+
export const editGeneralForumTopic = (
|
|
1026
|
+
params: editGeneralForumTopicParams,
|
|
1027
|
+
): APIResponse => requestTelegramAPI("editGeneralForumTopic", params);
|
|
1028
|
+
|
|
1029
|
+
export type closeGeneralForumTopicParams = {
|
|
1030
|
+
chat_id: string | number;
|
|
1031
|
+
} & methodParams;
|
|
1032
|
+
|
|
1033
|
+
export const closeGeneralForumTopic = (
|
|
1034
|
+
params: closeGeneralForumTopicParams,
|
|
1035
|
+
): APIResponse => requestTelegramAPI("closeGeneralForumTopic", params);
|
|
1036
|
+
|
|
1037
|
+
export type reopenGeneralForumTopicParams = {
|
|
1038
|
+
chat_id: string | number;
|
|
1039
|
+
} & methodParams;
|
|
1040
|
+
|
|
1041
|
+
export const reopenGeneralForumTopic = (
|
|
1042
|
+
params: reopenGeneralForumTopicParams,
|
|
1043
|
+
): APIResponse => requestTelegramAPI("reopenGeneralForumTopic", params);
|
|
1044
|
+
|
|
1045
|
+
export type hideGeneralForumTopicParams = {
|
|
1046
|
+
chat_id: string | number;
|
|
1047
|
+
} & methodParams;
|
|
1048
|
+
|
|
1049
|
+
export const hideGeneralForumTopic = (
|
|
1050
|
+
params: hideGeneralForumTopicParams,
|
|
1051
|
+
): APIResponse => requestTelegramAPI("hideGeneralForumTopic", params);
|
|
1052
|
+
|
|
1053
|
+
export type unhideGeneralForumTopicParams = {
|
|
1054
|
+
chat_id: string | number;
|
|
1055
|
+
} & methodParams;
|
|
1056
|
+
|
|
1057
|
+
export const unhideGeneralForumTopic = (
|
|
1058
|
+
params: unhideGeneralForumTopicParams,
|
|
1059
|
+
): APIResponse => requestTelegramAPI("unhideGeneralForumTopic", params);
|
|
1060
|
+
|
|
1061
|
+
export type unpinAllGeneralForumTopicMessagesParams = {
|
|
1062
|
+
chat_id: string | number;
|
|
1063
|
+
} & methodParams;
|
|
1064
|
+
|
|
1065
|
+
export const unpinAllGeneralForumTopicMessages = (
|
|
1066
|
+
params: unpinAllGeneralForumTopicMessagesParams,
|
|
1067
|
+
): APIResponse =>
|
|
1068
|
+
requestTelegramAPI("unpinAllGeneralForumTopicMessages", params);
|
|
1069
|
+
|
|
1070
|
+
export type answerCallbackQueryParams = {
|
|
1071
|
+
callback_query_id: string;
|
|
1072
|
+
text?: string;
|
|
1073
|
+
show_alert?: boolean;
|
|
1074
|
+
url?: string;
|
|
1075
|
+
cache_time?: number;
|
|
1076
|
+
} & methodParams;
|
|
1077
|
+
|
|
1078
|
+
export const answerCallbackQuery = (
|
|
1079
|
+
params: answerCallbackQueryParams,
|
|
1080
|
+
): APIResponse => requestTelegramAPI("answerCallbackQuery", params);
|
|
1081
|
+
|
|
1082
|
+
export type getUserChatBoostsParams = {
|
|
1083
|
+
chat_id: string | number;
|
|
1084
|
+
user_id: number;
|
|
1085
|
+
} & methodParams;
|
|
1086
|
+
|
|
1087
|
+
export const getUserChatBoosts = (
|
|
1088
|
+
params: getUserChatBoostsParams,
|
|
1089
|
+
): APIResponse<any> => requestTelegramAPI("getUserChatBoosts", params);
|
|
1090
|
+
|
|
1091
|
+
export type getBusinessConnectionParams = {
|
|
1092
|
+
business_connection_id: string;
|
|
1093
|
+
} & methodParams;
|
|
1094
|
+
|
|
1095
|
+
export const getBusinessConnection = (
|
|
1096
|
+
params: getBusinessConnectionParams,
|
|
1097
|
+
): APIResponse<BusinessConnection> =>
|
|
1098
|
+
requestTelegramAPI("getBusinessConnection", params);
|
|
1099
|
+
|
|
1100
|
+
export type setMyCommandsParams = {
|
|
1101
|
+
commands: BotCommand[];
|
|
1102
|
+
scope?: BotCommandScope;
|
|
1103
|
+
language_code?: string;
|
|
1104
|
+
} & methodParams;
|
|
1105
|
+
|
|
1106
|
+
export const setMyCommands = (params: setMyCommandsParams): APIResponse =>
|
|
1107
|
+
requestTelegramAPI("setMyCommands", params);
|
|
1108
|
+
|
|
1109
|
+
export type deleteMyCommandsParams = {
|
|
1110
|
+
scope?: BotCommandScope;
|
|
1111
|
+
language_code?: string;
|
|
1112
|
+
} & methodParams;
|
|
1113
|
+
|
|
1114
|
+
export const deleteMyCommands = (params: deleteMyCommandsParams): APIResponse =>
|
|
1115
|
+
requestTelegramAPI("deleteMyCommands", params);
|
|
1116
|
+
|
|
1117
|
+
export type getMyCommandsParams = {
|
|
1118
|
+
scope?: BotCommandScope;
|
|
1119
|
+
language_code?: string;
|
|
1120
|
+
} & methodParams;
|
|
1121
|
+
|
|
1122
|
+
export const getMyCommands = (
|
|
1123
|
+
params: getMyCommandsParams,
|
|
1124
|
+
): APIResponse<BotCommand[]> => requestTelegramAPI("getMyCommands", params);
|
|
1125
|
+
|
|
1126
|
+
export type setMyNameParams = {
|
|
1127
|
+
name?: BotCommandScope;
|
|
1128
|
+
language_code?: string;
|
|
1129
|
+
} & methodParams;
|
|
1130
|
+
|
|
1131
|
+
export const setMyName = (params: setMyNameParams): APIResponse =>
|
|
1132
|
+
requestTelegramAPI("setMyName", params);
|
|
1133
|
+
|
|
1134
|
+
export type getMyNameParams = {
|
|
1135
|
+
language_code?: string;
|
|
1136
|
+
} & methodParams;
|
|
1137
|
+
|
|
1138
|
+
export const getMyName = (params: getMyNameParams): APIResponse<BotName> =>
|
|
1139
|
+
requestTelegramAPI("getMyName", params);
|
|
1140
|
+
|
|
1141
|
+
export type setMyDescriptionParams = {
|
|
1142
|
+
description?: BotCommandScope;
|
|
1143
|
+
language_code?: string;
|
|
1144
|
+
} & methodParams;
|
|
1145
|
+
|
|
1146
|
+
export const setMyDescription = (params: setMyDescriptionParams): APIResponse =>
|
|
1147
|
+
requestTelegramAPI("setMyDescription", params);
|
|
1148
|
+
|
|
1149
|
+
export type getMyDescriptionParams = {
|
|
1150
|
+
language_code?: string;
|
|
1151
|
+
} & methodParams;
|
|
1152
|
+
|
|
1153
|
+
export const getMyDescription = (
|
|
1154
|
+
params: getMyDescriptionParams,
|
|
1155
|
+
): APIResponse<BotDescription> =>
|
|
1156
|
+
requestTelegramAPI("getMyDescription", params);
|
|
1157
|
+
|
|
1158
|
+
export type setMyShortDescriptionParams = {
|
|
1159
|
+
short_description?: BotCommandScope;
|
|
1160
|
+
language_code?: string;
|
|
1161
|
+
} & methodParams;
|
|
1162
|
+
|
|
1163
|
+
export const setMyShortDescription = (
|
|
1164
|
+
params: setMyShortDescriptionParams,
|
|
1165
|
+
): APIResponse => requestTelegramAPI("setMyShortDescription", params);
|
|
1166
|
+
|
|
1167
|
+
export type getMyShortDescriptionParams = {
|
|
1168
|
+
language_code?: string;
|
|
1169
|
+
} & methodParams;
|
|
1170
|
+
|
|
1171
|
+
export const getMyShortDescription = (
|
|
1172
|
+
params: getMyShortDescriptionParams,
|
|
1173
|
+
): APIResponse<BotShortDescription> =>
|
|
1174
|
+
requestTelegramAPI("getMyShortDescription", params);
|
|
1175
|
+
|
|
1176
|
+
export type setChatMenuButtonParams = {
|
|
1177
|
+
chat_id?: number;
|
|
1178
|
+
menu_button?: MenuButton;
|
|
1179
|
+
} & methodParams;
|
|
1180
|
+
|
|
1181
|
+
export const setChatMenuButton = (
|
|
1182
|
+
params: setChatMenuButtonParams,
|
|
1183
|
+
): APIResponse => requestTelegramAPI("setChatMenuButton", params);
|
|
1184
|
+
|
|
1185
|
+
export type getChatMenuButtonParams = {
|
|
1186
|
+
chat_id?: number;
|
|
1187
|
+
} & methodParams;
|
|
1188
|
+
|
|
1189
|
+
export const getChatMenuButton = (
|
|
1190
|
+
params: getChatMenuButtonParams,
|
|
1191
|
+
): APIResponse<MenuButton> => requestTelegramAPI("getChatMenuButton", params);
|
|
1192
|
+
|
|
1193
|
+
export type setMyDefaultAdministratorRightsParams = {
|
|
1194
|
+
rights?: ChatAdministratorRights;
|
|
1195
|
+
for_channel?: boolean;
|
|
1196
|
+
} & methodParams;
|
|
1197
|
+
|
|
1198
|
+
export const setMyDefaultAdministratorRights = (
|
|
1199
|
+
params: setMyDefaultAdministratorRightsParams,
|
|
1200
|
+
): APIResponse => requestTelegramAPI("setMyDefaultAdministratorRights", params);
|
|
1201
|
+
|
|
1202
|
+
export type getMyDefaultAdministratorRightsParams = {
|
|
1203
|
+
for_channels?: boolean;
|
|
1204
|
+
} & methodParams;
|
|
1205
|
+
|
|
1206
|
+
export const getMyDefaultAdministratorRights = (
|
|
1207
|
+
params: getMyDefaultAdministratorRightsParams,
|
|
1208
|
+
): APIResponse<ChatAdministratorRights> =>
|
|
1209
|
+
requestTelegramAPI("getMyDefaultAdministratorRights", params);
|
|
1210
|
+
|
|
1211
|
+
export type editMessageTextParams = {
|
|
1212
|
+
text: string;
|
|
1213
|
+
chat_id?: string | number;
|
|
1214
|
+
business_connection_id?: string;
|
|
1215
|
+
message_id?: number;
|
|
1216
|
+
inline_message_id?: string;
|
|
1217
|
+
parse_mode?: string;
|
|
1218
|
+
entities?: MessageEntity[];
|
|
1219
|
+
link_preview_options?: LinkPreviewOptions;
|
|
1220
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
1221
|
+
} & methodParams;
|
|
1222
|
+
|
|
1223
|
+
export const editMessageText = (
|
|
1224
|
+
params: editMessageTextParams,
|
|
1225
|
+
): APIResponse<Message | true> => {
|
|
1226
|
+
params.parse_mode ||= "HTML";
|
|
1227
|
+
return requestTelegramAPI("editMessageText", params);
|
|
1228
|
+
};
|
|
1229
|
+
|
|
1230
|
+
export type editMessageCaptionParams = {
|
|
1231
|
+
caption?: string;
|
|
1232
|
+
chat_id?: string | number;
|
|
1233
|
+
business_connection_id?: string;
|
|
1234
|
+
message_id?: number;
|
|
1235
|
+
inline_message_id?: string;
|
|
1236
|
+
parse_mode?: string;
|
|
1237
|
+
caption_entities?: MessageEntity[];
|
|
1238
|
+
show_caption_above_media?: boolean;
|
|
1239
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
1240
|
+
} & methodParams;
|
|
1241
|
+
|
|
1242
|
+
export const editMessageCaption = (
|
|
1243
|
+
params: editMessageCaptionParams,
|
|
1244
|
+
): APIResponse<Message | true> => {
|
|
1245
|
+
params.parse_mode ||= "HTML";
|
|
1246
|
+
return requestTelegramAPI("editMessageCaption", params);
|
|
1247
|
+
};
|
|
1248
|
+
|
|
1249
|
+
export type editMessageMediaParams = {
|
|
1250
|
+
media: InputMedia;
|
|
1251
|
+
chat_id?: string | number;
|
|
1252
|
+
business_connection_id?: string;
|
|
1253
|
+
message_id?: number;
|
|
1254
|
+
inline_message_id?: string;
|
|
1255
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
1256
|
+
} & methodParams;
|
|
1257
|
+
|
|
1258
|
+
export const editMessageMedia = (
|
|
1259
|
+
params: editMessageMediaParams,
|
|
1260
|
+
): APIResponse<Message | true> =>
|
|
1261
|
+
requestTelegramAPI("editMessageMedia", params);
|
|
1262
|
+
|
|
1263
|
+
export type editMessageLiveLocationParams = {
|
|
1264
|
+
latitude: number;
|
|
1265
|
+
longitude: number;
|
|
1266
|
+
chat_id?: string | number;
|
|
1267
|
+
business_connection_id?: string;
|
|
1268
|
+
message_id?: number;
|
|
1269
|
+
inline_message_id?: string;
|
|
1270
|
+
live_period?: number;
|
|
1271
|
+
horizontal_accuracy?: number;
|
|
1272
|
+
heading?: number;
|
|
1273
|
+
proximity_alert_radius?: number;
|
|
1274
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
1275
|
+
} & methodParams;
|
|
1276
|
+
|
|
1277
|
+
export const editMessageLiveLocation = (
|
|
1278
|
+
params: editMessageLiveLocationParams,
|
|
1279
|
+
): APIResponse<Message | true> =>
|
|
1280
|
+
requestTelegramAPI("editMessageLiveLocation", params);
|
|
1281
|
+
|
|
1282
|
+
export type stopMessageLiveLocationParams = {
|
|
1283
|
+
chat_id?: string | number;
|
|
1284
|
+
business_connection_id?: string;
|
|
1285
|
+
message_id?: number;
|
|
1286
|
+
inline_message_id?: string;
|
|
1287
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
1288
|
+
} & methodParams;
|
|
1289
|
+
|
|
1290
|
+
export const stopMessageLiveLocation = (
|
|
1291
|
+
params: stopMessageLiveLocationParams,
|
|
1292
|
+
): APIResponse<Message | true> =>
|
|
1293
|
+
requestTelegramAPI("stopMessageLiveLocation", params);
|
|
1294
|
+
|
|
1295
|
+
export type editMessageReplyMarkupParams = {
|
|
1296
|
+
chat_id?: string | number;
|
|
1297
|
+
business_connection_id?: string;
|
|
1298
|
+
message_id?: number;
|
|
1299
|
+
inline_message_id?: string;
|
|
1300
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
1301
|
+
} & methodParams;
|
|
1302
|
+
|
|
1303
|
+
export const editMessageReplyMarkup = (
|
|
1304
|
+
params: editMessageReplyMarkupParams,
|
|
1305
|
+
): APIResponse<Message | true> =>
|
|
1306
|
+
requestTelegramAPI("editMessageReplyMarkup", params);
|
|
1307
|
+
|
|
1308
|
+
export type stopPollParams = {
|
|
1309
|
+
chat_id: string | number;
|
|
1310
|
+
message_id: number;
|
|
1311
|
+
business_connection_id?: string;
|
|
1312
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
1313
|
+
} & methodParams;
|
|
1314
|
+
|
|
1315
|
+
export const stopPoll = (params: stopPollParams): APIResponse<Poll> =>
|
|
1316
|
+
requestTelegramAPI("stopPoll", params);
|
|
1317
|
+
|
|
1318
|
+
export type deleteMessageParams = {
|
|
1319
|
+
chat_id: string | number;
|
|
1320
|
+
message_id: number;
|
|
1321
|
+
} & methodParams;
|
|
1322
|
+
|
|
1323
|
+
export const deleteMessage = (params: deleteMessageParams): APIResponse =>
|
|
1324
|
+
requestTelegramAPI("deleteMessage", params);
|
|
1325
|
+
|
|
1326
|
+
export type deleteMessagesParams = {
|
|
1327
|
+
chat_id: string | number;
|
|
1328
|
+
message_ids: number[];
|
|
1329
|
+
} & methodParams;
|
|
1330
|
+
|
|
1331
|
+
export const deleteMessages = (params: deleteMessagesParams): APIResponse =>
|
|
1332
|
+
requestTelegramAPI("deleteMessages", params);
|
|
1333
|
+
|
|
1334
|
+
export type getAvailableGiftsParams = {} & methodParams;
|
|
1335
|
+
|
|
1336
|
+
export const getAvailableGifts = (
|
|
1337
|
+
params: getAvailableGiftsParams,
|
|
1338
|
+
): APIResponse<Gifts> => requestTelegramAPI("getAvailableGifts", params);
|
|
1339
|
+
|
|
1340
|
+
export type sendGiftParams = {
|
|
1341
|
+
gift_id: string;
|
|
1342
|
+
user_id?: number;
|
|
1343
|
+
chat_id?: string | number;
|
|
1344
|
+
pay_for_upgrade?: boolean;
|
|
1345
|
+
text?: string;
|
|
1346
|
+
text_parse_mode?: string;
|
|
1347
|
+
text_entities?: MessageEntity[];
|
|
1348
|
+
} & methodParams;
|
|
1349
|
+
|
|
1350
|
+
export const sendGift = (params: sendGiftParams): APIResponse => {
|
|
1351
|
+
params.text_parse_mode ||= "HTML";
|
|
1352
|
+
return requestTelegramAPI("sendGift", params);
|
|
1353
|
+
};
|
|
1354
|
+
|
|
1355
|
+
export type giftPremiumSubscriptionParams = {
|
|
1356
|
+
user_id: number;
|
|
1357
|
+
month_count: number;
|
|
1358
|
+
star_count: number;
|
|
1359
|
+
text?: string;
|
|
1360
|
+
text_parse_mode?: string;
|
|
1361
|
+
text_entities?: MessageEntity[];
|
|
1362
|
+
} & methodParams;
|
|
1363
|
+
|
|
1364
|
+
export const giftPremiumSubscription = (
|
|
1365
|
+
params: giftPremiumSubscriptionParams,
|
|
1366
|
+
): APIResponse => {
|
|
1367
|
+
params.text_parse_mode ||= "HTML";
|
|
1368
|
+
return requestTelegramAPI("giftPremiumSubscription", params);
|
|
1369
|
+
};
|
|
1370
|
+
|
|
1371
|
+
export type verifyUserParams = {
|
|
1372
|
+
user_id: number;
|
|
1373
|
+
custom_description?: string;
|
|
1374
|
+
} & methodParams;
|
|
1375
|
+
|
|
1376
|
+
export const verifyUser = (params: verifyUserParams): APIResponse =>
|
|
1377
|
+
requestTelegramAPI("verifyUser", params);
|
|
1378
|
+
|
|
1379
|
+
export type verifyChatParams = {
|
|
1380
|
+
chat_id: string | number;
|
|
1381
|
+
custom_description?: string;
|
|
1382
|
+
} & methodParams;
|
|
1383
|
+
|
|
1384
|
+
export const verifyChat = (params: verifyChatParams): APIResponse =>
|
|
1385
|
+
requestTelegramAPI("verifyChat", params);
|
|
1386
|
+
|
|
1387
|
+
export type removeUserVerificationParams = {
|
|
1388
|
+
user_id: number;
|
|
1389
|
+
} & methodParams;
|
|
1390
|
+
|
|
1391
|
+
export const removeUserVerification = (
|
|
1392
|
+
params: removeUserVerificationParams,
|
|
1393
|
+
): APIResponse => requestTelegramAPI("removeUserVerification", params);
|
|
1394
|
+
|
|
1395
|
+
export type removeChatVerificationParams = {
|
|
1396
|
+
chat_id: string | number;
|
|
1397
|
+
} & methodParams;
|
|
1398
|
+
|
|
1399
|
+
export const removeChatVerification = (
|
|
1400
|
+
params: removeChatVerificationParams,
|
|
1401
|
+
): APIResponse => requestTelegramAPI("removeChatVerification", params);
|
|
1402
|
+
|
|
1403
|
+
export type readBusinessMessageParams = {
|
|
1404
|
+
chat_id: string | number;
|
|
1405
|
+
} & methodParams;
|
|
1406
|
+
|
|
1407
|
+
export const readBusinessMessage = (
|
|
1408
|
+
params: readBusinessMessageParams,
|
|
1409
|
+
): APIResponse => requestTelegramAPI("readBusinessMessage", params);
|
|
1410
|
+
|
|
1411
|
+
export type deleteBusinessMessagesParams = {
|
|
1412
|
+
business_connection_id: string;
|
|
1413
|
+
message_ids: number[];
|
|
1414
|
+
} & methodParams;
|
|
1415
|
+
|
|
1416
|
+
export const deleteBusinessMessages = (
|
|
1417
|
+
params: deleteBusinessMessagesParams,
|
|
1418
|
+
): APIResponse => requestTelegramAPI("deleteBusinessMessages", params);
|
|
1419
|
+
|
|
1420
|
+
export type setBusinessAccountNameParams = {
|
|
1421
|
+
business_connection_id: string;
|
|
1422
|
+
first_name: string;
|
|
1423
|
+
last_name?: string;
|
|
1424
|
+
} & methodParams;
|
|
1425
|
+
|
|
1426
|
+
export const setBusinessAccountName = (
|
|
1427
|
+
params: setBusinessAccountNameParams,
|
|
1428
|
+
): APIResponse => requestTelegramAPI("setBusinessAccountName", params);
|
|
1429
|
+
|
|
1430
|
+
export type setBusinessAccountUsernameParams = {
|
|
1431
|
+
business_connection_id: string;
|
|
1432
|
+
username: string;
|
|
1433
|
+
} & methodParams;
|
|
1434
|
+
|
|
1435
|
+
export const setBusinessAccountUsername = (
|
|
1436
|
+
params: setBusinessAccountUsernameParams,
|
|
1437
|
+
): APIResponse => requestTelegramAPI("setBusinessAccountUsername", params);
|
|
1438
|
+
|
|
1439
|
+
export type setBusinessAccountBioParams = {
|
|
1440
|
+
business_connection_id: string;
|
|
1441
|
+
bio: string;
|
|
1442
|
+
} & methodParams;
|
|
1443
|
+
|
|
1444
|
+
export const setBusinessAccountBio = (
|
|
1445
|
+
params: setBusinessAccountBioParams,
|
|
1446
|
+
): APIResponse => requestTelegramAPI("setBusinessAccountBio", params);
|
|
1447
|
+
|
|
1448
|
+
export type setBusinessAccountProfilePhotoParams = {
|
|
1449
|
+
business_connection_id: string;
|
|
1450
|
+
photo: any;
|
|
1451
|
+
is_public?: boolean;
|
|
1452
|
+
} & methodParams;
|
|
1453
|
+
|
|
1454
|
+
export const setBusinessAccountProfilePhoto = (
|
|
1455
|
+
params: setBusinessAccountProfilePhotoParams,
|
|
1456
|
+
): APIResponse => requestTelegramAPI("setBusinessAccountProfilePhoto", params);
|
|
1457
|
+
|
|
1458
|
+
export type removeBusinessAccountProfilePhotoParams = {
|
|
1459
|
+
business_connection_id: string;
|
|
1460
|
+
is_public?: boolean;
|
|
1461
|
+
} & methodParams;
|
|
1462
|
+
|
|
1463
|
+
export const removeBusinessAccountProfilePhoto = (
|
|
1464
|
+
params: removeBusinessAccountProfilePhotoParams,
|
|
1465
|
+
): APIResponse =>
|
|
1466
|
+
requestTelegramAPI("removeBusinessAccountProfilePhoto", params);
|
|
1467
|
+
|
|
1468
|
+
export type setBusinessAccountGiftSettingsParams = {
|
|
1469
|
+
business_connection_id: string;
|
|
1470
|
+
show_gift_button: boolean;
|
|
1471
|
+
accepted_gift_types: any;
|
|
1472
|
+
} & methodParams;
|
|
1473
|
+
|
|
1474
|
+
export const setBusinessAccountGiftSettings = (
|
|
1475
|
+
params: setBusinessAccountGiftSettingsParams,
|
|
1476
|
+
): APIResponse => requestTelegramAPI("setBusinessAccountGiftSettings", params);
|
|
1477
|
+
|
|
1478
|
+
export type getBusinessAccountStarBalanceParams = {
|
|
1479
|
+
business_connection_id: string;
|
|
1480
|
+
} & methodParams;
|
|
1481
|
+
|
|
1482
|
+
export const getBusinessAccountStarBalance = (
|
|
1483
|
+
params: getBusinessAccountStarBalanceParams,
|
|
1484
|
+
): APIResponse<any> =>
|
|
1485
|
+
requestTelegramAPI("getBusinessAccountStarBalance", params);
|
|
1486
|
+
|
|
1487
|
+
export type transferBusinessAccountStarsParams = {
|
|
1488
|
+
business_connection_id: string;
|
|
1489
|
+
star_count: number;
|
|
1490
|
+
} & methodParams;
|
|
1491
|
+
|
|
1492
|
+
export const transferBusinessAccountStars = (
|
|
1493
|
+
params: transferBusinessAccountStarsParams,
|
|
1494
|
+
): APIResponse => requestTelegramAPI("transferBusinessAccountStars", params);
|
|
1495
|
+
|
|
1496
|
+
export type getBusinessAccountGiftsParams = {
|
|
1497
|
+
business_connection_id: string;
|
|
1498
|
+
exclude_unsaved?: boolean;
|
|
1499
|
+
exclude_saved?: boolean;
|
|
1500
|
+
exclude_unlimited?: boolean;
|
|
1501
|
+
exclude_limited?: boolean;
|
|
1502
|
+
exclude_unique?: boolean;
|
|
1503
|
+
sort_by_price?: boolean;
|
|
1504
|
+
offset?: string;
|
|
1505
|
+
limit?: number;
|
|
1506
|
+
} & methodParams;
|
|
1507
|
+
|
|
1508
|
+
export const getBusinessAccountGifts = (
|
|
1509
|
+
params: getBusinessAccountGiftsParams,
|
|
1510
|
+
): APIResponse<any> => requestTelegramAPI("getBusinessAccountGifts", params);
|
|
1511
|
+
|
|
1512
|
+
export type convertGiftToStarsParams = {
|
|
1513
|
+
business_connection_id: string;
|
|
1514
|
+
owned_gift_id: string;
|
|
1515
|
+
} & methodParams;
|
|
1516
|
+
|
|
1517
|
+
export const convertGiftToStars = (
|
|
1518
|
+
params: convertGiftToStarsParams,
|
|
1519
|
+
): APIResponse => requestTelegramAPI("convertGiftToStars", params);
|
|
1520
|
+
|
|
1521
|
+
export type upgradeGiftParams = {
|
|
1522
|
+
business_connection_id: string;
|
|
1523
|
+
owned_gift_id: string;
|
|
1524
|
+
keep_original_details?: boolean;
|
|
1525
|
+
star_count?: number;
|
|
1526
|
+
} & methodParams;
|
|
1527
|
+
|
|
1528
|
+
export const upgradeGift = (params: upgradeGiftParams): APIResponse =>
|
|
1529
|
+
requestTelegramAPI("upgradeGift", params);
|
|
1530
|
+
|
|
1531
|
+
export type transferGiftParams = {
|
|
1532
|
+
business_connection_id: string;
|
|
1533
|
+
owned_gift_id: string;
|
|
1534
|
+
new_owner_chat_id: number;
|
|
1535
|
+
star_count?: number;
|
|
1536
|
+
} & methodParams;
|
|
1537
|
+
|
|
1538
|
+
export const transferGift = (params: transferGiftParams): APIResponse =>
|
|
1539
|
+
requestTelegramAPI("transferGift", params);
|
|
1540
|
+
|
|
1541
|
+
export type postStoryParams = {
|
|
1542
|
+
business_connection_id: string;
|
|
1543
|
+
content: any;
|
|
1544
|
+
active_period: number;
|
|
1545
|
+
caption?: string;
|
|
1546
|
+
parse_mode?: string;
|
|
1547
|
+
caption_entities?: MessageEntity[];
|
|
1548
|
+
areas?: any;
|
|
1549
|
+
post_to_chat_page?: boolean;
|
|
1550
|
+
protect_content?: boolean;
|
|
1551
|
+
} & methodParams;
|
|
1552
|
+
|
|
1553
|
+
export const postStory = (params: postStoryParams): APIResponse<Story> => {
|
|
1554
|
+
params.parse_mode ||= "HTML";
|
|
1555
|
+
return requestTelegramAPI("postStory", params);
|
|
1556
|
+
};
|
|
1557
|
+
|
|
1558
|
+
export type editStoryParams = {
|
|
1559
|
+
business_connection_id: string;
|
|
1560
|
+
story_id: number;
|
|
1561
|
+
content: any;
|
|
1562
|
+
caption?: string;
|
|
1563
|
+
parse_mode?: string;
|
|
1564
|
+
caption_entities?: MessageEntity[];
|
|
1565
|
+
areas?: any;
|
|
1566
|
+
} & methodParams;
|
|
1567
|
+
|
|
1568
|
+
export const editStory = (params: editStoryParams): APIResponse<Story> => {
|
|
1569
|
+
params.parse_mode ||= "HTML";
|
|
1570
|
+
return requestTelegramAPI("editStory", params);
|
|
1571
|
+
};
|
|
1572
|
+
|
|
1573
|
+
export type deleteStoryParams = {
|
|
1574
|
+
business_connection_id: string;
|
|
1575
|
+
story_id: number;
|
|
1576
|
+
} & methodParams;
|
|
1577
|
+
|
|
1578
|
+
export const deleteStory = (params: deleteStoryParams): APIResponse =>
|
|
1579
|
+
requestTelegramAPI("deleteStory", params);
|
|
1580
|
+
|
|
1581
|
+
export type sendStickerParams = {
|
|
1582
|
+
chat_id: string | number;
|
|
1583
|
+
sticker: InputFile | string;
|
|
1584
|
+
business_connection_id?: string;
|
|
1585
|
+
message_thread_id?: number;
|
|
1586
|
+
emoji?: string;
|
|
1587
|
+
disable_notification?: boolean;
|
|
1588
|
+
protect_content?: boolean;
|
|
1589
|
+
allow_paid_broadcast?: boolean;
|
|
1590
|
+
message_effect_id?: string;
|
|
1591
|
+
reply_parameters?: ReplyParameters;
|
|
1592
|
+
reply_markup?:
|
|
1593
|
+
| InlineKeyboardMarkup
|
|
1594
|
+
| ReplyKeyboardMarkup
|
|
1595
|
+
| ReplyKeyboardRemove
|
|
1596
|
+
| ForceReply;
|
|
1597
|
+
} & methodParams;
|
|
1598
|
+
|
|
1599
|
+
export const sendSticker = (params: sendStickerParams): APIResponse<Message> =>
|
|
1600
|
+
requestTelegramAPI("sendSticker", params);
|
|
1601
|
+
|
|
1602
|
+
export type getStickerSetParams = {
|
|
1603
|
+
name: string;
|
|
1604
|
+
} & methodParams;
|
|
1605
|
+
|
|
1606
|
+
export const getStickerSet = (
|
|
1607
|
+
params: getStickerSetParams,
|
|
1608
|
+
): APIResponse<StickerSet> => requestTelegramAPI("getStickerSet", params);
|
|
1609
|
+
|
|
1610
|
+
export type getCustomEmojiStickersParams = {
|
|
1611
|
+
custom_emoji_ids: string[];
|
|
1612
|
+
} & methodParams;
|
|
1613
|
+
|
|
1614
|
+
export const getCustomEmojiStickers = (
|
|
1615
|
+
params: getCustomEmojiStickersParams,
|
|
1616
|
+
): APIResponse<Sticker[]> =>
|
|
1617
|
+
requestTelegramAPI("getCustomEmojiStickers", params);
|
|
1618
|
+
|
|
1619
|
+
export type uploadStickerFileParams = {
|
|
1620
|
+
user_id: number;
|
|
1621
|
+
sticker: InputFile;
|
|
1622
|
+
sticker_format: string;
|
|
1623
|
+
} & methodParams;
|
|
1624
|
+
|
|
1625
|
+
export const uploadStickerFile = (
|
|
1626
|
+
params: uploadStickerFileParams,
|
|
1627
|
+
): APIResponse<File> => requestTelegramAPI("uploadStickerFile", params);
|
|
1628
|
+
|
|
1629
|
+
export type createNewStickerSetParams = {
|
|
1630
|
+
user_id: number;
|
|
1631
|
+
name: string;
|
|
1632
|
+
title: string;
|
|
1633
|
+
stickers: InputSticker[];
|
|
1634
|
+
sticker_type?: string;
|
|
1635
|
+
needs_repainting?: boolean;
|
|
1636
|
+
} & methodParams;
|
|
1637
|
+
|
|
1638
|
+
export const createNewStickerSet = (
|
|
1639
|
+
params: createNewStickerSetParams,
|
|
1640
|
+
): APIResponse => requestTelegramAPI("createNewStickerSet", params);
|
|
1641
|
+
|
|
1642
|
+
export type addStickerToSetParams = {
|
|
1643
|
+
user_id: number;
|
|
1644
|
+
name: string;
|
|
1645
|
+
sticker: InputSticker;
|
|
1646
|
+
} & methodParams;
|
|
1647
|
+
|
|
1648
|
+
export const addStickerToSet = (params: addStickerToSetParams): APIResponse =>
|
|
1649
|
+
requestTelegramAPI("addStickerToSet", params);
|
|
1650
|
+
|
|
1651
|
+
export type setStickerPositionInSetParams = {
|
|
1652
|
+
sticker: string;
|
|
1653
|
+
position: number;
|
|
1654
|
+
} & methodParams;
|
|
1655
|
+
|
|
1656
|
+
export const setStickerPositionInSet = (
|
|
1657
|
+
params: setStickerPositionInSetParams,
|
|
1658
|
+
): APIResponse => requestTelegramAPI("setStickerPositionInSet", params);
|
|
1659
|
+
|
|
1660
|
+
export type deleteStickerFromSetParams = {
|
|
1661
|
+
sticker: string;
|
|
1662
|
+
} & methodParams;
|
|
1663
|
+
|
|
1664
|
+
export const deleteStickerFromSet = (
|
|
1665
|
+
params: deleteStickerFromSetParams,
|
|
1666
|
+
): APIResponse => requestTelegramAPI("deleteStickerFromSet", params);
|
|
1667
|
+
|
|
1668
|
+
export type replaceStickerInSetParams = {
|
|
1669
|
+
user_id: number;
|
|
1670
|
+
name: string;
|
|
1671
|
+
old_sticker: string;
|
|
1672
|
+
sticker: InputSticker;
|
|
1673
|
+
} & methodParams;
|
|
1674
|
+
|
|
1675
|
+
export const replaceStickerInSet = (
|
|
1676
|
+
params: replaceStickerInSetParams,
|
|
1677
|
+
): APIResponse => requestTelegramAPI("replaceStickerInSet", params);
|
|
1678
|
+
|
|
1679
|
+
export type setStickerEmojiListParams = {
|
|
1680
|
+
sticker: string;
|
|
1681
|
+
emoji_list: string[];
|
|
1682
|
+
} & methodParams;
|
|
1683
|
+
|
|
1684
|
+
export const setStickerEmojiList = (
|
|
1685
|
+
params: setStickerEmojiListParams,
|
|
1686
|
+
): APIResponse => requestTelegramAPI("setStickerEmojiList", params);
|
|
1687
|
+
|
|
1688
|
+
export type setStickerKeywordsParams = {
|
|
1689
|
+
sticker: string;
|
|
1690
|
+
keywords: string[];
|
|
1691
|
+
} & methodParams;
|
|
1692
|
+
|
|
1693
|
+
export const setStickerKeywords = (
|
|
1694
|
+
params: setStickerKeywordsParams,
|
|
1695
|
+
): APIResponse => requestTelegramAPI("setStickerKeywords", params);
|
|
1696
|
+
|
|
1697
|
+
export type setStickerMaskPositionParams = {
|
|
1698
|
+
sticker: string;
|
|
1699
|
+
mask_position: MaskPosition;
|
|
1700
|
+
} & methodParams;
|
|
1701
|
+
|
|
1702
|
+
export const setStickerMaskPosition = (
|
|
1703
|
+
params: setStickerMaskPositionParams,
|
|
1704
|
+
): APIResponse => requestTelegramAPI("setStickerMaskPosition", params);
|
|
1705
|
+
|
|
1706
|
+
export type setStickerSetTitleParams = {
|
|
1707
|
+
name: string;
|
|
1708
|
+
title: string;
|
|
1709
|
+
} & methodParams;
|
|
1710
|
+
|
|
1711
|
+
export const setStickerSetTitle = (
|
|
1712
|
+
params: setStickerSetTitleParams,
|
|
1713
|
+
): APIResponse => requestTelegramAPI("setStickerSetTitle", params);
|
|
1714
|
+
|
|
1715
|
+
export type setStickerSetThumbnailParams = {
|
|
1716
|
+
name: string;
|
|
1717
|
+
user_id: number;
|
|
1718
|
+
thumbnail?: InputFile | string;
|
|
1719
|
+
format: string;
|
|
1720
|
+
} & methodParams;
|
|
1721
|
+
|
|
1722
|
+
export const setStickerSetThumbnail = (
|
|
1723
|
+
params: setStickerSetThumbnailParams,
|
|
1724
|
+
): APIResponse => requestTelegramAPI("setStickerSetThumbnail", params);
|
|
1725
|
+
|
|
1726
|
+
export type setCustomEmojiStickerSetThumbnailParams = {
|
|
1727
|
+
name: string;
|
|
1728
|
+
custom_emoji_id?: string;
|
|
1729
|
+
} & methodParams;
|
|
1730
|
+
|
|
1731
|
+
export const setCustomEmojiStickerSetThumbnail = (
|
|
1732
|
+
params: setCustomEmojiStickerSetThumbnailParams,
|
|
1733
|
+
): APIResponse =>
|
|
1734
|
+
requestTelegramAPI("setCustomEmojiStickerSetThumbnail", params);
|
|
1735
|
+
|
|
1736
|
+
export type deleteStickerSetParams = {
|
|
1737
|
+
name: string;
|
|
1738
|
+
} & methodParams;
|
|
1739
|
+
|
|
1740
|
+
export const deleteStickerSet = (params: deleteStickerSetParams): APIResponse =>
|
|
1741
|
+
requestTelegramAPI("deleteStickerSet", params);
|
|
1742
|
+
|
|
1743
|
+
export type answerInlineQueryParams = {
|
|
1744
|
+
inline_query_id: string;
|
|
1745
|
+
results: InlineQueryResult[];
|
|
1746
|
+
cache_time?: number;
|
|
1747
|
+
is_personal?: boolean;
|
|
1748
|
+
next_offset?: string;
|
|
1749
|
+
button?: InlineQueryResultsButton;
|
|
1750
|
+
} & methodParams;
|
|
1751
|
+
|
|
1752
|
+
export const answerInlineQuery = (
|
|
1753
|
+
params: answerInlineQueryParams,
|
|
1754
|
+
): APIResponse => requestTelegramAPI("answerInlineQuery", params);
|
|
1755
|
+
|
|
1756
|
+
export type answerWebAppQueryParams = {
|
|
1757
|
+
web_app_query_id: string;
|
|
1758
|
+
result: InlineQueryResult;
|
|
1759
|
+
} & methodParams;
|
|
1760
|
+
|
|
1761
|
+
export const answerWebAppQuery = (
|
|
1762
|
+
params: answerWebAppQueryParams,
|
|
1763
|
+
): APIResponse<SentWebAppMessage> =>
|
|
1764
|
+
requestTelegramAPI("answerWebAppQuery", params);
|
|
1765
|
+
|
|
1766
|
+
export type savePreparedInlineMessageParams = {
|
|
1767
|
+
user_id: number;
|
|
1768
|
+
result: InlineQueryResult;
|
|
1769
|
+
allow_user_chats?: boolean;
|
|
1770
|
+
allow_bot_chats?: boolean;
|
|
1771
|
+
allow_group_chats?: boolean;
|
|
1772
|
+
allow_channel_chats?: boolean;
|
|
1773
|
+
} & methodParams;
|
|
1774
|
+
|
|
1775
|
+
export const savePreparedInlineMessage = (
|
|
1776
|
+
params: savePreparedInlineMessageParams,
|
|
1777
|
+
): APIResponse<any> => requestTelegramAPI("savePreparedInlineMessage", params);
|
|
1778
|
+
|
|
1779
|
+
export type sendInvoiceParams = {
|
|
1780
|
+
chat_id: string | number;
|
|
1781
|
+
title: string;
|
|
1782
|
+
description: string;
|
|
1783
|
+
payload: string;
|
|
1784
|
+
currency: string;
|
|
1785
|
+
prices: LabeledPrice[];
|
|
1786
|
+
message_thread_id?: number;
|
|
1787
|
+
provider_token?: string;
|
|
1788
|
+
max_tip_amount?: number;
|
|
1789
|
+
suggested_tip_amounts?: number[];
|
|
1790
|
+
start_parameter?: string;
|
|
1791
|
+
provider_data?: string;
|
|
1792
|
+
photo_url?: string;
|
|
1793
|
+
photo_size?: number;
|
|
1794
|
+
photo_width?: number;
|
|
1795
|
+
photo_height?: number;
|
|
1796
|
+
need_name?: boolean;
|
|
1797
|
+
need_phone_number?: boolean;
|
|
1798
|
+
need_email?: boolean;
|
|
1799
|
+
need_shipping_address?: boolean;
|
|
1800
|
+
send_phone_number_to_provider?: boolean;
|
|
1801
|
+
send_email_to_provider?: boolean;
|
|
1802
|
+
is_flexible?: boolean;
|
|
1803
|
+
disable_notification?: boolean;
|
|
1804
|
+
protect_content?: boolean;
|
|
1805
|
+
allow_paid_broadcast?: boolean;
|
|
1806
|
+
message_effect_id?: string;
|
|
1807
|
+
reply_parameters?: ReplyParameters;
|
|
1808
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
1809
|
+
} & methodParams;
|
|
1810
|
+
|
|
1811
|
+
export const sendInvoice = (params: sendInvoiceParams): APIResponse<Message> =>
|
|
1812
|
+
requestTelegramAPI("sendInvoice", params);
|
|
1813
|
+
|
|
1814
|
+
export type createInvoiceLinkParams = {
|
|
1815
|
+
title: string;
|
|
1816
|
+
description: string;
|
|
1817
|
+
payload: string;
|
|
1818
|
+
currency: string;
|
|
1819
|
+
prices: LabeledPrice[];
|
|
1820
|
+
subscription_period?: number;
|
|
1821
|
+
business_connection_id?: string;
|
|
1822
|
+
provider_token?: string;
|
|
1823
|
+
max_tip_amount?: number;
|
|
1824
|
+
suggested_tip_amounts?: number[];
|
|
1825
|
+
start_parameter?: string;
|
|
1826
|
+
provider_data?: string;
|
|
1827
|
+
photo_url?: string;
|
|
1828
|
+
photo_size?: number;
|
|
1829
|
+
photo_width?: number;
|
|
1830
|
+
photo_height?: number;
|
|
1831
|
+
need_name?: boolean;
|
|
1832
|
+
need_phone_number?: boolean;
|
|
1833
|
+
need_email?: boolean;
|
|
1834
|
+
need_shipping_address?: boolean;
|
|
1835
|
+
send_phone_number_to_provider?: boolean;
|
|
1836
|
+
send_email_to_provider?: boolean;
|
|
1837
|
+
is_flexible?: boolean;
|
|
1838
|
+
} & methodParams;
|
|
1839
|
+
|
|
1840
|
+
export const createInvoiceLink = (
|
|
1841
|
+
params: createInvoiceLinkParams,
|
|
1842
|
+
): APIResponse<string> => requestTelegramAPI("createInvoiceLink", params);
|
|
1843
|
+
|
|
1844
|
+
export type answerShippingQueryParams = {
|
|
1845
|
+
shipping_query_id: string;
|
|
1846
|
+
ok: boolean;
|
|
1847
|
+
shipping_options?: ShippingOption[];
|
|
1848
|
+
error_message?: string;
|
|
1849
|
+
} & methodParams;
|
|
1850
|
+
|
|
1851
|
+
export const answerShippingQuery = (
|
|
1852
|
+
params: answerShippingQueryParams,
|
|
1853
|
+
): APIResponse => requestTelegramAPI("answerShippingQuery", params);
|
|
1854
|
+
|
|
1855
|
+
export type answerPreCheckoutQueryParams = {
|
|
1856
|
+
pre_checkout_query_id: string;
|
|
1857
|
+
ok: boolean;
|
|
1858
|
+
error_message?: string;
|
|
1859
|
+
} & methodParams;
|
|
1860
|
+
|
|
1861
|
+
export const answerPreCheckoutQuery = (
|
|
1862
|
+
params: answerPreCheckoutQueryParams,
|
|
1863
|
+
): APIResponse => requestTelegramAPI("answerPreCheckoutQuery", params);
|
|
1864
|
+
|
|
1865
|
+
export type getStarTransactionsParams = {
|
|
1866
|
+
offset?: number;
|
|
1867
|
+
limit?: number;
|
|
1868
|
+
} & methodParams;
|
|
1869
|
+
|
|
1870
|
+
export const getStarTransactions = (
|
|
1871
|
+
params: getStarTransactionsParams,
|
|
1872
|
+
): APIResponse<StarTransaction> =>
|
|
1873
|
+
requestTelegramAPI("getStarTransactions", params);
|
|
1874
|
+
|
|
1875
|
+
export type refundStarPaymentParams = {
|
|
1876
|
+
user_id: number;
|
|
1877
|
+
telegram_payment_charge_id: string;
|
|
1878
|
+
} & methodParams;
|
|
1879
|
+
|
|
1880
|
+
export const refundStarPayment = (
|
|
1881
|
+
params: refundStarPaymentParams,
|
|
1882
|
+
): APIResponse => requestTelegramAPI("refundStarPayment", params);
|
|
1883
|
+
|
|
1884
|
+
export type editUserStarSubscriptionParams = {
|
|
1885
|
+
user_id: number;
|
|
1886
|
+
telegram_payment_charge_id: string;
|
|
1887
|
+
is_canceled: boolean;
|
|
1888
|
+
} & methodParams;
|
|
1889
|
+
|
|
1890
|
+
export const editUserStarSubscription = (
|
|
1891
|
+
params: editUserStarSubscriptionParams,
|
|
1892
|
+
): APIResponse => requestTelegramAPI("editUserStarSubscription", params);
|
|
1893
|
+
|
|
1894
|
+
export type setPassportDataErrorsParams = {
|
|
1895
|
+
user_id: number;
|
|
1896
|
+
errors: PassportElementError[];
|
|
1897
|
+
} & methodParams;
|
|
1898
|
+
|
|
1899
|
+
export const setPassportDataErrors = (
|
|
1900
|
+
params: setPassportDataErrorsParams,
|
|
1901
|
+
): APIResponse => requestTelegramAPI("setPassportDataErrors", params);
|
|
1902
|
+
|
|
1903
|
+
export type sendGameParams = {
|
|
1904
|
+
chat_id: number;
|
|
1905
|
+
game_short_name: string;
|
|
1906
|
+
business_connection_id?: string;
|
|
1907
|
+
message_thread_id?: number;
|
|
1908
|
+
disable_notification?: boolean;
|
|
1909
|
+
protect_content?: boolean;
|
|
1910
|
+
allow_paid_broadcast?: boolean;
|
|
1911
|
+
message_effect_id?: string;
|
|
1912
|
+
reply_parameters?: ReplyParameters;
|
|
1913
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
1914
|
+
} & methodParams;
|
|
1915
|
+
|
|
1916
|
+
export const sendGame = (params: sendGameParams): APIResponse<Message> =>
|
|
1917
|
+
requestTelegramAPI("sendGame", params);
|
|
1918
|
+
|
|
1919
|
+
export type setGameScoreParams = {
|
|
1920
|
+
user_id: number;
|
|
1921
|
+
score: number;
|
|
1922
|
+
force?: boolean;
|
|
1923
|
+
disable_edit_message?: boolean;
|
|
1924
|
+
chat_id?: number;
|
|
1925
|
+
message_id?: number;
|
|
1926
|
+
inline_message_id?: number;
|
|
1927
|
+
} & methodParams;
|
|
1928
|
+
|
|
1929
|
+
export const setGameScore = (
|
|
1930
|
+
params: setGameScoreParams,
|
|
1931
|
+
): APIResponse<boolean> => requestTelegramAPI("setGameScore", params);
|
|
1932
|
+
|
|
1933
|
+
export type getGameHighScoresParams = {
|
|
1934
|
+
user_id: number;
|
|
1935
|
+
chat_id?: number;
|
|
1936
|
+
message_id?: number;
|
|
1937
|
+
inline_message_id?: number;
|
|
1938
|
+
} & methodParams;
|
|
1939
|
+
|
|
1940
|
+
export const getGameHighScores = (
|
|
1941
|
+
params: getGameHighScoresParams,
|
|
1942
|
+
): APIResponse<GameHighScore[]> =>
|
|
1943
|
+
requestTelegramAPI("getGameHighScores", params);
|