@aracna/telegram-bot 2.0.6 → 2.0.7
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/classes/client.d.ts +1 -0
- package/classes/client.js +11 -0
- package/definitions/interfaces.d.ts +2 -1
- package/definitions/types.d.ts +1 -1
- package/index.d.ts +87 -1
- package/index.js +38 -5
- package/package.json +2 -2
- package/requests/add-requests.d.ts +1 -1
- package/requests/business-requests.d.ts +15 -0
- package/requests/business-requests.js +63 -0
- package/requests/create-requests.d.ts +1 -1
- package/requests/edit-requests.d.ts +2 -1
- package/requests/edit-requests.js +4 -0
- package/requests/get-requests.d.ts +1 -2
- package/requests/get-requests.js +0 -4
- package/requests/gift-requests.d.ts +9 -0
- package/requests/gift-requests.js +27 -0
- package/requests/replace-requests.d.ts +1 -1
- package/requests/save-requests.d.ts +4 -0
- package/requests/save-requests.js +7 -0
- package/requests/send-requests.js +5 -1
- package/requests/set-requests.d.ts +3 -2
- package/requests/set-requests.js +4 -0
- package/requests/story-requests.d.ts +6 -0
- package/requests/story-requests.js +15 -0
- package/requests/verification-requests.d.ts +7 -0
- package/requests/verification-requests.js +19 -0
package/classes/client.d.ts
CHANGED
|
@@ -32,6 +32,7 @@ export declare class Client {
|
|
|
32
32
|
protected handlePoll(poll: Poll): ClientListener | undefined;
|
|
33
33
|
protected handlePollAnswer(answer: PollAnswer): ClientListener | undefined;
|
|
34
34
|
protected handlePreCheckoutQuery(query: PreCheckoutQuery): ClientListener | undefined;
|
|
35
|
+
protected handlePurchasedPaidMedia(media: Message): ClientListener | undefined;
|
|
35
36
|
protected handleRemovedChatBoost(removed: ChatBoostRemoved): ClientListener | undefined;
|
|
36
37
|
protected handleReplyToMessage(reply: Message): ClientListener | undefined;
|
|
37
38
|
protected handleShippingQuery(query: ShippingQuery): ClientListener | undefined;
|
package/classes/client.js
CHANGED
|
@@ -141,6 +141,9 @@ class Client {
|
|
|
141
141
|
case (0, core_1.hasObjectProperty)(update, 'pre_checkout_query'):
|
|
142
142
|
listener = this.handlePreCheckoutQuery(update.pre_checkout_query);
|
|
143
143
|
break;
|
|
144
|
+
case (0, core_1.hasObjectProperty)(update, 'purchased_paid_media'):
|
|
145
|
+
listener = this.handlePurchasedPaidMedia(update.purchased_paid_media);
|
|
146
|
+
break;
|
|
144
147
|
case (0, core_1.hasObjectProperty)(update, 'removed_chat_boost'):
|
|
145
148
|
listener = this.handleRemovedChatBoost(update.removed_chat_boost);
|
|
146
149
|
break;
|
|
@@ -320,6 +323,14 @@ class Client {
|
|
|
320
323
|
listener.middleware(query);
|
|
321
324
|
return listener;
|
|
322
325
|
}
|
|
326
|
+
handlePurchasedPaidMedia(media) {
|
|
327
|
+
let listener;
|
|
328
|
+
listener = this.findListener('purchased_paid_media');
|
|
329
|
+
if (!listener)
|
|
330
|
+
return;
|
|
331
|
+
listener.middleware(media);
|
|
332
|
+
return listener;
|
|
333
|
+
}
|
|
323
334
|
handleRemovedChatBoost(removed) {
|
|
324
335
|
let listener;
|
|
325
336
|
listener = this.findListener('removed_chat_boost');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FetchResponse, RestApiConfig } from '@aracna/core';
|
|
2
|
-
import type { BusinessConnection, BusinessMessagesDeleted, ChatBoostRemoved, ChatBoostUpdated, ChatJoinRequest, ChatMemberUpdated, ChosenInlineResult, DeleteWebhook, EditMessageMedia, GetUpdates, InlineQuery, InputMediaAudio, InputMediaDocument, InputMediaPhoto, InputMediaVideo, Message, MessageReactionCountUpdated, MessageReactionUpdated, CallbackQuery as NativeCallbackQuery, Poll, PollAnswer, PreCheckoutQuery, SendMediaGroup, SendMessage, SendPaidMedia, SetWebhook, ShippingQuery } from '@aracna/telegram-bot-types';
|
|
2
|
+
import type { BusinessConnection, BusinessMessagesDeleted, ChatBoostRemoved, ChatBoostUpdated, ChatJoinRequest, ChatMemberUpdated, ChosenInlineResult, DeleteWebhook, EditMessageMedia, GetUpdates, InlineQuery, InputMediaAudio, InputMediaDocument, InputMediaPhoto, InputMediaVideo, Message, MessageReactionCountUpdated, MessageReactionUpdated, CallbackQuery as NativeCallbackQuery, PaidMediaPurchased, Poll, PollAnswer, PreCheckoutQuery, SendMediaGroup, SendMessage, SendPaidMedia, SetWebhook, ShippingQuery } from '@aracna/telegram-bot-types';
|
|
3
3
|
import type { ClientListenerMiddleware, InputFile, UpdateType } from './types';
|
|
4
4
|
export interface CallbackQuery<T = any> extends NativeCallbackQuery {
|
|
5
5
|
body: CallbackQueryBody<T>;
|
|
@@ -59,6 +59,7 @@ export interface Context {
|
|
|
59
59
|
poll: Poll;
|
|
60
60
|
poll_answer: PollAnswer;
|
|
61
61
|
pre_checkout_query: PreCheckoutQuery;
|
|
62
|
+
purchased_paid_media: PaidMediaPurchased;
|
|
62
63
|
removed_chat_boost: ChatBoostRemoved;
|
|
63
64
|
reply_to_message: ReplyToMessage;
|
|
64
65
|
shipping_query: ShippingQuery;
|
package/definitions/types.d.ts
CHANGED
|
@@ -2,4 +2,4 @@ import type { Context } from './interfaces';
|
|
|
2
2
|
export type ClientConnectionMode = 'polling' | 'webhook';
|
|
3
3
|
export type ClientListenerMiddleware<T extends UpdateType> = (context: Context[T]) => any;
|
|
4
4
|
export type InputFile = File | string;
|
|
5
|
-
export type UpdateType = 'business_connection' | 'business_message' | 'callback_query' | 'channel_post' | 'chat_boost' | 'chat_join_request' | 'chat_member' | 'chosen_inline_result' | 'deleted_business_messages' | 'edited_business_message' | 'edited_channel_post' | 'edited_message' | 'inline_query' | 'message' | 'message_reaction' | 'message_reaction_count' | 'my_chat_member' | 'poll' | 'poll_answer' | 'pre_checkout_query' | 'removed_chat_boost' | 'reply_to_message' | 'shipping_query' | 'start';
|
|
5
|
+
export type UpdateType = 'business_connection' | 'business_message' | 'callback_query' | 'channel_post' | 'chat_boost' | 'chat_join_request' | 'chat_member' | 'chosen_inline_result' | 'deleted_business_messages' | 'edited_business_message' | 'edited_channel_post' | 'edited_message' | 'inline_query' | 'message' | 'message_reaction' | 'message_reaction_count' | 'my_chat_member' | 'poll' | 'poll_answer' | 'pre_checkout_query' | 'purchased_paid_media' | 'removed_chat_boost' | 'reply_to_message' | 'shipping_query' | 'start';
|
package/index.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ import type { ChosenInlineResult } from '@aracna/telegram-bot-types';
|
|
|
26
26
|
import type { CloseForumTopic } from '@aracna/telegram-bot-types';
|
|
27
27
|
import type { CloseGeneralForumTopic } from '@aracna/telegram-bot-types';
|
|
28
28
|
import type { Context as Context_2 } from 'vm';
|
|
29
|
+
import type { ConvertGiftToStars } from '@aracna/telegram-bot-types';
|
|
29
30
|
import type { CopyMessage } from '@aracna/telegram-bot-types';
|
|
30
31
|
import type { CopyMessages } from '@aracna/telegram-bot-types';
|
|
31
32
|
import type { CreateChatInviteLink } from '@aracna/telegram-bot-types';
|
|
@@ -34,6 +35,7 @@ import type { CreateForumTopic } from '@aracna/telegram-bot-types';
|
|
|
34
35
|
import type { CreateInvoiceLink } from '@aracna/telegram-bot-types';
|
|
35
36
|
import type { CreateNewStickerSet } from '@aracna/telegram-bot-types';
|
|
36
37
|
import type { DeclineChatJoinRequest } from '@aracna/telegram-bot-types';
|
|
38
|
+
import type { DeleteBusinessMessages } from '@aracna/telegram-bot-types';
|
|
37
39
|
import type { DeleteChatPhoto } from '@aracna/telegram-bot-types';
|
|
38
40
|
import type { DeleteChatStickerSet } from '@aracna/telegram-bot-types';
|
|
39
41
|
import type { DeleteForumTopic } from '@aracna/telegram-bot-types';
|
|
@@ -42,6 +44,7 @@ import type { DeleteMessages } from '@aracna/telegram-bot-types';
|
|
|
42
44
|
import type { DeleteMyCommands } from '@aracna/telegram-bot-types';
|
|
43
45
|
import type { DeleteStickerFromSet } from '@aracna/telegram-bot-types';
|
|
44
46
|
import type { DeleteStickerSet } from '@aracna/telegram-bot-types';
|
|
47
|
+
import type { DeleteStory } from '@aracna/telegram-bot-types';
|
|
45
48
|
import type { DeleteWebhook } from '@aracna/telegram-bot-types';
|
|
46
49
|
import type { EditChatInviteLink } from '@aracna/telegram-bot-types';
|
|
47
50
|
import type { EditChatSubscriptionInviteLink } from '@aracna/telegram-bot-types';
|
|
@@ -52,6 +55,8 @@ import type { EditMessageLiveLocation } from '@aracna/telegram-bot-types';
|
|
|
52
55
|
import type { EditMessageMedia } from '@aracna/telegram-bot-types';
|
|
53
56
|
import type { EditMessageReplyMarkup } from '@aracna/telegram-bot-types';
|
|
54
57
|
import type { EditMessageText } from '@aracna/telegram-bot-types';
|
|
58
|
+
import type { EditStory } from '@aracna/telegram-bot-types';
|
|
59
|
+
import type { EditUserStarSubscription } from '@aracna/telegram-bot-types';
|
|
55
60
|
import type { ExportChatInviteLink } from '@aracna/telegram-bot-types';
|
|
56
61
|
import { FetchError } from '@aracna/core';
|
|
57
62
|
import type { File as File_2 } from '@aracna/telegram-bot-types';
|
|
@@ -59,6 +64,8 @@ import type { ForumTopic } from '@aracna/telegram-bot-types';
|
|
|
59
64
|
import type { ForwardMessage } from '@aracna/telegram-bot-types';
|
|
60
65
|
import type { ForwardMessages } from '@aracna/telegram-bot-types';
|
|
61
66
|
import type { GameHighScore } from '@aracna/telegram-bot-types';
|
|
67
|
+
import type { GetBusinessAccountGifts } from '@aracna/telegram-bot-types';
|
|
68
|
+
import type { GetBusinessAccountStarBalance } from '@aracna/telegram-bot-types';
|
|
62
69
|
import type { GetBusinessConnection } from '@aracna/telegram-bot-types';
|
|
63
70
|
import type { GetChat } from '@aracna/telegram-bot-types';
|
|
64
71
|
import type { GetChatAdministrators } from '@aracna/telegram-bot-types';
|
|
@@ -78,6 +85,8 @@ import type { GetStickerSet } from '@aracna/telegram-bot-types';
|
|
|
78
85
|
import type { GetUpdates } from '@aracna/telegram-bot-types';
|
|
79
86
|
import type { GetUserChatBoosts } from '@aracna/telegram-bot-types';
|
|
80
87
|
import type { GetUserProfilePhotos } from '@aracna/telegram-bot-types';
|
|
88
|
+
import type { GiftPremiumSubscription } from '@aracna/telegram-bot-types';
|
|
89
|
+
import type { Gifts } from '@aracna/telegram-bot-types';
|
|
81
90
|
import type { HideGeneralForumTopic } from '@aracna/telegram-bot-types';
|
|
82
91
|
import type { InlineKeyboardButton } from '@aracna/telegram-bot-types';
|
|
83
92
|
import type { InlineQuery } from '@aracna/telegram-bot-types';
|
|
@@ -94,13 +103,20 @@ import type { MessageEntity } from '@aracna/telegram-bot-types';
|
|
|
94
103
|
import type { MessageId } from '@aracna/telegram-bot-types';
|
|
95
104
|
import type { MessageReactionCountUpdated } from '@aracna/telegram-bot-types';
|
|
96
105
|
import type { MessageReactionUpdated } from '@aracna/telegram-bot-types';
|
|
106
|
+
import type { OwnedGifts } from '@aracna/telegram-bot-types';
|
|
107
|
+
import type { PaidMediaPurchased } from '@aracna/telegram-bot-types';
|
|
97
108
|
import type { PinChatMessage } from '@aracna/telegram-bot-types';
|
|
98
109
|
import type { Poll } from '@aracna/telegram-bot-types';
|
|
99
110
|
import type { PollAnswer } from '@aracna/telegram-bot-types';
|
|
111
|
+
import type { PostStory } from '@aracna/telegram-bot-types';
|
|
100
112
|
import type { PreCheckoutQuery } from '@aracna/telegram-bot-types';
|
|
101
113
|
import type { PromoteChatMember } from '@aracna/telegram-bot-types';
|
|
102
114
|
import { Queue } from '@aracna/core';
|
|
115
|
+
import type { ReadBusinessMessage } from '@aracna/telegram-bot-types';
|
|
103
116
|
import type { RefundStarPayment } from '@aracna/telegram-bot-types';
|
|
117
|
+
import type { RemoveBusinessAccountProfilePhoto } from '@aracna/telegram-bot-types';
|
|
118
|
+
import type { RemoveChatVerification } from '@aracna/telegram-bot-types';
|
|
119
|
+
import type { RemoveUserVerification } from '@aracna/telegram-bot-types';
|
|
104
120
|
import type { ReopenForumTopic } from '@aracna/telegram-bot-types';
|
|
105
121
|
import type { ReopenGeneralForumTopic } from '@aracna/telegram-bot-types';
|
|
106
122
|
import type { ReplaceStickerInSet } from '@aracna/telegram-bot-types';
|
|
@@ -109,6 +125,7 @@ import { RestAPI } from '@aracna/core';
|
|
|
109
125
|
import type { RestApiConfig } from '@aracna/core';
|
|
110
126
|
import type { RestrictChatMember } from '@aracna/telegram-bot-types';
|
|
111
127
|
import type { RevokeChatInviteLink } from '@aracna/telegram-bot-types';
|
|
128
|
+
import type { SavePreparedInlineMessage } from '@aracna/telegram-bot-types';
|
|
112
129
|
import type { SendAnimation } from '@aracna/telegram-bot-types';
|
|
113
130
|
import type { SendAudio } from '@aracna/telegram-bot-types';
|
|
114
131
|
import type { SendChatAction } from '@aracna/telegram-bot-types';
|
|
@@ -116,6 +133,7 @@ import type { SendContact } from '@aracna/telegram-bot-types';
|
|
|
116
133
|
import type { SendDice } from '@aracna/telegram-bot-types';
|
|
117
134
|
import type { SendDocument } from '@aracna/telegram-bot-types';
|
|
118
135
|
import type { SendGame } from '@aracna/telegram-bot-types';
|
|
136
|
+
import type { SendGift } from '@aracna/telegram-bot-types';
|
|
119
137
|
import type { SendInvoice } from '@aracna/telegram-bot-types';
|
|
120
138
|
import type { SendLocation } from '@aracna/telegram-bot-types';
|
|
121
139
|
import type { SendMediaGroup } from '@aracna/telegram-bot-types';
|
|
@@ -129,6 +147,11 @@ import type { SendVideo } from '@aracna/telegram-bot-types';
|
|
|
129
147
|
import type { SendVideoNote } from '@aracna/telegram-bot-types';
|
|
130
148
|
import type { SendVoice } from '@aracna/telegram-bot-types';
|
|
131
149
|
import type { SentWebAppMessage } from '@aracna/telegram-bot-types';
|
|
150
|
+
import type { SetBusinessAccountBio } from '@aracna/telegram-bot-types';
|
|
151
|
+
import type { SetBusinessAccountGiftSettings } from '@aracna/telegram-bot-types';
|
|
152
|
+
import type { SetBusinessAccountName } from '@aracna/telegram-bot-types';
|
|
153
|
+
import type { SetBusinessAccountProfilePhoto } from '@aracna/telegram-bot-types';
|
|
154
|
+
import type { SetBusinessAccountUsername } from '@aracna/telegram-bot-types';
|
|
132
155
|
import type { SetChatAdministratorCustomTitle } from '@aracna/telegram-bot-types';
|
|
133
156
|
import type { SetChatDescription } from '@aracna/telegram-bot-types';
|
|
134
157
|
import type { SetChatMenuButton } from '@aracna/telegram-bot-types';
|
|
@@ -151,6 +174,7 @@ import type { SetStickerMaskPosition } from '@aracna/telegram-bot-types';
|
|
|
151
174
|
import type { SetStickerPositionInSet } from '@aracna/telegram-bot-types';
|
|
152
175
|
import type { SetStickerSetThumbnail } from '@aracna/telegram-bot-types';
|
|
153
176
|
import type { SetStickerSetTitle } from '@aracna/telegram-bot-types';
|
|
177
|
+
import type { SetUserEmojiStatus } from '@aracna/telegram-bot-types';
|
|
154
178
|
import type { SetWebhook } from '@aracna/telegram-bot-types';
|
|
155
179
|
import type { ShippingQuery } from '@aracna/telegram-bot-types';
|
|
156
180
|
import type { StarTransactions } from '@aracna/telegram-bot-types';
|
|
@@ -158,7 +182,10 @@ import type { Sticker } from '@aracna/telegram-bot-types';
|
|
|
158
182
|
import type { StickerSet } from '@aracna/telegram-bot-types';
|
|
159
183
|
import type { StopMessageLiveLocation } from '@aracna/telegram-bot-types';
|
|
160
184
|
import type { StopPoll } from '@aracna/telegram-bot-types';
|
|
185
|
+
import type { Story } from '@aracna/telegram-bot-types';
|
|
161
186
|
import type { SwitchInlineQueryChosenChat } from '@aracna/telegram-bot-types';
|
|
187
|
+
import type { TransferBusinessAccountStars } from '@aracna/telegram-bot-types';
|
|
188
|
+
import type { TransferGift } from '@aracna/telegram-bot-types';
|
|
162
189
|
import type { UnbanChatMember } from '@aracna/telegram-bot-types';
|
|
163
190
|
import type { UnbanChatSenderChat } from '@aracna/telegram-bot-types';
|
|
164
191
|
import type { UnpinAllChatMessages } from '@aracna/telegram-bot-types';
|
|
@@ -166,10 +193,13 @@ import type { UnpinAllForumTopicMessages } from '@aracna/telegram-bot-types';
|
|
|
166
193
|
import type { UnpinAllGeneralForumTopicMessages } from '@aracna/telegram-bot-types';
|
|
167
194
|
import type { UnpinChatMessage } from '@aracna/telegram-bot-types';
|
|
168
195
|
import type { Update } from '@aracna/telegram-bot-types';
|
|
196
|
+
import type { UpgradeGift } from '@aracna/telegram-bot-types';
|
|
169
197
|
import type { UploadStickerFile } from '@aracna/telegram-bot-types';
|
|
170
198
|
import type { User } from '@aracna/telegram-bot-types';
|
|
171
199
|
import type { UserChatBoosts } from '@aracna/telegram-bot-types';
|
|
172
200
|
import type { UserProfilePhotos } from '@aracna/telegram-bot-types';
|
|
201
|
+
import type { VerifyChat } from '@aracna/telegram-bot-types';
|
|
202
|
+
import type { VerifyUser } from '@aracna/telegram-bot-types';
|
|
173
203
|
import type { WebAppInfo } from '@aracna/telegram-bot-types';
|
|
174
204
|
import type { WebhookInfo } from '@aracna/telegram-bot-types';
|
|
175
205
|
|
|
@@ -243,12 +273,15 @@ export declare interface Context {
|
|
|
243
273
|
poll: Poll;
|
|
244
274
|
poll_answer: PollAnswer;
|
|
245
275
|
pre_checkout_query: PreCheckoutQuery;
|
|
276
|
+
purchased_paid_media: PaidMediaPurchased;
|
|
246
277
|
removed_chat_boost: ChatBoostRemoved;
|
|
247
278
|
reply_to_message: ReplyToMessage;
|
|
248
279
|
shipping_query: ShippingQuery;
|
|
249
280
|
start: Start;
|
|
250
281
|
}
|
|
251
282
|
|
|
283
|
+
export declare function convertTelegramGiftToStars(body: ConvertGiftToStars, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
284
|
+
|
|
252
285
|
export declare function copyTelegramMessage(body: CopyMessage, config?: TelegramApiConfig): Promise<MessageId | FetchError>;
|
|
253
286
|
|
|
254
287
|
export declare function copyTelegramMessages(body: CopyMessages, config?: TelegramApiConfig): Promise<MessageId[] | FetchError>;
|
|
@@ -283,6 +316,8 @@ export declare const DEFAULT_TELEGRAM_REPLY_TO_MESSAGE_BODY: () => ReplyToMessag
|
|
|
283
316
|
|
|
284
317
|
export declare const DEFAULT_TELEGRAM_START_MESSAGE_BODY: () => StartBody<any>;
|
|
285
318
|
|
|
319
|
+
export declare function deleteTelegramBusinessMessages(body: DeleteBusinessMessages, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
320
|
+
|
|
286
321
|
export declare function deleteTelegramChatPhoto(body: DeleteChatPhoto, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
287
322
|
|
|
288
323
|
export declare function deleteTelegramChatStickerSet(body: DeleteChatStickerSet, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
@@ -299,6 +334,8 @@ export declare function deleteTelegramStickerFromSet(body: DeleteStickerFromSet,
|
|
|
299
334
|
|
|
300
335
|
export declare function deleteTelegramStickerSet(body: DeleteStickerSet, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
301
336
|
|
|
337
|
+
export declare function deleteTelegramStory(body: DeleteStory, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
338
|
+
|
|
302
339
|
export declare function deleteTelegramWebhook(body?: DeleteWebhook, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
303
340
|
|
|
304
341
|
export declare function downloadTelegramFile(fileID: string, config?: TelegramApiConfig & TelegramFileApiConfig): Promise<Blob | FetchError>;
|
|
@@ -327,6 +364,10 @@ export declare function editTelegramMessageReplyMarkup(body: EditMessageReplyMar
|
|
|
327
364
|
|
|
328
365
|
export declare function editTelegramMessageText(body: EditMessageText, config?: TelegramApiConfig): Promise<Message | FetchError>;
|
|
329
366
|
|
|
367
|
+
export declare function editTelegramStory(body: EditStory, config?: TelegramApiConfig): Promise<Story | FetchError>;
|
|
368
|
+
|
|
369
|
+
export declare function editTelegramUserStarSubscription(body: EditUserStarSubscription, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
370
|
+
|
|
330
371
|
export declare function encodeTelegramCallbackQueryBody<T>(options?: EncodeTelegramCallbackQueryBodyOptions<T>): string;
|
|
331
372
|
|
|
332
373
|
export declare interface EncodeTelegramCallbackQueryBodyOptions<T = any> {
|
|
@@ -377,6 +418,12 @@ export declare function getMyTelegramName(body?: GetMyName, config?: TelegramApi
|
|
|
377
418
|
|
|
378
419
|
export declare function getMyTelegramShortDescription(body?: GetMyShortDescription, config?: TelegramApiConfig): Promise<BotShortDescription | FetchError>;
|
|
379
420
|
|
|
421
|
+
export declare function getTelegramAvailableGifts(config?: TelegramApiConfig): Promise<Gifts | FetchError>;
|
|
422
|
+
|
|
423
|
+
export declare function getTelegramBusinessAccountGifts(body: GetBusinessAccountGifts, config?: TelegramApiConfig): Promise<OwnedGifts | FetchError>;
|
|
424
|
+
|
|
425
|
+
export declare function getTelegramBusinessAccountStarBalance(body: GetBusinessAccountStarBalance, config?: TelegramApiConfig): Promise<number | FetchError>;
|
|
426
|
+
|
|
380
427
|
export declare function getTelegramBusinessConnection(body: GetBusinessConnection, config?: TelegramApiConfig): Promise<BusinessConnection | FetchError>;
|
|
381
428
|
|
|
382
429
|
export declare function getTelegramChat(body: GetChat, config?: TelegramApiConfig): Promise<Chat | FetchError>;
|
|
@@ -453,6 +500,8 @@ export declare function getTelegramUserProfilePhotos(body: GetUserProfilePhotos,
|
|
|
453
500
|
|
|
454
501
|
export declare function getTelegramWebhookInfo(config?: TelegramApiConfig): Promise<WebhookInfo | FetchError>;
|
|
455
502
|
|
|
503
|
+
export declare function giftTelegramPremiumSubscription(body: GiftPremiumSubscription, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
504
|
+
|
|
456
505
|
export declare function hideTelegramGeneralForumTopic(body: HideGeneralForumTopic, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
457
506
|
|
|
458
507
|
export declare type InputFile = File | string;
|
|
@@ -473,14 +522,24 @@ export declare function omitTelegramCommand(string: string | undefined): string;
|
|
|
473
522
|
|
|
474
523
|
export declare function pinTelegramChatMessage(body: PinChatMessage, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
475
524
|
|
|
525
|
+
export declare function postTelegramStory(body: PostStory, config?: TelegramApiConfig): Promise<Story | FetchError>;
|
|
526
|
+
|
|
476
527
|
export declare function promoteTelegramChatMember(body: PromoteChatMember, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
477
528
|
|
|
529
|
+
export declare function readTelegramBusinessMessage(body: ReadBusinessMessage, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
530
|
+
|
|
478
531
|
export declare function refundTelegramStarPayment(body: RefundStarPayment, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
479
532
|
|
|
480
533
|
export declare const REGEXP_TELEGRAM_COMMAND: RegExp;
|
|
481
534
|
|
|
482
535
|
export declare const REGEXP_TELEGRAM_COMMAND_WITH_USERNAME: RegExp;
|
|
483
536
|
|
|
537
|
+
export declare function removeTelegramBusinessAccountProfilePhoto(body: RemoveBusinessAccountProfilePhoto, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
538
|
+
|
|
539
|
+
export declare function removeTelegramChatVerification(body: RemoveChatVerification, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
540
|
+
|
|
541
|
+
export declare function removeTelegramUserVerification(body: RemoveUserVerification, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
542
|
+
|
|
484
543
|
export declare function reopenTelegramForumTopic(body: ReopenForumTopic, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
485
544
|
|
|
486
545
|
export declare function reopenTelegramGeneralForumTopic(body: ReopenGeneralForumTopic, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
@@ -503,6 +562,8 @@ export declare function revokeTelegramChatInviteLink(body: RevokeChatInviteLink,
|
|
|
503
562
|
|
|
504
563
|
export declare function sanitizeTelegramHTML(text: string): string;
|
|
505
564
|
|
|
565
|
+
export declare function saveTelegramPreparedInlineMessage(body: SavePreparedInlineMessage, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
566
|
+
|
|
506
567
|
declare interface SendMediaGroupAlternative extends Omit<SendMediaGroup, 'media'> {
|
|
507
568
|
media: InputMediaAlternative[];
|
|
508
569
|
}
|
|
@@ -531,6 +592,8 @@ export declare function sendTelegramDocument(body: SendDocument, config?: Telegr
|
|
|
531
592
|
|
|
532
593
|
export declare function sendTelegramGame(body: SendGame, config?: TelegramApiConfig): Promise<Message | FetchError>;
|
|
533
594
|
|
|
595
|
+
export declare function sendTelegramGift(body: SendGift, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
596
|
+
|
|
534
597
|
export declare function sendTelegramInvoice(body: SendInvoice, config?: TelegramApiConfig): Promise<Message | FetchError>;
|
|
535
598
|
|
|
536
599
|
export declare function sendTelegramLocation(body: SendLocation, config?: TelegramApiConfig): Promise<Message | FetchError>;
|
|
@@ -569,6 +632,16 @@ export declare function setMyTelegramName(body: SetMyName, config?: TelegramApiC
|
|
|
569
632
|
|
|
570
633
|
export declare function setMyTelegramShortDescription(body: SetMyShortDescription, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
571
634
|
|
|
635
|
+
export declare function setTelegramBusinessAccountBio(body: SetBusinessAccountBio, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
636
|
+
|
|
637
|
+
export declare function setTelegramBusinessAccountGiftSettings(body: SetBusinessAccountGiftSettings, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
638
|
+
|
|
639
|
+
export declare function setTelegramBusinessAccountName(body: SetBusinessAccountName, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
640
|
+
|
|
641
|
+
export declare function setTelegramBusinessAccountProfilePhoto(body: SetBusinessAccountProfilePhoto, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
642
|
+
|
|
643
|
+
export declare function setTelegramBusinessAccountUsername(body: SetBusinessAccountUsername, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
644
|
+
|
|
572
645
|
export declare function setTelegramChatAdministratorCustomTitle(body: SetChatAdministratorCustomTitle, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
573
646
|
|
|
574
647
|
export declare function setTelegramChatDescription(body: SetChatDescription, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
@@ -603,6 +676,8 @@ export declare function setTelegramStickerSetThumbnail(body: SetStickerSetThumbn
|
|
|
603
676
|
|
|
604
677
|
export declare function setTelegramStickerSetTitle(body: SetStickerSetTitle, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
605
678
|
|
|
679
|
+
export declare function setTelegramUserEmojiStatus(body: SetUserEmojiStatus, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
680
|
+
|
|
606
681
|
export declare function setTelegramWebhook(body: SetWebhook, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
607
682
|
|
|
608
683
|
export declare interface Start<T = any> extends Message {
|
|
@@ -657,6 +732,7 @@ export declare class TelegramClient {
|
|
|
657
732
|
protected handlePoll(poll: Poll): TelegramClientListener | undefined;
|
|
658
733
|
protected handlePollAnswer(answer: PollAnswer): TelegramClientListener | undefined;
|
|
659
734
|
protected handlePreCheckoutQuery(query: PreCheckoutQuery): TelegramClientListener | undefined;
|
|
735
|
+
protected handlePurchasedPaidMedia(media: Message): TelegramClientListener | undefined;
|
|
660
736
|
protected handleRemovedChatBoost(removed: ChatBoostRemoved): TelegramClientListener | undefined;
|
|
661
737
|
protected handleReplyToMessage(reply: Message): TelegramClientListener | undefined;
|
|
662
738
|
protected handleShippingQuery(query: ShippingQuery): TelegramClientListener | undefined;
|
|
@@ -717,6 +793,10 @@ export declare enum TelegramLoggerName {
|
|
|
717
793
|
CLASS = "TELEGRAM_CLASS"
|
|
718
794
|
}
|
|
719
795
|
|
|
796
|
+
export declare function transferTelegramBusinessAccountStars(body: TransferBusinessAccountStars, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
797
|
+
|
|
798
|
+
export declare function transferTelegramGift(body: TransferGift, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
799
|
+
|
|
720
800
|
export declare function unbanTelegramChatMember(body: UnbanChatMember, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
721
801
|
|
|
722
802
|
export declare function unbanTelegramChatSenderChat(body: UnbanChatSenderChat, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
@@ -731,8 +811,14 @@ export declare function unpinAllTelegramGeneralForumTopicMessages(body: UnpinAll
|
|
|
731
811
|
|
|
732
812
|
export declare function unpinTelegramChatMessage(body: UnpinChatMessage, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
733
813
|
|
|
734
|
-
export declare type UpdateType = 'business_connection' | 'business_message' | 'callback_query' | 'channel_post' | 'chat_boost' | 'chat_join_request' | 'chat_member' | 'chosen_inline_result' | 'deleted_business_messages' | 'edited_business_message' | 'edited_channel_post' | 'edited_message' | 'inline_query' | 'message' | 'message_reaction' | 'message_reaction_count' | 'my_chat_member' | 'poll' | 'poll_answer' | 'pre_checkout_query' | 'removed_chat_boost' | 'reply_to_message' | 'shipping_query' | 'start';
|
|
814
|
+
export declare type UpdateType = 'business_connection' | 'business_message' | 'callback_query' | 'channel_post' | 'chat_boost' | 'chat_join_request' | 'chat_member' | 'chosen_inline_result' | 'deleted_business_messages' | 'edited_business_message' | 'edited_channel_post' | 'edited_message' | 'inline_query' | 'message' | 'message_reaction' | 'message_reaction_count' | 'my_chat_member' | 'poll' | 'poll_answer' | 'pre_checkout_query' | 'purchased_paid_media' | 'removed_chat_boost' | 'reply_to_message' | 'shipping_query' | 'start';
|
|
815
|
+
|
|
816
|
+
export declare function upgradeTelegramGift(body: UpgradeGift, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
735
817
|
|
|
736
818
|
export declare function uploadTelegramStickerFile(body: UploadStickerFile, config?: TelegramApiConfig): Promise<File_2 | FetchError>;
|
|
737
819
|
|
|
820
|
+
export declare function verifyTelegramChat(body: VerifyChat, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
821
|
+
|
|
822
|
+
export declare function verifyTelegramUser(body: VerifyUser, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
823
|
+
|
|
738
824
|
export { }
|
package/index.js
CHANGED
|
@@ -14,10 +14,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.
|
|
18
|
-
exports.
|
|
19
|
-
exports.
|
|
20
|
-
exports.
|
|
17
|
+
exports.deleteTelegramStickerSet = exports.deleteTelegramStickerFromSet = exports.deleteTelegramMessages = exports.deleteTelegramMessage = exports.deleteTelegramForumTopic = exports.deleteTelegramCommands = exports.deleteTelegramChatStickerSet = exports.deleteTelegramChatPhoto = exports.declineTelegramChatJoinRequest = exports.createTelegramNewStickerSet = exports.createTelegramInvoiceLink = exports.createTelegramForumTopic = exports.createTelegramChatSubscriptionInviteLink = exports.createTelegramChatInviteLink = exports.copyTelegramMessages = exports.copyTelegramMessage = exports.closeTelegramGeneralForumTopic = exports.closeTelegramForumTopic = exports.transferTelegramBusinessAccountStars = exports.setTelegramBusinessAccountUsername = exports.setTelegramBusinessAccountProfilePhoto = exports.setTelegramBusinessAccountName = exports.setTelegramBusinessAccountGiftSettings = exports.setTelegramBusinessAccountBio = exports.removeTelegramBusinessAccountProfilePhoto = exports.readTelegramBusinessMessage = exports.getTelegramBusinessConnection = exports.getTelegramBusinessAccountStarBalance = exports.getTelegramBusinessAccountGifts = exports.deleteTelegramBusinessMessages = exports.banTelegramChatSenderChat = exports.banTelegramChatMember = exports.approveTelegramChatJoinRequest = exports.answerTelegramWebAppQuery = exports.answerTelegramShippingQuery = exports.answerTelegramPreCheckoutQuery = exports.answerTelegramInlineQuery = exports.answerTelegramCallbackQuery = exports.addTelegramStickerToSet = exports.TelegramClassLogger = exports.TelegramLoggerName = exports.REGEXP_TELEGRAM_COMMAND_WITH_USERNAME = exports.REGEXP_TELEGRAM_COMMAND = exports.DEFAULT_TELEGRAM_START_MESSAGE_BODY = exports.DEFAULT_TELEGRAM_REPLY_TO_MESSAGE_BODY = exports.DEFAULT_TELEGRAM_CLIENT_POLLING_MS = exports.DEFAULT_TELEGRAM_CLIENT_LISTENER_OPTIONS = exports.DEFAULT_TELEGRAM_CALLBACK_QUERY_BODY = exports.DEFAULT_TELEGRAM_ALLOWED_UPDATES = exports.TelegramClient = void 0;
|
|
18
|
+
exports.replaceTelegramStickerInSet = exports.reopenTelegramGeneralForumTopic = exports.reopenTelegramForumTopic = exports.refundTelegramStarPayment = exports.promoteTelegramChatMember = exports.pinTelegramChatMessage = exports.logOutTelegram = exports.leaveTelegramChat = exports.hideTelegramGeneralForumTopic = exports.upgradeTelegramGift = exports.transferTelegramGift = exports.sendTelegramGift = exports.giftTelegramPremiumSubscription = exports.getTelegramAvailableGifts = exports.convertTelegramGiftToStars = exports.getTelegramUserProfilePhotos = exports.getTelegramUserChatBoosts = exports.getTelegramUpdates = exports.getTelegramStickerSet = exports.getTelegramStarTransactions = exports.getTelegramMe = exports.getTelegramGameHighScores = exports.getTelegramForumTopicIconStickers = exports.getTelegramFile = exports.getTelegramCustomEmojiStickers = exports.getTelegramChatMenuButton = exports.getTelegramChatMemberCount = exports.getTelegramChatMember = exports.getTelegramChatAdministrators = exports.getTelegramChat = exports.getMyTelegramShortDescription = exports.getMyTelegramName = exports.getMyTelegramDescription = exports.getMyTelegramDefaultAdministratorRights = exports.getMyTelegramCommands = exports.forwardTelegramMessages = exports.forwardTelegramMessage = exports.exportTelegramChatInviteLink = exports.editTelegramUserStarSubscription = exports.editTelegramMessageText = exports.editTelegramMessageReplyMarkup = exports.editTelegramMessageMedia = exports.editTelegramMessageLiveLocation = exports.editTelegramMessageCaption = exports.editTelegramGeneralForumTopic = exports.editTelegramForumTopic = exports.editTelegramChatSubscriptionInviteLink = exports.editTelegramChatInviteLink = exports.downloadTelegramUserFirstProfilePhoto = exports.downloadTelegramFile = void 0;
|
|
19
|
+
exports.deleteTelegramStory = exports.stopTelegramPoll = exports.stopTelegramMessageLiveLocation = exports.setTelegramUserEmojiStatus = exports.setTelegramStickerSetTitle = exports.setTelegramStickerSetThumbnail = exports.setTelegramStickerPositionInSet = exports.setTelegramStickerMaskPosition = exports.setTelegramStickerKeywords = exports.setTelegramStickerEmojiList = exports.setTelegramPassportDataErrors = exports.setTelegramMessageReaction = exports.setTelegramGameScore = exports.setTelegramCustomEmojiStickerSetThumbnail = exports.setTelegramChatTitle = exports.setTelegramChatStickerSet = exports.setTelegramChatPhoto = exports.setTelegramChatPermissions = exports.setTelegramChatMenuButton = exports.setTelegramChatDescription = exports.setTelegramChatAdministratorCustomTitle = exports.setMyTelegramShortDescription = exports.setMyTelegramName = exports.setMyTelegramDescription = exports.setMyTelegramDefaultAdministratorRights = exports.setMyTelegramCommands = exports.sendTelegramVoice = exports.sendTelegramVideoNote = exports.sendTelegramVideo = exports.sendTelegramVenue = exports.sendTelegramSticker = exports.sendTelegramRepliableMessage = exports.sendTelegramPoll = exports.sendTelegramPhoto = exports.sendTelegramPaidMedia = exports.sendTelegramMessageHTML = exports.sendTelegramMessage = exports.sendTelegramMediaGroup = exports.sendTelegramLocation = exports.sendTelegramInvoice = exports.sendTelegramGame = exports.sendTelegramDocument = exports.sendTelegramDice = exports.sendTelegramContact = exports.sendTelegramChatAction = exports.sendTelegramAudio = exports.sendTelegramAnimation = exports.saveTelegramPreparedInlineMessage = exports.revokeTelegramChatInviteLink = exports.restrictTelegramChatMember = void 0;
|
|
20
|
+
exports.encodeTelegramStartBodyToAnchorTag = exports.encodeTelegramStartBody = exports.decodeTelegramStartBody = exports.encodeTelegramReplyToMessageBodyToURL = exports.encodeTelegramReplyToMessageBodyToAnchorTag = exports.encodeTelegramReplyToMessageBody = exports.decodeTelegramReplyToMessageBody = exports.getTelegramInlineKeyboardWebAppButton = exports.getTelegramInlineKeyboardUrlButton = exports.getTelegramInlineKeyboardTextButton = exports.getTelegramInlineKeyboardQueryCurrentChatButton = exports.getTelegramInlineKeyboardQueryChosenChatButton = exports.getTelegramInlineKeyboardQueryButton = exports.getTelegramInlineKeyboardPayButton = exports.getTelegramInlineKeyboardLoginButton = exports.getTelegramInlineKeyboardGameButton = exports.getTelegramInlineKeyboardCallbackButton = exports.sanitizeTelegramHTML = exports.getTelegramProgressHTML = exports.getTelegramContextUserUsername = exports.getTelegramContextUserLastName = exports.getTelegramContextUserID = exports.getTelegramContextUserFirstName = exports.getTelegramContextUser = exports.getTelegramContextChatType = exports.getTelegramContextChatID = exports.getTelegramContextChat = exports.omitTelegramCommand = exports.getTelegramCommandByContext = exports.getTelegramCommand = exports.encodeTelegramCallbackQueryBody = exports.decodeTelegramCallbackQueryBody = exports.setTelegramWebhook = exports.getTelegramWebhookInfo = exports.deleteTelegramWebhook = exports.closeTelegramWebhook = exports.verifyTelegramUser = exports.verifyTelegramChat = exports.removeTelegramUserVerification = exports.removeTelegramChatVerification = exports.uploadTelegramStickerFile = exports.unpinTelegramChatMessage = exports.unpinAllTelegramGeneralForumTopicMessages = exports.unpinAllTelegramForumTopicMessages = exports.unpinAllTelegramChatMessages = exports.unhideTelegramGeneralForumTopic = exports.unbanTelegramChatSenderChat = exports.unbanTelegramChatMember = exports.postTelegramStory = exports.editTelegramStory = void 0;
|
|
21
|
+
exports.encodeTelegramStartBodyToURL = exports.encodeTelegramStartBodyToText = void 0;
|
|
21
22
|
__exportStar(require("./apis/telegram-api"), exports);
|
|
22
23
|
__exportStar(require("./apis/telegram-file-api"), exports);
|
|
23
24
|
var client_1 = require("./classes/client");
|
|
@@ -48,6 +49,19 @@ Object.defineProperty(exports, "approveTelegramChatJoinRequest", { enumerable: t
|
|
|
48
49
|
var ban_requests_1 = require("./requests/ban-requests");
|
|
49
50
|
Object.defineProperty(exports, "banTelegramChatMember", { enumerable: true, get: function () { return ban_requests_1.banChatMember; } });
|
|
50
51
|
Object.defineProperty(exports, "banTelegramChatSenderChat", { enumerable: true, get: function () { return ban_requests_1.banChatSenderChat; } });
|
|
52
|
+
var business_requests_1 = require("./requests/business-requests");
|
|
53
|
+
Object.defineProperty(exports, "deleteTelegramBusinessMessages", { enumerable: true, get: function () { return business_requests_1.deleteBusinessMessages; } });
|
|
54
|
+
Object.defineProperty(exports, "getTelegramBusinessAccountGifts", { enumerable: true, get: function () { return business_requests_1.getBusinessAccountGifts; } });
|
|
55
|
+
Object.defineProperty(exports, "getTelegramBusinessAccountStarBalance", { enumerable: true, get: function () { return business_requests_1.getBusinessAccountStarBalance; } });
|
|
56
|
+
Object.defineProperty(exports, "getTelegramBusinessConnection", { enumerable: true, get: function () { return business_requests_1.getBusinessConnection; } });
|
|
57
|
+
Object.defineProperty(exports, "readTelegramBusinessMessage", { enumerable: true, get: function () { return business_requests_1.readBusinessMessage; } });
|
|
58
|
+
Object.defineProperty(exports, "removeTelegramBusinessAccountProfilePhoto", { enumerable: true, get: function () { return business_requests_1.removeBusinessAccountProfilePhoto; } });
|
|
59
|
+
Object.defineProperty(exports, "setTelegramBusinessAccountBio", { enumerable: true, get: function () { return business_requests_1.setBusinessAccountBio; } });
|
|
60
|
+
Object.defineProperty(exports, "setTelegramBusinessAccountGiftSettings", { enumerable: true, get: function () { return business_requests_1.setBusinessAccountGiftSettings; } });
|
|
61
|
+
Object.defineProperty(exports, "setTelegramBusinessAccountName", { enumerable: true, get: function () { return business_requests_1.setBusinessAccountName; } });
|
|
62
|
+
Object.defineProperty(exports, "setTelegramBusinessAccountProfilePhoto", { enumerable: true, get: function () { return business_requests_1.setBusinessAccountProfilePhoto; } });
|
|
63
|
+
Object.defineProperty(exports, "setTelegramBusinessAccountUsername", { enumerable: true, get: function () { return business_requests_1.setBusinessAccountUsername; } });
|
|
64
|
+
Object.defineProperty(exports, "transferTelegramBusinessAccountStars", { enumerable: true, get: function () { return business_requests_1.transferBusinessAccountStars; } });
|
|
51
65
|
var close_requests_1 = require("./requests/close-requests");
|
|
52
66
|
Object.defineProperty(exports, "closeTelegramForumTopic", { enumerable: true, get: function () { return close_requests_1.closeForumTopic; } });
|
|
53
67
|
Object.defineProperty(exports, "closeTelegramGeneralForumTopic", { enumerable: true, get: function () { return close_requests_1.closeGeneralForumTopic; } });
|
|
@@ -84,6 +98,7 @@ Object.defineProperty(exports, "editTelegramMessageLiveLocation", { enumerable:
|
|
|
84
98
|
Object.defineProperty(exports, "editTelegramMessageMedia", { enumerable: true, get: function () { return edit_requests_1.editMessageMedia; } });
|
|
85
99
|
Object.defineProperty(exports, "editTelegramMessageReplyMarkup", { enumerable: true, get: function () { return edit_requests_1.editMessageReplyMarkup; } });
|
|
86
100
|
Object.defineProperty(exports, "editTelegramMessageText", { enumerable: true, get: function () { return edit_requests_1.editMessageText; } });
|
|
101
|
+
Object.defineProperty(exports, "editTelegramUserStarSubscription", { enumerable: true, get: function () { return edit_requests_1.editUserStarSubscription; } });
|
|
87
102
|
var export_requests_1 = require("./requests/export-requests");
|
|
88
103
|
Object.defineProperty(exports, "exportTelegramChatInviteLink", { enumerable: true, get: function () { return export_requests_1.exportChatInviteLink; } });
|
|
89
104
|
var forward_requests_1 = require("./requests/forward-requests");
|
|
@@ -95,7 +110,6 @@ Object.defineProperty(exports, "getMyTelegramDefaultAdministratorRights", { enum
|
|
|
95
110
|
Object.defineProperty(exports, "getMyTelegramDescription", { enumerable: true, get: function () { return get_requests_1.getMyDescription; } });
|
|
96
111
|
Object.defineProperty(exports, "getMyTelegramName", { enumerable: true, get: function () { return get_requests_1.getMyName; } });
|
|
97
112
|
Object.defineProperty(exports, "getMyTelegramShortDescription", { enumerable: true, get: function () { return get_requests_1.getMyShortDescription; } });
|
|
98
|
-
Object.defineProperty(exports, "getTelegramBusinessConnection", { enumerable: true, get: function () { return get_requests_1.getBusinessConnection; } });
|
|
99
113
|
Object.defineProperty(exports, "getTelegramChat", { enumerable: true, get: function () { return get_requests_1.getChat; } });
|
|
100
114
|
Object.defineProperty(exports, "getTelegramChatAdministrators", { enumerable: true, get: function () { return get_requests_1.getChatAdministrators; } });
|
|
101
115
|
Object.defineProperty(exports, "getTelegramChatMember", { enumerable: true, get: function () { return get_requests_1.getChatMember; } });
|
|
@@ -111,6 +125,13 @@ Object.defineProperty(exports, "getTelegramStickerSet", { enumerable: true, get:
|
|
|
111
125
|
Object.defineProperty(exports, "getTelegramUpdates", { enumerable: true, get: function () { return get_requests_1.getUpdates; } });
|
|
112
126
|
Object.defineProperty(exports, "getTelegramUserChatBoosts", { enumerable: true, get: function () { return get_requests_1.getUserChatBoosts; } });
|
|
113
127
|
Object.defineProperty(exports, "getTelegramUserProfilePhotos", { enumerable: true, get: function () { return get_requests_1.getUserProfilePhotos; } });
|
|
128
|
+
var gift_requests_1 = require("./requests/gift-requests");
|
|
129
|
+
Object.defineProperty(exports, "convertTelegramGiftToStars", { enumerable: true, get: function () { return gift_requests_1.convertGiftToStars; } });
|
|
130
|
+
Object.defineProperty(exports, "getTelegramAvailableGifts", { enumerable: true, get: function () { return gift_requests_1.getAvailableGifts; } });
|
|
131
|
+
Object.defineProperty(exports, "giftTelegramPremiumSubscription", { enumerable: true, get: function () { return gift_requests_1.giftPremiumSubscription; } });
|
|
132
|
+
Object.defineProperty(exports, "sendTelegramGift", { enumerable: true, get: function () { return gift_requests_1.sendGift; } });
|
|
133
|
+
Object.defineProperty(exports, "transferTelegramGift", { enumerable: true, get: function () { return gift_requests_1.transferGift; } });
|
|
134
|
+
Object.defineProperty(exports, "upgradeTelegramGift", { enumerable: true, get: function () { return gift_requests_1.upgradeGift; } });
|
|
114
135
|
var hide_requests_1 = require("./requests/hide-requests");
|
|
115
136
|
Object.defineProperty(exports, "hideTelegramGeneralForumTopic", { enumerable: true, get: function () { return hide_requests_1.hideGeneralForumTopic; } });
|
|
116
137
|
var leave_requests_1 = require("./requests/leave-requests");
|
|
@@ -132,6 +153,8 @@ var restrict_requests_1 = require("./requests/restrict-requests");
|
|
|
132
153
|
Object.defineProperty(exports, "restrictTelegramChatMember", { enumerable: true, get: function () { return restrict_requests_1.restrictChatMember; } });
|
|
133
154
|
var revoke_requests_1 = require("./requests/revoke-requests");
|
|
134
155
|
Object.defineProperty(exports, "revokeTelegramChatInviteLink", { enumerable: true, get: function () { return revoke_requests_1.revokeChatInviteLink; } });
|
|
156
|
+
var save_requests_1 = require("./requests/save-requests");
|
|
157
|
+
Object.defineProperty(exports, "saveTelegramPreparedInlineMessage", { enumerable: true, get: function () { return save_requests_1.savePreparedInlineMessage; } });
|
|
135
158
|
var send_requests_1 = require("./requests/send-requests");
|
|
136
159
|
Object.defineProperty(exports, "sendTelegramAnimation", { enumerable: true, get: function () { return send_requests_1.sendAnimation; } });
|
|
137
160
|
Object.defineProperty(exports, "sendTelegramAudio", { enumerable: true, get: function () { return send_requests_1.sendAudio; } });
|
|
@@ -177,9 +200,14 @@ Object.defineProperty(exports, "setTelegramStickerMaskPosition", { enumerable: t
|
|
|
177
200
|
Object.defineProperty(exports, "setTelegramStickerPositionInSet", { enumerable: true, get: function () { return set_requests_1.setStickerPositionInSet; } });
|
|
178
201
|
Object.defineProperty(exports, "setTelegramStickerSetThumbnail", { enumerable: true, get: function () { return set_requests_1.setStickerSetThumbnail; } });
|
|
179
202
|
Object.defineProperty(exports, "setTelegramStickerSetTitle", { enumerable: true, get: function () { return set_requests_1.setStickerSetTitle; } });
|
|
203
|
+
Object.defineProperty(exports, "setTelegramUserEmojiStatus", { enumerable: true, get: function () { return set_requests_1.setUserEmojiStatus; } });
|
|
180
204
|
var stop_requests_1 = require("./requests/stop-requests");
|
|
181
205
|
Object.defineProperty(exports, "stopTelegramMessageLiveLocation", { enumerable: true, get: function () { return stop_requests_1.stopMessageLiveLocation; } });
|
|
182
206
|
Object.defineProperty(exports, "stopTelegramPoll", { enumerable: true, get: function () { return stop_requests_1.stopPoll; } });
|
|
207
|
+
var story_requests_1 = require("./requests/story-requests");
|
|
208
|
+
Object.defineProperty(exports, "deleteTelegramStory", { enumerable: true, get: function () { return story_requests_1.deleteStory; } });
|
|
209
|
+
Object.defineProperty(exports, "editTelegramStory", { enumerable: true, get: function () { return story_requests_1.editStory; } });
|
|
210
|
+
Object.defineProperty(exports, "postTelegramStory", { enumerable: true, get: function () { return story_requests_1.postStory; } });
|
|
183
211
|
var unban_requests_1 = require("./requests/unban-requests");
|
|
184
212
|
Object.defineProperty(exports, "unbanTelegramChatMember", { enumerable: true, get: function () { return unban_requests_1.unbanChatMember; } });
|
|
185
213
|
Object.defineProperty(exports, "unbanTelegramChatSenderChat", { enumerable: true, get: function () { return unban_requests_1.unbanChatSenderChat; } });
|
|
@@ -192,6 +220,11 @@ Object.defineProperty(exports, "unpinAllTelegramGeneralForumTopicMessages", { en
|
|
|
192
220
|
Object.defineProperty(exports, "unpinTelegramChatMessage", { enumerable: true, get: function () { return unpin_requests_1.unpinChatMessage; } });
|
|
193
221
|
var upload_requests_1 = require("./requests/upload-requests");
|
|
194
222
|
Object.defineProperty(exports, "uploadTelegramStickerFile", { enumerable: true, get: function () { return upload_requests_1.uploadStickerFile; } });
|
|
223
|
+
var verification_requests_1 = require("./requests/verification-requests");
|
|
224
|
+
Object.defineProperty(exports, "removeTelegramChatVerification", { enumerable: true, get: function () { return verification_requests_1.removeChatVerification; } });
|
|
225
|
+
Object.defineProperty(exports, "removeTelegramUserVerification", { enumerable: true, get: function () { return verification_requests_1.removeUserVerification; } });
|
|
226
|
+
Object.defineProperty(exports, "verifyTelegramChat", { enumerable: true, get: function () { return verification_requests_1.verifyChat; } });
|
|
227
|
+
Object.defineProperty(exports, "verifyTelegramUser", { enumerable: true, get: function () { return verification_requests_1.verifyUser; } });
|
|
195
228
|
var webhook_requests_1 = require("./requests/webhook-requests");
|
|
196
229
|
Object.defineProperty(exports, "closeTelegramWebhook", { enumerable: true, get: function () { return webhook_requests_1.closeWebhook; } });
|
|
197
230
|
Object.defineProperty(exports, "deleteTelegramWebhook", { enumerable: true, get: function () { return webhook_requests_1.deleteWebhook; } });
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"author": "Dario Sechi",
|
|
3
3
|
"devDependencies": {
|
|
4
4
|
"@aracna/core": "^1.3.1",
|
|
5
|
-
"@aracna/telegram-bot-types": "^1.2.
|
|
5
|
+
"@aracna/telegram-bot-types": "^1.2.17",
|
|
6
6
|
"@fastify/multipart": "^9.0.3",
|
|
7
7
|
"@microsoft/api-extractor": "^7.52.8",
|
|
8
8
|
"@ngrok/ngrok": "^1.5.1",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"repository": "https://github.com/queelag/telegram-bot",
|
|
38
38
|
"types": "index.d.ts",
|
|
39
|
-
"version": "2.0.
|
|
39
|
+
"version": "2.0.7",
|
|
40
40
|
"scripts": {
|
|
41
41
|
"build": "node scripts/build.mjs && pnpm tsc && pnpm api-extractor run --local",
|
|
42
42
|
"prepublish": "pnpm test && pnpm build && node scripts/pre-publish.mjs",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type FetchError } from '@aracna/core';
|
|
2
2
|
import type { AddStickerToSet } from '@aracna/telegram-bot-types';
|
|
3
3
|
import { TelegramApiConfig } from '../definitions/interfaces';
|
|
4
4
|
export declare function addStickerToSet(body: AddStickerToSet, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type FetchError } from '@aracna/core';
|
|
2
|
+
import type { BusinessConnection, DeleteBusinessMessages, GetBusinessAccountGifts, GetBusinessAccountStarBalance, GetBusinessConnection, OwnedGifts, ReadBusinessMessage, RemoveBusinessAccountProfilePhoto, SetBusinessAccountBio, SetBusinessAccountGiftSettings, SetBusinessAccountName, SetBusinessAccountProfilePhoto, SetBusinessAccountUsername, TransferBusinessAccountStars } from '@aracna/telegram-bot-types';
|
|
3
|
+
import type { TelegramApiConfig } from '../definitions/interfaces';
|
|
4
|
+
export declare function deleteBusinessMessages(body: DeleteBusinessMessages, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
5
|
+
export declare function getBusinessAccountGifts(body: GetBusinessAccountGifts, config?: TelegramApiConfig): Promise<OwnedGifts | FetchError>;
|
|
6
|
+
export declare function getBusinessAccountStarBalance(body: GetBusinessAccountStarBalance, config?: TelegramApiConfig): Promise<number | FetchError>;
|
|
7
|
+
export declare function getBusinessConnection(body: GetBusinessConnection, config?: TelegramApiConfig): Promise<BusinessConnection | FetchError>;
|
|
8
|
+
export declare function readBusinessMessage(body: ReadBusinessMessage, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
9
|
+
export declare function removeBusinessAccountProfilePhoto(body: RemoveBusinessAccountProfilePhoto, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
10
|
+
export declare function setBusinessAccountBio(body: SetBusinessAccountBio, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
11
|
+
export declare function setBusinessAccountGiftSettings(body: SetBusinessAccountGiftSettings, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
12
|
+
export declare function setBusinessAccountName(body: SetBusinessAccountName, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
13
|
+
export declare function setBusinessAccountProfilePhoto(body: SetBusinessAccountProfilePhoto, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
14
|
+
export declare function setBusinessAccountUsername(body: SetBusinessAccountUsername, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
15
|
+
export declare function transferBusinessAccountStars(body: TransferBusinessAccountStars, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deleteBusinessMessages = deleteBusinessMessages;
|
|
4
|
+
exports.getBusinessAccountGifts = getBusinessAccountGifts;
|
|
5
|
+
exports.getBusinessAccountStarBalance = getBusinessAccountStarBalance;
|
|
6
|
+
exports.getBusinessConnection = getBusinessConnection;
|
|
7
|
+
exports.readBusinessMessage = readBusinessMessage;
|
|
8
|
+
exports.removeBusinessAccountProfilePhoto = removeBusinessAccountProfilePhoto;
|
|
9
|
+
exports.setBusinessAccountBio = setBusinessAccountBio;
|
|
10
|
+
exports.setBusinessAccountGiftSettings = setBusinessAccountGiftSettings;
|
|
11
|
+
exports.setBusinessAccountName = setBusinessAccountName;
|
|
12
|
+
exports.setBusinessAccountProfilePhoto = setBusinessAccountProfilePhoto;
|
|
13
|
+
exports.setBusinessAccountUsername = setBusinessAccountUsername;
|
|
14
|
+
exports.transferBusinessAccountStars = transferBusinessAccountStars;
|
|
15
|
+
const telegram_api_1 = require("../apis/telegram-api");
|
|
16
|
+
async function deleteBusinessMessages(body, config) {
|
|
17
|
+
return telegram_api_1.TelegramAPI.post('deleteBusinessMessages', body, config);
|
|
18
|
+
}
|
|
19
|
+
async function getBusinessAccountGifts(body, config) {
|
|
20
|
+
return telegram_api_1.TelegramAPI.post('getBusinessAccountGifts', body, config);
|
|
21
|
+
}
|
|
22
|
+
async function getBusinessAccountStarBalance(body, config) {
|
|
23
|
+
return telegram_api_1.TelegramAPI.post('getBusinessAccountStarBalance', body, config);
|
|
24
|
+
}
|
|
25
|
+
async function getBusinessConnection(body, config) {
|
|
26
|
+
return telegram_api_1.TelegramAPI.post('getBusinessConnection', body, config);
|
|
27
|
+
}
|
|
28
|
+
async function readBusinessMessage(body, config) {
|
|
29
|
+
return telegram_api_1.TelegramAPI.post('readBusinessMessage', body, config);
|
|
30
|
+
}
|
|
31
|
+
async function removeBusinessAccountProfilePhoto(body, config) {
|
|
32
|
+
return telegram_api_1.TelegramAPI.post('removeBusinessAccountProfilePhoto', body, config);
|
|
33
|
+
}
|
|
34
|
+
async function setBusinessAccountBio(body, config) {
|
|
35
|
+
return telegram_api_1.TelegramAPI.post('setBusinessAccountBio', body, config);
|
|
36
|
+
}
|
|
37
|
+
async function setBusinessAccountGiftSettings(body, config) {
|
|
38
|
+
return telegram_api_1.TelegramAPI.post('setBusinessAccountGiftSettings', body, config);
|
|
39
|
+
}
|
|
40
|
+
async function setBusinessAccountName(body, config) {
|
|
41
|
+
return telegram_api_1.TelegramAPI.post('setBusinessAccountName', body, config);
|
|
42
|
+
}
|
|
43
|
+
async function setBusinessAccountProfilePhoto(body, config) {
|
|
44
|
+
return telegram_api_1.TelegramAPI.post('setBusinessAccountProfilePhoto', {
|
|
45
|
+
...body,
|
|
46
|
+
photo: 'animation' in body.photo && body.photo.animation instanceof Blob
|
|
47
|
+
? { ...body.photo, animation: 'attach://photo_blob' }
|
|
48
|
+
: 'photo' in body.photo && body.photo.photo instanceof Blob
|
|
49
|
+
? { ...body.photo, photo: 'attach://photo_blob' }
|
|
50
|
+
: body.photo,
|
|
51
|
+
...('animation' in body.photo && body.photo.animation instanceof Blob
|
|
52
|
+
? { photo_blob: body.photo.animation }
|
|
53
|
+
: 'photo' in body.photo && body.photo.photo instanceof Blob
|
|
54
|
+
? { photo_blob: body.photo.photo }
|
|
55
|
+
: {})
|
|
56
|
+
}, config);
|
|
57
|
+
}
|
|
58
|
+
async function setBusinessAccountUsername(body, config) {
|
|
59
|
+
return telegram_api_1.TelegramAPI.post('setBusinessAccountUsername', body, config);
|
|
60
|
+
}
|
|
61
|
+
async function transferBusinessAccountStars(body, config) {
|
|
62
|
+
return telegram_api_1.TelegramAPI.post('transferBusinessAccountStars', body, config);
|
|
63
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type FetchError } from '@aracna/core';
|
|
2
2
|
import type { ChatInviteLink, CreateChatInviteLink, CreateChatSubscriptionInviteLink, CreateForumTopic, CreateInvoiceLink, CreateNewStickerSet, ForumTopic } from '@aracna/telegram-bot-types';
|
|
3
3
|
import type { TelegramApiConfig } from '../definitions/interfaces';
|
|
4
4
|
export declare function createChatInviteLink(body: CreateChatInviteLink, config?: TelegramApiConfig): Promise<ChatInviteLink | FetchError>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FetchError } from '@aracna/core';
|
|
2
|
-
import type { ChatInviteLink, EditChatInviteLink, EditChatSubscriptionInviteLink, EditForumTopic, EditGeneralForumTopic, EditMessageCaption, EditMessageLiveLocation, EditMessageReplyMarkup, EditMessageText, Message } from '@aracna/telegram-bot-types';
|
|
2
|
+
import type { ChatInviteLink, EditChatInviteLink, EditChatSubscriptionInviteLink, EditForumTopic, EditGeneralForumTopic, EditMessageCaption, EditMessageLiveLocation, EditMessageReplyMarkup, EditMessageText, EditUserStarSubscription, Message } from '@aracna/telegram-bot-types';
|
|
3
3
|
import type { TelegramApiConfig } from '../definitions/interfaces';
|
|
4
4
|
import { EditMessageMediaAlternative } from '../definitions/interfaces';
|
|
5
5
|
export declare function editChatInviteLink(body: EditChatInviteLink, config?: TelegramApiConfig): Promise<ChatInviteLink | FetchError>;
|
|
@@ -11,3 +11,4 @@ export declare function editMessageLiveLocation(body: EditMessageLiveLocation, c
|
|
|
11
11
|
export declare function editMessageMedia(body: EditMessageMediaAlternative, config?: TelegramApiConfig): Promise<Message | FetchError>;
|
|
12
12
|
export declare function editMessageReplyMarkup(body: EditMessageReplyMarkup, config?: TelegramApiConfig): Promise<Message | FetchError>;
|
|
13
13
|
export declare function editMessageText(body: EditMessageText, config?: TelegramApiConfig): Promise<Message | FetchError>;
|
|
14
|
+
export declare function editUserStarSubscription(body: EditUserStarSubscription, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
@@ -9,6 +9,7 @@ exports.editMessageLiveLocation = editMessageLiveLocation;
|
|
|
9
9
|
exports.editMessageMedia = editMessageMedia;
|
|
10
10
|
exports.editMessageReplyMarkup = editMessageReplyMarkup;
|
|
11
11
|
exports.editMessageText = editMessageText;
|
|
12
|
+
exports.editUserStarSubscription = editUserStarSubscription;
|
|
12
13
|
const telegram_api_1 = require("../apis/telegram-api");
|
|
13
14
|
async function editChatInviteLink(body, config) {
|
|
14
15
|
return telegram_api_1.TelegramAPI.post('editChatInviteLink', body, config);
|
|
@@ -44,3 +45,6 @@ async function editMessageReplyMarkup(body, config) {
|
|
|
44
45
|
async function editMessageText(body, config) {
|
|
45
46
|
return telegram_api_1.TelegramAPI.post('editMessageText', body, config);
|
|
46
47
|
}
|
|
48
|
+
async function editUserStarSubscription(body, config) {
|
|
49
|
+
return telegram_api_1.TelegramAPI.post('editUserStarSubscription', body, config);
|
|
50
|
+
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { FetchError } from '@aracna/core';
|
|
2
|
-
import type { BotCommand, BotDescription, BotName, BotShortDescription,
|
|
2
|
+
import type { BotCommand, BotDescription, BotName, BotShortDescription, Chat, ChatAdministratorRights, ChatMember, File, GameHighScore, GetChat, GetChatAdministrators, GetChatMember, GetChatMemberCount, GetChatMenuButton, GetCustomEmojiStickers, GetFile, GetGameHighScores, GetMyCommands, GetMyDefaultAdministratorRights, GetMyDescription, GetMyName, GetMyShortDescription, GetStarTransactions, GetStickerSet, GetUpdates, GetUserChatBoosts, GetUserProfilePhotos, MenuButton, StarTransactions, Sticker, StickerSet, Update, User, UserChatBoosts, UserProfilePhotos } from '@aracna/telegram-bot-types';
|
|
3
3
|
import type { TelegramApiConfig } from '../definitions/interfaces';
|
|
4
|
-
export declare function getBusinessConnection(body: GetBusinessConnection, config?: TelegramApiConfig): Promise<BusinessConnection | FetchError>;
|
|
5
4
|
export declare function getChat(body: GetChat, config?: TelegramApiConfig): Promise<Chat | FetchError>;
|
|
6
5
|
export declare function getChatAdministrators(body: GetChatAdministrators, config?: TelegramApiConfig): Promise<ChatMember[] | FetchError>;
|
|
7
6
|
export declare function getChatMember(body: GetChatMember, config?: TelegramApiConfig): Promise<ChatMember | FetchError>;
|
package/requests/get-requests.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getBusinessConnection = getBusinessConnection;
|
|
4
3
|
exports.getChat = getChat;
|
|
5
4
|
exports.getChatAdministrators = getChatAdministrators;
|
|
6
5
|
exports.getChatMember = getChatMember;
|
|
@@ -23,9 +22,6 @@ exports.getUserChatBoosts = getUserChatBoosts;
|
|
|
23
22
|
exports.getUserProfilePhotos = getUserProfilePhotos;
|
|
24
23
|
const telegram_api_1 = require("../apis/telegram-api");
|
|
25
24
|
const constants_1 = require("../definitions/constants");
|
|
26
|
-
async function getBusinessConnection(body, config) {
|
|
27
|
-
return telegram_api_1.TelegramAPI.post('getBusinessConnection', body, config);
|
|
28
|
-
}
|
|
29
25
|
async function getChat(body, config) {
|
|
30
26
|
return telegram_api_1.TelegramAPI.post('getChat', body, config);
|
|
31
27
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { FetchError } from '@aracna/core';
|
|
2
|
+
import type { ConvertGiftToStars, GiftPremiumSubscription, Gifts, SendGift, TransferGift, UpgradeGift } from '@aracna/telegram-bot-types';
|
|
3
|
+
import type { TelegramApiConfig } from '../definitions/interfaces';
|
|
4
|
+
export declare function convertGiftToStars(body: ConvertGiftToStars, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
5
|
+
export declare function getAvailableGifts(config?: TelegramApiConfig): Promise<Gifts | FetchError>;
|
|
6
|
+
export declare function giftPremiumSubscription(body: GiftPremiumSubscription, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
7
|
+
export declare function sendGift(body: SendGift, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
8
|
+
export declare function transferGift(body: TransferGift, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
9
|
+
export declare function upgradeGift(body: UpgradeGift, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.convertGiftToStars = convertGiftToStars;
|
|
4
|
+
exports.getAvailableGifts = getAvailableGifts;
|
|
5
|
+
exports.giftPremiumSubscription = giftPremiumSubscription;
|
|
6
|
+
exports.sendGift = sendGift;
|
|
7
|
+
exports.transferGift = transferGift;
|
|
8
|
+
exports.upgradeGift = upgradeGift;
|
|
9
|
+
const telegram_api_1 = require("../apis/telegram-api");
|
|
10
|
+
async function convertGiftToStars(body, config) {
|
|
11
|
+
return telegram_api_1.TelegramAPI.post('convertGiftToStars', body, config);
|
|
12
|
+
}
|
|
13
|
+
async function getAvailableGifts(config) {
|
|
14
|
+
return telegram_api_1.TelegramAPI.post('getAvailableGifts', undefined, config);
|
|
15
|
+
}
|
|
16
|
+
async function giftPremiumSubscription(body, config) {
|
|
17
|
+
return telegram_api_1.TelegramAPI.post('giftPremiumSubscription', body, config);
|
|
18
|
+
}
|
|
19
|
+
async function sendGift(body, config) {
|
|
20
|
+
return telegram_api_1.TelegramAPI.post('sendGift', body, config);
|
|
21
|
+
}
|
|
22
|
+
async function transferGift(body, config) {
|
|
23
|
+
return telegram_api_1.TelegramAPI.post('transferGift', body, config);
|
|
24
|
+
}
|
|
25
|
+
async function upgradeGift(body, config) {
|
|
26
|
+
return telegram_api_1.TelegramAPI.post('upgradeGift', body, config);
|
|
27
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type FetchError } from '@aracna/core';
|
|
2
2
|
import type { ReplaceStickerInSet } from '@aracna/telegram-bot-types';
|
|
3
3
|
import type { TelegramApiConfig } from '../definitions/interfaces';
|
|
4
4
|
export declare function replaceStickerInSet(body: ReplaceStickerInSet, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { FetchError } from '@aracna/core';
|
|
2
|
+
import type { SavePreparedInlineMessage } from '@aracna/telegram-bot-types';
|
|
3
|
+
import type { TelegramApiConfig } from '../definitions/interfaces';
|
|
4
|
+
export declare function savePreparedInlineMessage(body: SavePreparedInlineMessage, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.savePreparedInlineMessage = savePreparedInlineMessage;
|
|
4
|
+
const telegram_api_1 = require("../apis/telegram-api");
|
|
5
|
+
async function savePreparedInlineMessage(body, config) {
|
|
6
|
+
return telegram_api_1.TelegramAPI.post('savePreparedInlineMessage', body, config);
|
|
7
|
+
}
|
|
@@ -92,7 +92,11 @@ async function sendVenue(body, config) {
|
|
|
92
92
|
return telegram_api_1.TelegramAPI.post('sendVenue', body, config);
|
|
93
93
|
}
|
|
94
94
|
async function sendVideo(body, config) {
|
|
95
|
-
return telegram_api_1.TelegramAPI.post('sendVideo',
|
|
95
|
+
return telegram_api_1.TelegramAPI.post('sendVideo', {
|
|
96
|
+
...body,
|
|
97
|
+
cover: body.cover instanceof Blob ? `attach://cover_blob` : body.cover,
|
|
98
|
+
...(body.cover instanceof Blob ? { cover_blob: body.cover } : {})
|
|
99
|
+
}, config);
|
|
96
100
|
}
|
|
97
101
|
async function sendVideoNote(body, config) {
|
|
98
102
|
return telegram_api_1.TelegramAPI.post('sendVideoNote', body, config);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type { SetChatAdministratorCustomTitle, SetChatDescription, SetChatMenuButton, SetChatPermissions, SetChatPhoto, SetChatStickerSet, SetChatTitle, SetCustomEmojiStickerSetThumbnail, SetGameScore, SetMessageReaction, SetMyCommands, SetMyDefaultAdministratorRights, SetMyDescription, SetMyName, SetMyShortDescription, SetPassportDataErrors, SetStickerEmojiList, SetStickerKeywords, SetStickerMaskPosition, SetStickerPositionInSet, SetStickerSetThumbnail, SetStickerSetTitle } from '@aracna/telegram-bot-types';
|
|
1
|
+
import { type FetchError } from '@aracna/core';
|
|
2
|
+
import type { SetChatAdministratorCustomTitle, SetChatDescription, SetChatMenuButton, SetChatPermissions, SetChatPhoto, SetChatStickerSet, SetChatTitle, SetCustomEmojiStickerSetThumbnail, SetGameScore, SetMessageReaction, SetMyCommands, SetMyDefaultAdministratorRights, SetMyDescription, SetMyName, SetMyShortDescription, SetPassportDataErrors, SetStickerEmojiList, SetStickerKeywords, SetStickerMaskPosition, SetStickerPositionInSet, SetStickerSetThumbnail, SetStickerSetTitle, SetUserEmojiStatus } from '@aracna/telegram-bot-types';
|
|
3
3
|
import type { TelegramApiConfig } from '../definitions/interfaces';
|
|
4
4
|
export declare function setChatAdministratorCustomTitle(body: SetChatAdministratorCustomTitle, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
5
5
|
export declare function setChatDescription(body: SetChatDescription, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
@@ -23,3 +23,4 @@ export declare function setStickerMaskPosition(body: SetStickerMaskPosition, con
|
|
|
23
23
|
export declare function setStickerPositionInSet(body: SetStickerPositionInSet, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
24
24
|
export declare function setStickerSetThumbnail(body: SetStickerSetThumbnail, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
25
25
|
export declare function setStickerSetTitle(body: SetStickerSetTitle, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
26
|
+
export declare function setUserEmojiStatus(body: SetUserEmojiStatus, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
package/requests/set-requests.js
CHANGED
|
@@ -22,6 +22,7 @@ exports.setStickerMaskPosition = setStickerMaskPosition;
|
|
|
22
22
|
exports.setStickerPositionInSet = setStickerPositionInSet;
|
|
23
23
|
exports.setStickerSetThumbnail = setStickerSetThumbnail;
|
|
24
24
|
exports.setStickerSetTitle = setStickerSetTitle;
|
|
25
|
+
exports.setUserEmojiStatus = setUserEmojiStatus;
|
|
25
26
|
const telegram_api_1 = require("../apis/telegram-api");
|
|
26
27
|
async function setChatAdministratorCustomTitle(body, config) {
|
|
27
28
|
return telegram_api_1.TelegramAPI.post('setChatAdministratorCustomTitle', body, config);
|
|
@@ -93,3 +94,6 @@ async function setStickerSetThumbnail(body, config) {
|
|
|
93
94
|
async function setStickerSetTitle(body, config) {
|
|
94
95
|
return telegram_api_1.TelegramAPI.post('setStickerSetTitle', body, config);
|
|
95
96
|
}
|
|
97
|
+
async function setUserEmojiStatus(body, config) {
|
|
98
|
+
return telegram_api_1.TelegramAPI.post('setUserEmojiStatus', body, config);
|
|
99
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { FetchError } from '@aracna/core';
|
|
2
|
+
import type { DeleteStory, EditStory, PostStory, Story } from '@aracna/telegram-bot-types';
|
|
3
|
+
import type { TelegramApiConfig } from '../definitions/interfaces';
|
|
4
|
+
export declare function deleteStory(body: DeleteStory, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
5
|
+
export declare function editStory(body: EditStory, config?: TelegramApiConfig): Promise<Story | FetchError>;
|
|
6
|
+
export declare function postStory(body: PostStory, config?: TelegramApiConfig): Promise<Story | FetchError>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deleteStory = deleteStory;
|
|
4
|
+
exports.editStory = editStory;
|
|
5
|
+
exports.postStory = postStory;
|
|
6
|
+
const telegram_api_1 = require("../apis/telegram-api");
|
|
7
|
+
async function deleteStory(body, config) {
|
|
8
|
+
return telegram_api_1.TelegramAPI.post('deleteStory', body, config);
|
|
9
|
+
}
|
|
10
|
+
async function editStory(body, config) {
|
|
11
|
+
return telegram_api_1.TelegramAPI.post('editStory', body, config);
|
|
12
|
+
}
|
|
13
|
+
async function postStory(body, config) {
|
|
14
|
+
return telegram_api_1.TelegramAPI.post('postStory', body, config);
|
|
15
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { FetchError } from '@aracna/core';
|
|
2
|
+
import type { RemoveChatVerification, RemoveUserVerification, VerifyChat, VerifyUser } from '@aracna/telegram-bot-types';
|
|
3
|
+
import type { TelegramApiConfig } from '../definitions/interfaces';
|
|
4
|
+
export declare function removeChatVerification(body: RemoveChatVerification, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
5
|
+
export declare function removeUserVerification(body: RemoveUserVerification, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
6
|
+
export declare function verifyChat(body: VerifyChat, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
7
|
+
export declare function verifyUser(body: VerifyUser, config?: TelegramApiConfig): Promise<boolean | FetchError>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.removeChatVerification = removeChatVerification;
|
|
4
|
+
exports.removeUserVerification = removeUserVerification;
|
|
5
|
+
exports.verifyChat = verifyChat;
|
|
6
|
+
exports.verifyUser = verifyUser;
|
|
7
|
+
const telegram_api_1 = require("../apis/telegram-api");
|
|
8
|
+
async function removeChatVerification(body, config) {
|
|
9
|
+
return telegram_api_1.TelegramAPI.post('removeChatVerification', body, config);
|
|
10
|
+
}
|
|
11
|
+
async function removeUserVerification(body, config) {
|
|
12
|
+
return telegram_api_1.TelegramAPI.post('removeUserVerification', body, config);
|
|
13
|
+
}
|
|
14
|
+
async function verifyChat(body, config) {
|
|
15
|
+
return telegram_api_1.TelegramAPI.post('verifyChat', body, config);
|
|
16
|
+
}
|
|
17
|
+
async function verifyUser(body, config) {
|
|
18
|
+
return telegram_api_1.TelegramAPI.post('verifyUser', body, config);
|
|
19
|
+
}
|