@aracna/telegram-bot 1.9.13 → 1.9.14
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/builders/button.builder.d.ts +2 -2
- package/childs/add.d.ts +3 -3
- package/childs/answer.d.ts +3 -2
- package/childs/answer.js +3 -0
- package/childs/approve.d.ts +6 -0
- package/childs/approve.js +10 -0
- package/childs/ban.d.ts +4 -3
- package/childs/ban.js +5 -2
- package/childs/close.d.ts +7 -0
- package/childs/close.js +13 -0
- package/childs/copy.d.ts +7 -0
- package/childs/copy.js +13 -0
- package/childs/create.d.ts +7 -3
- package/childs/create.js +13 -4
- package/childs/decline.d.ts +6 -0
- package/childs/decline.js +10 -0
- package/childs/delete.d.ts +10 -5
- package/childs/delete.js +20 -8
- package/childs/download.d.ts +2 -2
- package/childs/edit.d.ts +9 -5
- package/childs/edit.js +19 -3
- package/childs/export.d.ts +3 -2
- package/childs/export.js +2 -2
- package/childs/forward.d.ts +4 -3
- package/childs/forward.js +5 -7
- package/childs/get.d.ts +22 -11
- package/childs/get.js +52 -16
- package/childs/hide.d.ts +6 -0
- package/childs/hide.js +10 -0
- package/childs/leave.d.ts +3 -2
- package/childs/leave.js +2 -2
- package/childs/log.d.ts +5 -0
- package/childs/log.js +10 -0
- package/childs/pin.d.ts +3 -3
- package/childs/pin.js +2 -2
- package/childs/polling.d.ts +1 -1
- package/childs/polling.js +1 -1
- package/childs/privates/send.private.d.ts +5 -4
- package/childs/privates/send.private.js +2 -2
- package/childs/promote.d.ts +3 -3
- package/childs/promote.js +2 -2
- package/childs/refund.d.ts +6 -0
- package/childs/refund.js +14 -0
- package/childs/reopen.d.ts +7 -0
- package/childs/reopen.js +13 -0
- package/childs/replace.d.ts +6 -0
- package/childs/replace.js +10 -0
- package/childs/restrict.d.ts +3 -3
- package/childs/restrict.js +1 -3
- package/childs/revoke.d.ts +6 -0
- package/childs/revoke.js +10 -0
- package/childs/send.d.ts +26 -25
- package/childs/send.js +22 -41
- package/childs/set.d.ts +24 -13
- package/childs/set.js +60 -22
- package/childs/stop.d.ts +3 -3
- package/childs/stop.js +2 -2
- package/childs/unban.d.ts +4 -2
- package/childs/unban.js +5 -2
- package/childs/unhide.d.ts +6 -0
- package/childs/unhide.js +10 -0
- package/childs/unpin.d.ts +6 -2
- package/childs/unpin.js +15 -2
- package/childs/upload.d.ts +3 -4
- package/childs/upload.js +2 -2
- package/childs/webhook.d.ts +5 -3
- package/childs/webhook.js +8 -2
- package/definitions/interfaces.d.ts +27 -15
- package/definitions/interfaces.js +0 -1
- package/definitions/types.d.ts +2 -2
- package/index.d.ts +367 -161
- package/modules/api.d.ts +1 -1
- package/modules/configuration.d.ts +1 -1
- package/modules/dummy.d.ts +1 -1
- package/modules/telegram.d.ts +27 -5
- package/modules/telegram.js +37 -4
- package/package.json +3 -3
- package/utils/callback.query.utils.d.ts +2 -2
- package/utils/command.utils.d.ts +2 -2
- package/utils/context.utils.d.ts +5 -5
- package/utils/context.utils.js +5 -5
- package/utils/inline.keyboard.utils.d.ts +1 -1
- package/utils/reply.to.message.utils.d.ts +3 -3
- package/utils/start.utils.d.ts +4 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { InlineKeyboardButton, LoginUrl } from '@aracna/telegram-bot-types';
|
|
1
|
+
import type { InlineKeyboardButton, LoginUrl } from '@aracna/telegram-bot-types';
|
|
2
2
|
export declare class ButtonBuilder {
|
|
3
|
-
callback<T>(text: string, data: T, type: string, chatID?:
|
|
3
|
+
callback<T>(text: string, data: T, type: string, chatID?: bigint): InlineKeyboardButton;
|
|
4
4
|
game(text: string, game: string): InlineKeyboardButton;
|
|
5
5
|
login(text: string, url: string, fields?: Partial<LoginUrl>): InlineKeyboardButton;
|
|
6
6
|
pay(text: string): InlineKeyboardButton;
|
package/childs/add.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FetchError } from '@aracna/core';
|
|
2
|
-
import { AddStickerToSet, InputSticker, Message } from '@aracna/telegram-bot-types';
|
|
1
|
+
import type { FetchError } from '@aracna/core';
|
|
2
|
+
import type { AddStickerToSet, InputSticker, Message } from '@aracna/telegram-bot-types';
|
|
3
3
|
import { Child } from '../modules/child';
|
|
4
4
|
export declare class Add extends Child {
|
|
5
|
-
stickerToSet(userID:
|
|
5
|
+
stickerToSet(userID: bigint, name: string, sticker: InputSticker, parameters?: Partial<AddStickerToSet>): Promise<Message | FetchError>;
|
|
6
6
|
}
|
package/childs/answer.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { FetchError } from '@aracna/core';
|
|
2
|
-
import { AnswerCallbackQuery, AnswerInlineQuery, AnswerPreCheckoutQuery, AnswerShippingQuery, InlineQueryResult } from '@aracna/telegram-bot-types';
|
|
1
|
+
import type { FetchError } from '@aracna/core';
|
|
2
|
+
import type { AnswerCallbackQuery, AnswerInlineQuery, AnswerPreCheckoutQuery, AnswerShippingQuery, AnswerWebAppQuery, InlineQueryResult, SentWebAppMessage } from '@aracna/telegram-bot-types';
|
|
3
3
|
import { Child } from '../modules/child';
|
|
4
4
|
export declare class Answer extends Child {
|
|
5
5
|
callbackQuery(id: string, parameters?: Partial<AnswerCallbackQuery>): Promise<boolean | FetchError>;
|
|
6
6
|
inlineQuery(id: string, results: InlineQueryResult[], parameters?: Partial<AnswerInlineQuery>): Promise<boolean | FetchError>;
|
|
7
7
|
preCheckoutQuery(id: string, ok: boolean, parameters?: Partial<AnswerPreCheckoutQuery>): Promise<boolean | FetchError>;
|
|
8
8
|
shippingQuery(id: string, ok: boolean, parameters?: Partial<AnswerShippingQuery>): Promise<boolean | FetchError>;
|
|
9
|
+
webAppQuery(id: string, result: InlineQueryResult, parameters?: Partial<AnswerWebAppQuery>): Promise<SentWebAppMessage | FetchError>;
|
|
9
10
|
}
|
package/childs/answer.js
CHANGED
|
@@ -15,5 +15,8 @@ class Answer extends child_1.Child {
|
|
|
15
15
|
async shippingQuery(id, ok, parameters) {
|
|
16
16
|
return this.telegram.api.post('answerShippingQuery', { ok: ok, shipping_query_id: id, ...parameters });
|
|
17
17
|
}
|
|
18
|
+
async webAppQuery(id, result, parameters) {
|
|
19
|
+
return this.telegram.api.post('answerWebAppQuery', { result: result, web_app_query_id: id, ...parameters });
|
|
20
|
+
}
|
|
18
21
|
}
|
|
19
22
|
exports.Answer = Answer;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { FetchError } from '@aracna/core';
|
|
2
|
+
import type { ApproveChatJoinRequest } from '@aracna/telegram-bot-types';
|
|
3
|
+
import { Child } from '../modules/child';
|
|
4
|
+
export declare class Approve extends Child {
|
|
5
|
+
chatJoinRequest(parameters: ApproveChatJoinRequest): Promise<boolean | FetchError>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Approve = void 0;
|
|
4
|
+
const child_1 = require("../modules/child");
|
|
5
|
+
class Approve extends child_1.Child {
|
|
6
|
+
async chatJoinRequest(parameters) {
|
|
7
|
+
return this.telegram.api.post('approveChatJoinRequest', parameters);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.Approve = Approve;
|
package/childs/ban.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { FetchError } from '@aracna/core';
|
|
2
|
-
import { BanChatMember } from '@aracna/telegram-bot-types';
|
|
1
|
+
import type { FetchError } from '@aracna/core';
|
|
2
|
+
import type { BanChatMember, BanChatSenderChat } from '@aracna/telegram-bot-types';
|
|
3
3
|
import { Child } from '../modules/child';
|
|
4
4
|
export declare class Ban extends Child {
|
|
5
|
-
chatMember(
|
|
5
|
+
chatMember(parameters: BanChatMember): Promise<boolean | FetchError>;
|
|
6
|
+
chatSenderChat(parameters: BanChatSenderChat): Promise<boolean | FetchError>;
|
|
6
7
|
}
|
package/childs/ban.js
CHANGED
|
@@ -3,8 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Ban = void 0;
|
|
4
4
|
const child_1 = require("../modules/child");
|
|
5
5
|
class Ban extends child_1.Child {
|
|
6
|
-
async chatMember(
|
|
7
|
-
return this.telegram.api.post('banChatMember',
|
|
6
|
+
async chatMember(parameters) {
|
|
7
|
+
return this.telegram.api.post('banChatMember', parameters);
|
|
8
|
+
}
|
|
9
|
+
async chatSenderChat(parameters) {
|
|
10
|
+
return this.telegram.api.post('banChatSenderChat', parameters);
|
|
8
11
|
}
|
|
9
12
|
}
|
|
10
13
|
exports.Ban = Ban;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { FetchError } from '@aracna/core';
|
|
2
|
+
import type { CloseForumTopic, CloseGeneralForumTopic } from '@aracna/telegram-bot-types';
|
|
3
|
+
import { Child } from '../modules/child';
|
|
4
|
+
export declare class Close extends Child {
|
|
5
|
+
forumTopic(chatID: bigint, messageThreadID: number, parameters?: Partial<CloseForumTopic>): Promise<boolean | FetchError>;
|
|
6
|
+
generalForumTopic(chatID: bigint, parameters?: Partial<CloseGeneralForumTopic>): Promise<boolean | FetchError>;
|
|
7
|
+
}
|
package/childs/close.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Close = void 0;
|
|
4
|
+
const child_1 = require("../modules/child");
|
|
5
|
+
class Close extends child_1.Child {
|
|
6
|
+
async forumTopic(chatID, messageThreadID, parameters) {
|
|
7
|
+
return this.telegram.api.post('closeForumTopic', { chat_id: chatID, message_thread_id: messageThreadID, ...parameters });
|
|
8
|
+
}
|
|
9
|
+
async generalForumTopic(chatID, parameters) {
|
|
10
|
+
return this.telegram.api.post('closeGeneralForumTopic', { chat_id: chatID, ...parameters });
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.Close = Close;
|
package/childs/copy.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { FetchError } from '@aracna/core';
|
|
2
|
+
import type { CopyMessage, CopyMessages, MessageId } from '@aracna/telegram-bot-types';
|
|
3
|
+
import { Child } from '../modules/child';
|
|
4
|
+
export declare class Copy extends Child {
|
|
5
|
+
message(messageID: number, parameters: Omit<CopyMessage, 'message_id'>): Promise<MessageId | FetchError>;
|
|
6
|
+
messages(messageIDs: number[], parameters: Omit<CopyMessages, 'message_ids'>): Promise<MessageId[] | FetchError>;
|
|
7
|
+
}
|
package/childs/copy.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Copy = void 0;
|
|
4
|
+
const child_1 = require("../modules/child");
|
|
5
|
+
class Copy extends child_1.Child {
|
|
6
|
+
async message(messageID, parameters) {
|
|
7
|
+
return this.telegram.api.post('copyMessage', { message_id: messageID, ...parameters });
|
|
8
|
+
}
|
|
9
|
+
async messages(messageIDs, parameters) {
|
|
10
|
+
return this.telegram.api.post('copyMessages', { message_ids: messageIDs, ...parameters });
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.Copy = Copy;
|
package/childs/create.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import { FetchError } from '@aracna/core';
|
|
2
|
-
import { CreateNewStickerSet, InputSticker } from '@aracna/telegram-bot-types';
|
|
1
|
+
import type { FetchError } from '@aracna/core';
|
|
2
|
+
import type { ChatInviteLink, CreateChatInviteLink, CreateChatSubscriptionInviteLink, CreateForumTopic, CreateInvoiceLink, CreateNewStickerSet, InputSticker, LabeledPrice } from '@aracna/telegram-bot-types';
|
|
3
3
|
import { Child } from '../modules/child';
|
|
4
4
|
export declare class Create extends Child {
|
|
5
|
-
|
|
5
|
+
chatInviteLink(chatID: bigint, parameters?: Partial<CreateChatInviteLink>): Promise<ChatInviteLink | FetchError>;
|
|
6
|
+
chatSubscriptionInviteLink(chatID: bigint, parameters: Omit<CreateChatSubscriptionInviteLink, 'chat_id'>): Promise<ChatInviteLink | FetchError>;
|
|
7
|
+
forumTopic(chatID: bigint, name: string, parameters?: Partial<CreateForumTopic>): Promise<boolean | FetchError<undefined>>;
|
|
8
|
+
invoiceLink(prices: LabeledPrice[], parameters: Omit<CreateInvoiceLink, 'prices'>): Promise<string | FetchError>;
|
|
9
|
+
stickerSet(userID: bigint, stickers: InputSticker[], parameters: Omit<CreateNewStickerSet, 'stickers' | 'user_id'>): Promise<boolean | FetchError>;
|
|
6
10
|
}
|
package/childs/create.js
CHANGED
|
@@ -3,12 +3,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Create = void 0;
|
|
4
4
|
const child_1 = require("../modules/child");
|
|
5
5
|
class Create extends child_1.Child {
|
|
6
|
-
async
|
|
6
|
+
async chatInviteLink(chatID, parameters) {
|
|
7
|
+
return this.telegram.api.post('createChatInviteLink', { chat_id: chatID, ...parameters });
|
|
8
|
+
}
|
|
9
|
+
async chatSubscriptionInviteLink(chatID, parameters) {
|
|
10
|
+
return this.telegram.api.post('createChatSubscriptionInviteLink', { chat_id: chatID, ...parameters });
|
|
11
|
+
}
|
|
12
|
+
async forumTopic(chatID, name, parameters) {
|
|
13
|
+
return this.telegram.api.post('createForumTopic', { chat_id: chatID, name: name, ...parameters });
|
|
14
|
+
}
|
|
15
|
+
async invoiceLink(prices, parameters) {
|
|
16
|
+
return this.telegram.api.post('createInvoiceLink', { prices: prices, ...parameters });
|
|
17
|
+
}
|
|
18
|
+
async stickerSet(userID, stickers, parameters) {
|
|
7
19
|
return this.telegram.api.post('createNewStickerSet', {
|
|
8
|
-
name: name,
|
|
9
|
-
sticker_type: type,
|
|
10
20
|
stickers: stickers,
|
|
11
|
-
title: title,
|
|
12
21
|
user_id: userID,
|
|
13
22
|
...parameters
|
|
14
23
|
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { FetchError } from '@aracna/core';
|
|
2
|
+
import type { DeclineChatJoinRequest } from '@aracna/telegram-bot-types';
|
|
3
|
+
import { Child } from '../modules/child';
|
|
4
|
+
export declare class Decline extends Child {
|
|
5
|
+
chatJoinRequest(parameters: DeclineChatJoinRequest): Promise<boolean | FetchError>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Decline = void 0;
|
|
4
|
+
const child_1 = require("../modules/child");
|
|
5
|
+
class Decline extends child_1.Child {
|
|
6
|
+
async chatJoinRequest(parameters) {
|
|
7
|
+
return this.telegram.api.post('declineChatJoinRequest', parameters);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.Decline = Decline;
|
package/childs/delete.d.ts
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
import { FetchError } from '@aracna/core';
|
|
1
|
+
import type { FetchError } from '@aracna/core';
|
|
2
|
+
import type { DeleteChatPhoto, DeleteChatStickerSet, DeleteForumTopic, DeleteMessage, DeleteMessages, DeleteMyCommands, DeleteStickerFromSet, DeleteStickerSet } from '@aracna/telegram-bot-types';
|
|
2
3
|
import { Child } from '../modules/child';
|
|
3
4
|
export declare class Delete extends Child {
|
|
4
|
-
chatPhoto(chatID:
|
|
5
|
-
chatStickerSet(chatID:
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
chatPhoto(chatID: bigint, parameters?: Partial<DeleteChatPhoto>): Promise<boolean | FetchError>;
|
|
6
|
+
chatStickerSet(chatID: bigint, parameters?: Partial<DeleteChatStickerSet>): Promise<boolean | FetchError>;
|
|
7
|
+
commands(parameters?: Partial<DeleteMyCommands>): Promise<boolean | FetchError>;
|
|
8
|
+
forumTopic(chatID: bigint, messageThreadID: number, parameters?: Partial<DeleteForumTopic>): Promise<boolean | FetchError>;
|
|
9
|
+
message(chatID: bigint, messageID: number, parameters?: Partial<DeleteMessage>): Promise<boolean | FetchError>;
|
|
10
|
+
messages(chatID: bigint, messageIDs: number[], parameters?: Partial<DeleteMessages>): Promise<boolean | FetchError>;
|
|
11
|
+
stickerFromSet(sticker: string, parameters?: Partial<DeleteStickerFromSet>): Promise<boolean | FetchError>;
|
|
12
|
+
stickerSet(name: string, parameters?: Partial<DeleteStickerSet>): Promise<boolean | FetchError>;
|
|
8
13
|
}
|
package/childs/delete.js
CHANGED
|
@@ -3,17 +3,29 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Delete = void 0;
|
|
4
4
|
const child_1 = require("../modules/child");
|
|
5
5
|
class Delete extends child_1.Child {
|
|
6
|
-
async chatPhoto(chatID) {
|
|
7
|
-
return this.telegram.api.post('deleteChatPhoto', { chat_id: chatID });
|
|
6
|
+
async chatPhoto(chatID, parameters) {
|
|
7
|
+
return this.telegram.api.post('deleteChatPhoto', { chat_id: chatID, ...parameters });
|
|
8
8
|
}
|
|
9
|
-
async chatStickerSet(chatID) {
|
|
10
|
-
return this.telegram.api.post('deleteChatStickerSet', { chat_id: chatID });
|
|
9
|
+
async chatStickerSet(chatID, parameters) {
|
|
10
|
+
return this.telegram.api.post('deleteChatStickerSet', { chat_id: chatID, ...parameters });
|
|
11
11
|
}
|
|
12
|
-
async
|
|
13
|
-
return this.telegram.api.post('
|
|
12
|
+
async commands(parameters) {
|
|
13
|
+
return this.telegram.api.post('deleteMyCommands', parameters);
|
|
14
14
|
}
|
|
15
|
-
async
|
|
16
|
-
return this.telegram.api.post('
|
|
15
|
+
async forumTopic(chatID, messageThreadID, parameters) {
|
|
16
|
+
return this.telegram.api.post('deleteForumTopic', { chat_id: chatID, message_thread_id: messageThreadID, ...parameters });
|
|
17
|
+
}
|
|
18
|
+
async message(chatID, messageID, parameters) {
|
|
19
|
+
return this.telegram.api.post('deleteMessage', { chat_id: chatID, message_id: messageID, ...parameters });
|
|
20
|
+
}
|
|
21
|
+
async messages(chatID, messageIDs, parameters) {
|
|
22
|
+
return this.telegram.api.post('deleteMessages', { chat_id: chatID, message_ids: messageIDs, ...parameters });
|
|
23
|
+
}
|
|
24
|
+
async stickerFromSet(sticker, parameters) {
|
|
25
|
+
return this.telegram.api.post('deleteStickerFromSet', { sticker: sticker, ...parameters });
|
|
26
|
+
}
|
|
27
|
+
async stickerSet(name, parameters) {
|
|
28
|
+
return this.telegram.api.post('deleteChatStickerSet', { name: name, ...parameters });
|
|
17
29
|
}
|
|
18
30
|
}
|
|
19
31
|
exports.Delete = Delete;
|
package/childs/download.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { FetchError } from '@aracna/core';
|
|
1
|
+
import type { FetchError } from '@aracna/core';
|
|
2
2
|
import { API } from '../modules/api';
|
|
3
3
|
import { Child } from '../modules/child';
|
|
4
4
|
export declare class Download extends Child {
|
|
5
5
|
api: API;
|
|
6
6
|
file(id: string): Promise<Buffer | FetchError>;
|
|
7
|
-
userFirstProfilePhoto(id:
|
|
7
|
+
userFirstProfilePhoto(id: bigint): Promise<Buffer | FetchError | Error>;
|
|
8
8
|
}
|
package/childs/edit.d.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import { FetchError } from '@aracna/core';
|
|
2
|
-
import { EditMessageCaption, EditMessageLiveLocation, EditMessageMedia, EditMessageReplyMarkup, EditMessageText, InputMedia, Message } from '@aracna/telegram-bot-types';
|
|
1
|
+
import type { FetchError } from '@aracna/core';
|
|
2
|
+
import type { ChatInviteLink, EditChatInviteLink, EditChatSubscriptionInviteLink, EditForumTopic, EditGeneralForumTopic, EditMessageCaption, EditMessageLiveLocation, EditMessageMedia, EditMessageReplyMarkup, EditMessageText, InputMedia, Message } from '@aracna/telegram-bot-types';
|
|
3
3
|
import { Child } from '../modules/child';
|
|
4
4
|
export declare class Edit extends Child {
|
|
5
|
+
chatInviteLink(chatID: bigint, inviteLink: string, parameters?: Partial<EditChatInviteLink>): Promise<ChatInviteLink | FetchError>;
|
|
6
|
+
chatSubscriptionInviteLInk(chatID: bigint, inviteLink: string, parameters?: Partial<EditChatSubscriptionInviteLink>): Promise<ChatInviteLink | FetchError>;
|
|
7
|
+
forumTopic(chatID: bigint, messageThreadID: number, parameters?: Partial<EditForumTopic>): Promise<boolean | FetchError>;
|
|
8
|
+
generalForumTopic(chatID: bigint, name: string, parameters?: Partial<EditGeneralForumTopic>): Promise<boolean | FetchError>;
|
|
5
9
|
messageCaption(parameters: EditMessageCaption): Promise<Message | FetchError>;
|
|
6
|
-
messageLiveLocation(
|
|
7
|
-
messageMedia(media: InputMedia, parameters
|
|
10
|
+
messageLiveLocation(parameters: EditMessageLiveLocation): Promise<Message | FetchError>;
|
|
11
|
+
messageMedia(media: InputMedia, parameters?: Partial<EditMessageMedia>): Promise<Message | FetchError>;
|
|
8
12
|
messageReplyMarkup(parameters: EditMessageReplyMarkup): Promise<Message | FetchError>;
|
|
9
|
-
messageText(text: string, parameters
|
|
13
|
+
messageText(text: string, parameters?: Partial<EditMessageText>): Promise<Message | FetchError>;
|
|
10
14
|
}
|
package/childs/edit.js
CHANGED
|
@@ -3,14 +3,30 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Edit = void 0;
|
|
4
4
|
const child_1 = require("../modules/child");
|
|
5
5
|
class Edit extends child_1.Child {
|
|
6
|
+
async chatInviteLink(chatID, inviteLink, parameters) {
|
|
7
|
+
return this.telegram.api.post('editChatInviteLink', { chat_id: chatID, invite_link: inviteLink, ...parameters });
|
|
8
|
+
}
|
|
9
|
+
async chatSubscriptionInviteLInk(chatID, inviteLink, parameters) {
|
|
10
|
+
return this.telegram.api.post('editChatSubscriptionInviteLink', {
|
|
11
|
+
chat_id: chatID,
|
|
12
|
+
invite_link: inviteLink,
|
|
13
|
+
...parameters
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
async forumTopic(chatID, messageThreadID, parameters) {
|
|
17
|
+
return this.telegram.api.post('editForumTopic', { chat_id: chatID, message_thread_id: messageThreadID, ...parameters });
|
|
18
|
+
}
|
|
19
|
+
async generalForumTopic(chatID, name, parameters) {
|
|
20
|
+
return this.telegram.api.post('editGeneralForumTopic', { chat_id: chatID, name: name, ...parameters });
|
|
21
|
+
}
|
|
6
22
|
async messageCaption(parameters) {
|
|
7
23
|
return this.telegram.api.post('editMessageCaption', parameters);
|
|
8
24
|
}
|
|
9
|
-
async messageLiveLocation(
|
|
10
|
-
return this.telegram.api.post('editMessageLiveLocation',
|
|
25
|
+
async messageLiveLocation(parameters) {
|
|
26
|
+
return this.telegram.api.post('editMessageLiveLocation', parameters);
|
|
11
27
|
}
|
|
12
28
|
async messageMedia(media, parameters) {
|
|
13
|
-
return this.telegram.api.post('
|
|
29
|
+
return this.telegram.api.post('editMessageMedia', { media: media, ...parameters });
|
|
14
30
|
}
|
|
15
31
|
async messageReplyMarkup(parameters) {
|
|
16
32
|
return this.telegram.api.post('editMessageReplyMarkup', parameters);
|
package/childs/export.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { FetchError } from '@aracna/core';
|
|
1
|
+
import type { FetchError } from '@aracna/core';
|
|
2
|
+
import type { ExportChatInviteLink } from '@aracna/telegram-bot-types';
|
|
2
3
|
import { Child } from '../modules/child';
|
|
3
4
|
export declare class Export extends Child {
|
|
4
|
-
chatInviteLink(chatID:
|
|
5
|
+
chatInviteLink(chatID: bigint, parameters?: Partial<ExportChatInviteLink>): Promise<string | FetchError>;
|
|
5
6
|
}
|
package/childs/export.js
CHANGED
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Export = void 0;
|
|
4
4
|
const child_1 = require("../modules/child");
|
|
5
5
|
class Export extends child_1.Child {
|
|
6
|
-
async chatInviteLink(chatID) {
|
|
7
|
-
return this.telegram.api.post('exportChatInviteLink', { chat_id: chatID });
|
|
6
|
+
async chatInviteLink(chatID, parameters) {
|
|
7
|
+
return this.telegram.api.post('exportChatInviteLink', { chat_id: chatID, ...parameters });
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
exports.Export = Export;
|
package/childs/forward.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { FetchError } from '@aracna/core';
|
|
2
|
-
import { ForwardMessage, Message } from '@aracna/telegram-bot-types';
|
|
1
|
+
import type { FetchError } from '@aracna/core';
|
|
2
|
+
import type { ForwardMessage, ForwardMessages, Message, MessageId } from '@aracna/telegram-bot-types';
|
|
3
3
|
import { Child } from '../modules/child';
|
|
4
4
|
export declare class Forward extends Child {
|
|
5
|
-
message(
|
|
5
|
+
message(messageID: number, parameters: Omit<ForwardMessage, 'message_id'>): Promise<Message | FetchError>;
|
|
6
|
+
messages(messageIDs: number[], parameters: Omit<ForwardMessages, 'message_ids'>): Promise<MessageId[] | FetchError>;
|
|
6
7
|
}
|
package/childs/forward.js
CHANGED
|
@@ -3,13 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Forward = void 0;
|
|
4
4
|
const child_1 = require("../modules/child");
|
|
5
5
|
class Forward extends child_1.Child {
|
|
6
|
-
async message(
|
|
7
|
-
return this.telegram.api.post('forwardMessage', {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
...parameters
|
|
12
|
-
});
|
|
6
|
+
async message(messageID, parameters) {
|
|
7
|
+
return this.telegram.api.post('forwardMessage', { message_id: messageID, ...parameters });
|
|
8
|
+
}
|
|
9
|
+
async messages(messageIDs, parameters) {
|
|
10
|
+
return this.telegram.api.post('forwardMessages', { message_ids: messageIDs, ...parameters });
|
|
13
11
|
}
|
|
14
12
|
}
|
|
15
13
|
exports.Forward = Forward;
|
package/childs/get.d.ts
CHANGED
|
@@ -1,15 +1,26 @@
|
|
|
1
|
-
import { FetchError } from '@aracna/core';
|
|
2
|
-
import { BotCommand, Chat, ChatMember, File, GameHighScore, GetGameHighScores, GetUserProfilePhotos, StickerSet, User, UserProfilePhotos } from '@aracna/telegram-bot-types';
|
|
1
|
+
import type { FetchError } from '@aracna/core';
|
|
2
|
+
import type { BotCommand, BotDescription, BotName, BotShortDescription, BusinessConnection, Chat, ChatAdministratorRights, ChatMember, File, GameHighScore, GetBusinessConnection, 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 { Child } from '../modules/child';
|
|
4
4
|
export declare class Get extends Child {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
businessConnection(businessConnectionID: string, parameters?: Partial<GetBusinessConnection>): Promise<BusinessConnection | FetchError>;
|
|
6
|
+
chat(chatID: bigint, parameters?: Partial<GetChat>): Promise<Chat | FetchError>;
|
|
7
|
+
chatAdministrators(chatID: bigint, parameters?: Partial<GetChatAdministrators>): Promise<ChatMember[] | FetchError>;
|
|
8
|
+
chatMember(parameters: GetChatMember): Promise<ChatMember | FetchError>;
|
|
9
|
+
chatMemberCount(chatID: bigint, parameters?: Partial<GetChatMemberCount>): Promise<bigint | FetchError>;
|
|
10
|
+
chatMenuButton(chatID: bigint, parameters?: Partial<GetChatMenuButton>): Promise<MenuButton | FetchError>;
|
|
11
|
+
commands(parameters?: Partial<GetMyCommands>): Promise<BotCommand[] | FetchError>;
|
|
12
|
+
customEmojiStickers(customEmojiIDs: string[], parameters?: Partial<GetCustomEmojiStickers>): Promise<Sticker[] | FetchError>;
|
|
13
|
+
defaultAdministratorRights(parameters?: Partial<GetMyDefaultAdministratorRights>): Promise<ChatAdministratorRights | FetchError>;
|
|
14
|
+
description(parameters?: Partial<GetMyDescription>): Promise<BotDescription | FetchError>;
|
|
15
|
+
file(fileID: string, parameters?: Partial<GetFile>): Promise<File | FetchError>;
|
|
16
|
+
forumTopicIconStickers(): Promise<Sticker[] | FetchError>;
|
|
17
|
+
gameHighScores(userID: bigint, parameters?: Partial<GetGameHighScores>): Promise<GameHighScore | FetchError>;
|
|
12
18
|
me(): Promise<User | FetchError>;
|
|
13
|
-
|
|
14
|
-
|
|
19
|
+
name(parameters?: Partial<GetMyName>): Promise<BotName | FetchError>;
|
|
20
|
+
shortDescription(parameters?: Partial<GetMyShortDescription>): Promise<BotShortDescription | FetchError>;
|
|
21
|
+
starTransactions(parameters?: Partial<GetStarTransactions>): Promise<StarTransactions | FetchError>;
|
|
22
|
+
stickerSet(name: string, parameters?: Partial<GetStickerSet>): Promise<StickerSet | FetchError>;
|
|
23
|
+
updates(parameters?: Partial<GetUpdates>): Promise<Update[] | FetchError>;
|
|
24
|
+
userChatBoosts(parameters: GetUserChatBoosts): Promise<UserChatBoosts | FetchError>;
|
|
25
|
+
userProfilePhotos(userID: bigint, parameters?: Partial<GetUserProfilePhotos>): Promise<UserProfilePhotos | FetchError>;
|
|
15
26
|
}
|
package/childs/get.js
CHANGED
|
@@ -3,23 +3,44 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Get = void 0;
|
|
4
4
|
const child_1 = require("../modules/child");
|
|
5
5
|
class Get extends child_1.Child {
|
|
6
|
-
async
|
|
7
|
-
return this.telegram.api.post('
|
|
6
|
+
async businessConnection(businessConnectionID, parameters) {
|
|
7
|
+
return this.telegram.api.post('getBusinessConnection', {
|
|
8
|
+
business_connection_id: businessConnectionID,
|
|
9
|
+
...parameters
|
|
10
|
+
});
|
|
8
11
|
}
|
|
9
|
-
async
|
|
10
|
-
return this.telegram.api.post('
|
|
12
|
+
async chat(chatID, parameters) {
|
|
13
|
+
return this.telegram.api.post('getChat', { chat_id: chatID, ...parameters });
|
|
11
14
|
}
|
|
12
|
-
async
|
|
13
|
-
return this.telegram.api.post('
|
|
15
|
+
async chatAdministrators(chatID, parameters) {
|
|
16
|
+
return this.telegram.api.post('getChatAdministrators', { chat_id: chatID, ...parameters });
|
|
14
17
|
}
|
|
15
|
-
async
|
|
16
|
-
return this.telegram.api.post('
|
|
18
|
+
async chatMember(parameters) {
|
|
19
|
+
return this.telegram.api.post('getChatMember', parameters);
|
|
17
20
|
}
|
|
18
|
-
async
|
|
19
|
-
return this.telegram.api.post('
|
|
21
|
+
async chatMemberCount(chatID, parameters) {
|
|
22
|
+
return this.telegram.api.post('getChatMemberCount', { chat_id: chatID, ...parameters });
|
|
20
23
|
}
|
|
21
|
-
async
|
|
22
|
-
return this.telegram.api.post('
|
|
24
|
+
async chatMenuButton(chatID, parameters) {
|
|
25
|
+
return this.telegram.api.post('getChatMenuButton', { chat_id: chatID, ...parameters });
|
|
26
|
+
}
|
|
27
|
+
async commands(parameters) {
|
|
28
|
+
return this.telegram.api.post('getMyCommands', parameters);
|
|
29
|
+
}
|
|
30
|
+
async customEmojiStickers(customEmojiIDs, parameters) {
|
|
31
|
+
return this.telegram.api.post('getCustomEmojiStickers', { custom_emoji_ids: customEmojiIDs, ...parameters });
|
|
32
|
+
}
|
|
33
|
+
async defaultAdministratorRights(parameters) {
|
|
34
|
+
return this.telegram.api.post('getMyDefaultAdministratorRights', parameters);
|
|
35
|
+
}
|
|
36
|
+
async description(parameters) {
|
|
37
|
+
return this.telegram.api.post('getMyDescription', parameters);
|
|
38
|
+
}
|
|
39
|
+
async file(fileID, parameters) {
|
|
40
|
+
return this.telegram.api.post('getFile', { file_id: fileID, ...parameters });
|
|
41
|
+
}
|
|
42
|
+
async forumTopicIconStickers() {
|
|
43
|
+
return this.telegram.api.post('getForumTopicIconStickers');
|
|
23
44
|
}
|
|
24
45
|
async gameHighScores(userID, parameters) {
|
|
25
46
|
return this.telegram.api.post('getGameHighScores', { user_id: userID, ...parameters });
|
|
@@ -27,11 +48,26 @@ class Get extends child_1.Child {
|
|
|
27
48
|
async me() {
|
|
28
49
|
return this.telegram.api.post('getMe');
|
|
29
50
|
}
|
|
30
|
-
async
|
|
31
|
-
return this.telegram.api.post('
|
|
51
|
+
async name(parameters) {
|
|
52
|
+
return this.telegram.api.post('getMyName', parameters);
|
|
53
|
+
}
|
|
54
|
+
async shortDescription(parameters) {
|
|
55
|
+
return this.telegram.api.post('getMyShortDescription', parameters);
|
|
56
|
+
}
|
|
57
|
+
async starTransactions(parameters) {
|
|
58
|
+
return this.telegram.api.post('getStarTransactions', parameters);
|
|
59
|
+
}
|
|
60
|
+
async stickerSet(name, parameters) {
|
|
61
|
+
return this.telegram.api.post('getStickerSet', { name: name, ...parameters });
|
|
62
|
+
}
|
|
63
|
+
async updates(parameters) {
|
|
64
|
+
return this.telegram.api.post('getUpdates', parameters);
|
|
65
|
+
}
|
|
66
|
+
async userChatBoosts(parameters) {
|
|
67
|
+
return this.telegram.api.post('getUserChatBoosts', parameters);
|
|
32
68
|
}
|
|
33
|
-
async userProfilePhotos(
|
|
34
|
-
return this.telegram.api.post('getUserProfilePhotos', { user_id:
|
|
69
|
+
async userProfilePhotos(userID, parameters) {
|
|
70
|
+
return this.telegram.api.post('getUserProfilePhotos', { user_id: userID, ...parameters });
|
|
35
71
|
}
|
|
36
72
|
}
|
|
37
73
|
exports.Get = Get;
|
package/childs/hide.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { FetchError } from '@aracna/core';
|
|
2
|
+
import type { HideGeneralForumTopic } from '@aracna/telegram-bot-types';
|
|
3
|
+
import { Child } from '../modules/child';
|
|
4
|
+
export declare class Hide extends Child {
|
|
5
|
+
generalForumTopic(chatID: bigint, parameters?: Partial<HideGeneralForumTopic>): Promise<boolean | FetchError>;
|
|
6
|
+
}
|
package/childs/hide.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Hide = void 0;
|
|
4
|
+
const child_1 = require("../modules/child");
|
|
5
|
+
class Hide extends child_1.Child {
|
|
6
|
+
async generalForumTopic(chatID, parameters) {
|
|
7
|
+
return this.telegram.api.post('hideGeneralForumTopic', { chat_id: chatID, ...parameters });
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.Hide = Hide;
|
package/childs/leave.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { FetchError } from '@aracna/core';
|
|
1
|
+
import type { FetchError } from '@aracna/core';
|
|
2
|
+
import type { LeaveChat } from '@aracna/telegram-bot-types';
|
|
2
3
|
import { Child } from '../modules/child';
|
|
3
4
|
export declare class Leave extends Child {
|
|
4
|
-
chat(
|
|
5
|
+
chat(chatID: bigint, parameters?: Partial<LeaveChat>): Promise<boolean | FetchError>;
|
|
5
6
|
}
|
package/childs/leave.js
CHANGED
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Leave = void 0;
|
|
4
4
|
const child_1 = require("../modules/child");
|
|
5
5
|
class Leave extends child_1.Child {
|
|
6
|
-
async chat(
|
|
7
|
-
return this.telegram.api.post('leaveChat', { chat_id:
|
|
6
|
+
async chat(chatID, parameters) {
|
|
7
|
+
return this.telegram.api.post('leaveChat', { chat_id: chatID, ...parameters });
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
exports.Leave = Leave;
|
package/childs/log.d.ts
ADDED
package/childs/log.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Log = void 0;
|
|
4
|
+
const child_1 = require("../modules/child");
|
|
5
|
+
class Log extends child_1.Child {
|
|
6
|
+
async out() {
|
|
7
|
+
return this.telegram.api.post('logOut');
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.Log = Log;
|
package/childs/pin.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FetchError } from '@aracna/core';
|
|
2
|
-
import { PinChatMessage } from '@aracna/telegram-bot-types';
|
|
1
|
+
import type { FetchError } from '@aracna/core';
|
|
2
|
+
import type { PinChatMessage } from '@aracna/telegram-bot-types';
|
|
3
3
|
import { Child } from '../modules/child';
|
|
4
4
|
export declare class Pin extends Child {
|
|
5
|
-
chatMessage(chatID:
|
|
5
|
+
chatMessage(chatID: bigint, messageID: number, parameters?: Partial<PinChatMessage>): Promise<boolean | FetchError>;
|
|
6
6
|
}
|
package/childs/pin.js
CHANGED
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Pin = void 0;
|
|
4
4
|
const child_1 = require("../modules/child");
|
|
5
5
|
class Pin extends child_1.Child {
|
|
6
|
-
async chatMessage(chatID,
|
|
7
|
-
return this.telegram.api.post('pinChatMessage', { chat_id: chatID, message_id:
|
|
6
|
+
async chatMessage(chatID, messageID, parameters) {
|
|
7
|
+
return this.telegram.api.post('pinChatMessage', { chat_id: chatID, message_id: messageID, ...parameters });
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
exports.Pin = Pin;
|
package/childs/polling.d.ts
CHANGED
package/childs/polling.js
CHANGED
|
@@ -20,7 +20,7 @@ class Polling extends child_1.Child {
|
|
|
20
20
|
offset: this.offset,
|
|
21
21
|
...parameters
|
|
22
22
|
};
|
|
23
|
-
updates = await this.telegram.
|
|
23
|
+
updates = await this.telegram.get.updates(parameters);
|
|
24
24
|
if (updates instanceof Error)
|
|
25
25
|
return updates;
|
|
26
26
|
updates.forEach((v) => this.telegram.handle(v));
|