@aracna/telegram-bot 1.9.13 → 2.0.1
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/apis/telegram-api.d.ts +9 -0
- package/apis/telegram-api.js +55 -0
- package/apis/telegram-file-api.d.ts +7 -0
- package/apis/telegram-file-api.js +14 -0
- package/classes/client.d.ts +46 -0
- package/classes/client.js +409 -0
- package/definitions/constants.d.ts +10 -0
- package/definitions/constants.js +53 -1
- package/definitions/enums.d.ts +1 -20
- package/definitions/enums.js +2 -22
- package/definitions/interfaces.d.ts +91 -75
- package/definitions/interfaces.js +0 -1
- package/definitions/telegram-api-definitions.d.ts +12 -0
- package/definitions/telegram-api-definitions.js +2 -0
- package/definitions/types.d.ts +4 -3
- package/index.d.ts +656 -416
- package/index.js +236 -20
- package/loggers/class-logger.d.ts +2 -0
- package/loggers/{module.logger.js → class-logger.js} +2 -2
- package/package.json +13 -4
- package/requests/add-requests.d.ts +3 -0
- package/requests/add-requests.js +14 -0
- package/requests/answer-requests.d.ts +7 -0
- package/requests/answer-requests.js +23 -0
- package/requests/approve-requests.d.ts +3 -0
- package/requests/approve-requests.js +7 -0
- package/requests/ban-requests.d.ts +4 -0
- package/requests/ban-requests.js +11 -0
- package/requests/close-requests.d.ts +4 -0
- package/requests/close-requests.js +11 -0
- package/requests/copy-requests.d.ts +4 -0
- package/requests/copy-requests.js +11 -0
- package/requests/create-requests.d.ts +7 -0
- package/requests/create-requests.js +30 -0
- package/requests/decline-requests.d.ts +3 -0
- package/requests/decline-requests.js +7 -0
- package/requests/delete-requests.d.ts +10 -0
- package/requests/delete-requests.js +35 -0
- package/requests/download-requests.d.ts +3 -0
- package/requests/download-requests.js +29 -0
- package/requests/edit-requests.d.ts +12 -0
- package/requests/edit-requests.js +46 -0
- package/requests/export-requests.d.ts +3 -0
- package/requests/export-requests.js +7 -0
- package/requests/forward-requests.d.ts +4 -0
- package/requests/forward-requests.js +11 -0
- package/requests/get-requests.d.ts +23 -0
- package/requests/get-requests.js +92 -0
- package/requests/hide-requests.d.ts +3 -0
- package/requests/hide-requests.js +7 -0
- package/requests/leave-requests.d.ts +3 -0
- package/requests/leave-requests.js +7 -0
- package/requests/log-requests.d.ts +2 -0
- package/requests/log-requests.js +7 -0
- package/requests/pin-requests.d.ts +3 -0
- package/requests/pin-requests.js +7 -0
- package/requests/promote-requests.d.ts +3 -0
- package/requests/promote-requests.js +7 -0
- package/requests/refund-requests.d.ts +3 -0
- package/requests/refund-requests.js +7 -0
- package/requests/reopen-requests.d.ts +4 -0
- package/requests/reopen-requests.js +11 -0
- package/requests/replace-requests.d.ts +3 -0
- package/requests/replace-requests.js +14 -0
- package/requests/restrict-requests.d.ts +3 -0
- package/requests/restrict-requests.js +7 -0
- package/requests/revoke-requests.d.ts +3 -0
- package/requests/revoke-requests.js +7 -0
- package/requests/send-requests.d.ts +24 -0
- package/requests/send-requests.js +102 -0
- package/requests/set-requests.d.ts +24 -0
- package/requests/set-requests.js +95 -0
- package/requests/stop-requests.d.ts +4 -0
- package/requests/stop-requests.js +11 -0
- package/requests/unban-requests.d.ts +4 -0
- package/requests/unban-requests.js +11 -0
- package/requests/unhide-requests.d.ts +3 -0
- package/requests/unhide-requests.js +7 -0
- package/requests/unpin-requests.d.ts +6 -0
- package/requests/unpin-requests.js +19 -0
- package/requests/upload-requests.d.ts +3 -0
- package/requests/upload-requests.js +7 -0
- package/requests/webhook-requests.d.ts +6 -0
- package/requests/webhook-requests.js +20 -0
- package/utils/callback-query-utils.d.ts +3 -0
- package/utils/callback-query-utils.js +25 -0
- package/utils/command-utils.d.ts +5 -0
- package/utils/command-utils.js +28 -0
- package/utils/context-utils.d.ts +11 -0
- package/utils/context-utils.js +42 -0
- package/utils/html-utils.d.ts +2 -0
- package/utils/html-utils.js +18 -0
- package/utils/inline-keyboard-utils.d.ts +12 -0
- package/utils/inline-keyboard-utils.js +43 -0
- package/utils/reply-to-message-utils.d.ts +6 -0
- package/utils/reply-to-message-utils.js +36 -0
- package/utils/start-message-utils.d.ts +6 -0
- package/utils/start-message-utils.js +40 -0
- package/builders/button.builder.d.ts +0 -11
- package/builders/button.builder.js +0 -31
- package/childs/add.d.ts +0 -6
- package/childs/add.js +0 -10
- package/childs/answer.d.ts +0 -9
- package/childs/answer.js +0 -19
- package/childs/ban.d.ts +0 -6
- package/childs/ban.js +0 -10
- package/childs/create.d.ts +0 -6
- package/childs/create.js +0 -17
- package/childs/delete.d.ts +0 -8
- package/childs/delete.js +0 -19
- package/childs/download.d.ts +0 -8
- package/childs/download.js +0 -32
- package/childs/edit.d.ts +0 -10
- package/childs/edit.js +0 -22
- package/childs/export.d.ts +0 -5
- package/childs/export.js +0 -10
- package/childs/forward.d.ts +0 -6
- package/childs/forward.js +0 -15
- package/childs/get.d.ts +0 -15
- package/childs/get.js +0 -37
- package/childs/leave.d.ts +0 -5
- package/childs/leave.js +0 -10
- package/childs/pin.d.ts +0 -6
- package/childs/pin.js +0 -10
- package/childs/polling.d.ts +0 -9
- package/childs/polling.js +0 -34
- package/childs/privates/send.private.d.ts +0 -7
- package/childs/privates/send.private.js +0 -19
- package/childs/promote.d.ts +0 -6
- package/childs/promote.js +0 -10
- package/childs/restrict.d.ts +0 -6
- package/childs/restrict.js +0 -15
- package/childs/send.d.ts +0 -31
- package/childs/send.js +0 -130
- package/childs/set.d.ts +0 -17
- package/childs/set.js +0 -44
- package/childs/stop.d.ts +0 -7
- package/childs/stop.js +0 -13
- package/childs/unban.d.ts +0 -5
- package/childs/unban.js +0 -10
- package/childs/unpin.d.ts +0 -5
- package/childs/unpin.js +0 -10
- package/childs/upload.d.ts +0 -7
- package/childs/upload.js +0 -10
- package/childs/webhook.d.ts +0 -8
- package/childs/webhook.js +0 -22
- package/loggers/module.logger.d.ts +0 -2
- package/modules/api.d.ts +0 -5
- package/modules/api.js +0 -24
- package/modules/builder.d.ts +0 -4
- package/modules/builder.js +0 -8
- package/modules/child.d.ts +0 -5
- package/modules/child.js +0 -10
- package/modules/configuration.d.ts +0 -8
- package/modules/configuration.js +0 -10
- package/modules/dummy.d.ts +0 -9
- package/modules/dummy.js +0 -56
- package/modules/telegram.d.ts +0 -87
- package/modules/telegram.js +0 -358
- package/utils/callback.query.utils.d.ts +0 -5
- package/utils/callback.query.utils.js +0 -26
- package/utils/command.utils.d.ts +0 -7
- package/utils/command.utils.js +0 -29
- package/utils/context.utils.d.ts +0 -13
- package/utils/context.utils.js +0 -41
- package/utils/html.utils.d.ts +0 -5
- package/utils/html.utils.js +0 -20
- package/utils/inline.keyboard.utils.d.ts +0 -4
- package/utils/inline.keyboard.utils.js +0 -26
- package/utils/reply.to.message.utils.d.ts +0 -6
- package/utils/reply.to.message.utils.js +0 -27
- package/utils/start.utils.d.ts +0 -7
- package/utils/start.utils.js +0 -32
package/childs/create.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { FetchError } from '@aracna/core';
|
|
2
|
-
import { CreateNewStickerSet, InputSticker } from '@aracna/telegram-bot-types';
|
|
3
|
-
import { Child } from '../modules/child';
|
|
4
|
-
export declare class Create extends Child {
|
|
5
|
-
stickerSet(userID: number, type: string, name: string, title: string, stickers: InputSticker[], parameters: Partial<CreateNewStickerSet>): Promise<boolean | FetchError>;
|
|
6
|
-
}
|
package/childs/create.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Create = void 0;
|
|
4
|
-
const child_1 = require("../modules/child");
|
|
5
|
-
class Create extends child_1.Child {
|
|
6
|
-
async stickerSet(userID, type, name, title, stickers, parameters) {
|
|
7
|
-
return this.telegram.api.post('createNewStickerSet', {
|
|
8
|
-
name: name,
|
|
9
|
-
sticker_type: type,
|
|
10
|
-
stickers: stickers,
|
|
11
|
-
title: title,
|
|
12
|
-
user_id: userID,
|
|
13
|
-
...parameters
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
exports.Create = Create;
|
package/childs/delete.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { FetchError } from '@aracna/core';
|
|
2
|
-
import { Child } from '../modules/child';
|
|
3
|
-
export declare class Delete extends Child {
|
|
4
|
-
chatPhoto(chatID: number): Promise<boolean | FetchError>;
|
|
5
|
-
chatStickerSet(chatID: number): Promise<boolean | FetchError>;
|
|
6
|
-
message(chatID: number, message: number): Promise<boolean | FetchError>;
|
|
7
|
-
stickerFromSet(sticker: string): Promise<boolean | FetchError>;
|
|
8
|
-
}
|
package/childs/delete.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Delete = void 0;
|
|
4
|
-
const child_1 = require("../modules/child");
|
|
5
|
-
class Delete extends child_1.Child {
|
|
6
|
-
async chatPhoto(chatID) {
|
|
7
|
-
return this.telegram.api.post('deleteChatPhoto', { chat_id: chatID });
|
|
8
|
-
}
|
|
9
|
-
async chatStickerSet(chatID) {
|
|
10
|
-
return this.telegram.api.post('deleteChatStickerSet', { chat_id: chatID });
|
|
11
|
-
}
|
|
12
|
-
async message(chatID, message) {
|
|
13
|
-
return this.telegram.api.post('deleteMessage', { chat_id: chatID, message_id: message });
|
|
14
|
-
}
|
|
15
|
-
async stickerFromSet(sticker) {
|
|
16
|
-
return this.telegram.api.post('deleteStickerFromSet', { sticker: sticker });
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
exports.Delete = Delete;
|
package/childs/download.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { FetchError } from '@aracna/core';
|
|
2
|
-
import { API } from '../modules/api';
|
|
3
|
-
import { Child } from '../modules/child';
|
|
4
|
-
export declare class Download extends Child {
|
|
5
|
-
api: API;
|
|
6
|
-
file(id: string): Promise<Buffer | FetchError>;
|
|
7
|
-
userFirstProfilePhoto(id: number): Promise<Buffer | FetchError | Error>;
|
|
8
|
-
}
|
package/childs/download.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Download = void 0;
|
|
4
|
-
const api_1 = require("../modules/api");
|
|
5
|
-
const child_1 = require("../modules/child");
|
|
6
|
-
class Download extends child_1.Child {
|
|
7
|
-
api = new api_1.API('https://api.telegram.org/file/bot' + this.telegram.token + '/');
|
|
8
|
-
async file(id) {
|
|
9
|
-
let file, buffer;
|
|
10
|
-
file = await this.telegram.get.file(id);
|
|
11
|
-
if (file instanceof Error)
|
|
12
|
-
return file;
|
|
13
|
-
buffer = await this.api.get(file.file_path ?? '');
|
|
14
|
-
if (buffer instanceof Error)
|
|
15
|
-
return buffer;
|
|
16
|
-
return buffer.data;
|
|
17
|
-
}
|
|
18
|
-
async userFirstProfilePhoto(id) {
|
|
19
|
-
let photos, sizes, buffer;
|
|
20
|
-
photos = await this.telegram.get.userProfilePhotos(id, { limit: 1 });
|
|
21
|
-
if (photos instanceof Error)
|
|
22
|
-
return photos;
|
|
23
|
-
sizes = photos.photos;
|
|
24
|
-
if (sizes.length <= 0)
|
|
25
|
-
return new Error(JSON.stringify(photos));
|
|
26
|
-
buffer = await this.file(sizes[0].reduce((r, v) => (v.height + v.width > r.height + r.width ? v : r), sizes[0][0]).file_id);
|
|
27
|
-
if (buffer instanceof Error)
|
|
28
|
-
return buffer;
|
|
29
|
-
return buffer;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
exports.Download = Download;
|
package/childs/edit.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { FetchError } from '@aracna/core';
|
|
2
|
-
import { EditMessageCaption, EditMessageLiveLocation, EditMessageMedia, EditMessageReplyMarkup, EditMessageText, InputMedia, Message } from '@aracna/telegram-bot-types';
|
|
3
|
-
import { Child } from '../modules/child';
|
|
4
|
-
export declare class Edit extends Child {
|
|
5
|
-
messageCaption(parameters: EditMessageCaption): Promise<Message | FetchError>;
|
|
6
|
-
messageLiveLocation(latitude: number, longitude: number, parameters: Partial<EditMessageLiveLocation>): Promise<Message | FetchError>;
|
|
7
|
-
messageMedia(media: InputMedia, parameters: Partial<EditMessageMedia>): Promise<Message | FetchError>;
|
|
8
|
-
messageReplyMarkup(parameters: EditMessageReplyMarkup): Promise<Message | FetchError>;
|
|
9
|
-
messageText(text: string, parameters: Partial<EditMessageText>): Promise<Message | FetchError>;
|
|
10
|
-
}
|
package/childs/edit.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Edit = void 0;
|
|
4
|
-
const child_1 = require("../modules/child");
|
|
5
|
-
class Edit extends child_1.Child {
|
|
6
|
-
async messageCaption(parameters) {
|
|
7
|
-
return this.telegram.api.post('editMessageCaption', parameters);
|
|
8
|
-
}
|
|
9
|
-
async messageLiveLocation(latitude, longitude, parameters) {
|
|
10
|
-
return this.telegram.api.post('editMessageLiveLocation', { latitude: latitude, longitude: longitude, ...parameters });
|
|
11
|
-
}
|
|
12
|
-
async messageMedia(media, parameters) {
|
|
13
|
-
return this.telegram.api.post('editMessageText', { media: media, ...parameters });
|
|
14
|
-
}
|
|
15
|
-
async messageReplyMarkup(parameters) {
|
|
16
|
-
return this.telegram.api.post('editMessageReplyMarkup', parameters);
|
|
17
|
-
}
|
|
18
|
-
async messageText(text, parameters) {
|
|
19
|
-
return this.telegram.api.post('editMessageText', { text: text, ...parameters });
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
exports.Edit = Edit;
|
package/childs/export.d.ts
DELETED
package/childs/export.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Export = void 0;
|
|
4
|
-
const child_1 = require("../modules/child");
|
|
5
|
-
class Export extends child_1.Child {
|
|
6
|
-
async chatInviteLink(chatID) {
|
|
7
|
-
return this.telegram.api.post('exportChatInviteLink', { chat_id: chatID });
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
exports.Export = Export;
|
package/childs/forward.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { FetchError } from '@aracna/core';
|
|
2
|
-
import { ForwardMessage, Message } from '@aracna/telegram-bot-types';
|
|
3
|
-
import { Child } from '../modules/child';
|
|
4
|
-
export declare class Forward extends Child {
|
|
5
|
-
message(chatID: number, fromChatID: number, messageID: number, parameters?: Partial<ForwardMessage>): Promise<Message | FetchError>;
|
|
6
|
-
}
|
package/childs/forward.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Forward = void 0;
|
|
4
|
-
const child_1 = require("../modules/child");
|
|
5
|
-
class Forward extends child_1.Child {
|
|
6
|
-
async message(chatID, fromChatID, messageID, parameters) {
|
|
7
|
-
return this.telegram.api.post('forwardMessage', {
|
|
8
|
-
chat_id: chatID,
|
|
9
|
-
from_chat_id: fromChatID,
|
|
10
|
-
message_id: messageID,
|
|
11
|
-
...parameters
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
exports.Forward = Forward;
|
package/childs/get.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { FetchError } from '@aracna/core';
|
|
2
|
-
import { BotCommand, Chat, ChatMember, File, GameHighScore, GetGameHighScores, GetUserProfilePhotos, StickerSet, User, UserProfilePhotos } from '@aracna/telegram-bot-types';
|
|
3
|
-
import { Child } from '../modules/child';
|
|
4
|
-
export declare class Get extends Child {
|
|
5
|
-
chat(id: number): Promise<Chat | FetchError>;
|
|
6
|
-
chatAdministrators(id: number): Promise<ChatMember[] | FetchError>;
|
|
7
|
-
chatMember(chatID: number, userID: number): Promise<ChatMember | FetchError>;
|
|
8
|
-
chatMemberCount(id: number): Promise<number | FetchError>;
|
|
9
|
-
commands(): Promise<BotCommand[] | FetchError>;
|
|
10
|
-
file(id: string): Promise<File | FetchError>;
|
|
11
|
-
gameHighScores(userID: number, parameters?: Partial<GetGameHighScores>): Promise<GameHighScore | FetchError>;
|
|
12
|
-
me(): Promise<User | FetchError>;
|
|
13
|
-
stickerSet(name: string): Promise<StickerSet | FetchError>;
|
|
14
|
-
userProfilePhotos(id: number, parameters?: Partial<GetUserProfilePhotos>): Promise<UserProfilePhotos | FetchError>;
|
|
15
|
-
}
|
package/childs/get.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Get = void 0;
|
|
4
|
-
const child_1 = require("../modules/child");
|
|
5
|
-
class Get extends child_1.Child {
|
|
6
|
-
async chat(id) {
|
|
7
|
-
return this.telegram.api.post('getChat', { chat_id: id });
|
|
8
|
-
}
|
|
9
|
-
async chatAdministrators(id) {
|
|
10
|
-
return this.telegram.api.post('getChatAdministrators', { chat_id: id });
|
|
11
|
-
}
|
|
12
|
-
async chatMember(chatID, userID) {
|
|
13
|
-
return this.telegram.api.post('getChatMember', { chat_id: chatID, user_id: userID });
|
|
14
|
-
}
|
|
15
|
-
async chatMemberCount(id) {
|
|
16
|
-
return this.telegram.api.post('getChatMemberCount', { chat_id: id });
|
|
17
|
-
}
|
|
18
|
-
async commands() {
|
|
19
|
-
return this.telegram.api.post('getMyCommands');
|
|
20
|
-
}
|
|
21
|
-
async file(id) {
|
|
22
|
-
return this.telegram.api.post('getFile', { file_id: id });
|
|
23
|
-
}
|
|
24
|
-
async gameHighScores(userID, parameters) {
|
|
25
|
-
return this.telegram.api.post('getGameHighScores', { user_id: userID, ...parameters });
|
|
26
|
-
}
|
|
27
|
-
async me() {
|
|
28
|
-
return this.telegram.api.post('getMe');
|
|
29
|
-
}
|
|
30
|
-
async stickerSet(name) {
|
|
31
|
-
return this.telegram.api.post('getStickerSet', { name: name });
|
|
32
|
-
}
|
|
33
|
-
async userProfilePhotos(id, parameters) {
|
|
34
|
-
return this.telegram.api.post('getUserProfilePhotos', { user_id: id, ...parameters });
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
exports.Get = Get;
|
package/childs/leave.d.ts
DELETED
package/childs/leave.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Leave = void 0;
|
|
4
|
-
const child_1 = require("../modules/child");
|
|
5
|
-
class Leave extends child_1.Child {
|
|
6
|
-
async chat(id) {
|
|
7
|
-
return this.telegram.api.post('leaveChat', { chat_id: id });
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
exports.Leave = Leave;
|
package/childs/pin.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { FetchError } from '@aracna/core';
|
|
2
|
-
import { PinChatMessage } from '@aracna/telegram-bot-types';
|
|
3
|
-
import { Child } from '../modules/child';
|
|
4
|
-
export declare class Pin extends Child {
|
|
5
|
-
chatMessage(chatID: number, message: number, parameters?: Partial<PinChatMessage>): Promise<boolean | FetchError>;
|
|
6
|
-
}
|
package/childs/pin.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Pin = void 0;
|
|
4
|
-
const child_1 = require("../modules/child");
|
|
5
|
-
class Pin extends child_1.Child {
|
|
6
|
-
async chatMessage(chatID, message, parameters) {
|
|
7
|
-
return this.telegram.api.post('pinChatMessage', { chat_id: chatID, message_id: message, ...parameters });
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
exports.Pin = Pin;
|
package/childs/polling.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { GetUpdates } from '@aracna/telegram-bot-types';
|
|
2
|
-
import { Child } from '../modules/child';
|
|
3
|
-
export declare class Polling extends Child {
|
|
4
|
-
active: boolean;
|
|
5
|
-
offset: number;
|
|
6
|
-
start(ms?: number, parameters?: Partial<GetUpdates>): void;
|
|
7
|
-
stop(): void;
|
|
8
|
-
private get;
|
|
9
|
-
}
|
package/childs/polling.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Polling = void 0;
|
|
4
|
-
const enums_1 = require("../definitions/enums");
|
|
5
|
-
const child_1 = require("../modules/child");
|
|
6
|
-
class Polling extends child_1.Child {
|
|
7
|
-
active = false;
|
|
8
|
-
offset = 0;
|
|
9
|
-
start(ms = 1000, parameters) {
|
|
10
|
-
this.active = true;
|
|
11
|
-
this.get(ms, parameters);
|
|
12
|
-
}
|
|
13
|
-
stop() {
|
|
14
|
-
this.active = false;
|
|
15
|
-
}
|
|
16
|
-
async get(ms, parameters) {
|
|
17
|
-
let body, updates;
|
|
18
|
-
body = {
|
|
19
|
-
allowed_updates: Object.values(enums_1.UpdateType).map((v) => v.toLowerCase()),
|
|
20
|
-
offset: this.offset,
|
|
21
|
-
...parameters
|
|
22
|
-
};
|
|
23
|
-
updates = await this.telegram.api.post('getUpdates', body);
|
|
24
|
-
if (updates instanceof Error)
|
|
25
|
-
return updates;
|
|
26
|
-
updates.forEach((v) => this.telegram.handle(v));
|
|
27
|
-
this.offset = updates.length > 0 ? updates[updates.length - 1].update_id + 1 : this.offset;
|
|
28
|
-
if (this.active) {
|
|
29
|
-
setTimeout(() => this.get(ms, parameters), ms);
|
|
30
|
-
}
|
|
31
|
-
return updates;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
exports.Polling = Polling;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { FetchError } from '@aracna/core';
|
|
2
|
-
import { InlineKeyboardButton, Message, SendMessage } from '@aracna/telegram-bot-types';
|
|
3
|
-
import { Child } from '../../modules/child';
|
|
4
|
-
export declare class SendPrivate extends Child {
|
|
5
|
-
buttons(chatIDs: [number, number], text: string, buttons: InlineKeyboardButton[], parameters?: Partial<SendMessage>): Promise<Message | FetchError | Error>;
|
|
6
|
-
repliable<T>(chatIDs: [number, number], text: string, data: T, type: string, parameters?: Partial<SendMessage>): Promise<Message | FetchError | Error>;
|
|
7
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SendPrivate = void 0;
|
|
4
|
-
const child_1 = require("../../modules/child");
|
|
5
|
-
const callback_query_utils_1 = require("../../utils/callback.query.utils");
|
|
6
|
-
class SendPrivate extends child_1.Child {
|
|
7
|
-
async buttons(chatIDs, text, buttons, parameters) {
|
|
8
|
-
return this.telegram.send.buttons(chatIDs[1], text, buttons.map((v) => {
|
|
9
|
-
let decoded;
|
|
10
|
-
decoded = callback_query_utils_1.CallbackQueryUtils.decodeBody(v.callback_data);
|
|
11
|
-
decoded.c = chatIDs[0];
|
|
12
|
-
return this.telegram.builder.button.callback(v.text, decoded.d, decoded.t, decoded.c);
|
|
13
|
-
}), parameters);
|
|
14
|
-
}
|
|
15
|
-
async repliable(chatIDs, text, data, type, parameters) {
|
|
16
|
-
return this.telegram.send.repliable(chatIDs[1], text, data, type, parameters, chatIDs[0]);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
exports.SendPrivate = SendPrivate;
|
package/childs/promote.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { FetchError } from '@aracna/core';
|
|
2
|
-
import { PromoteChatMember } from '@aracna/telegram-bot-types';
|
|
3
|
-
import { Child } from '../modules/child';
|
|
4
|
-
export declare class Promote extends Child {
|
|
5
|
-
chatMember(chatID: number, userID: number, parameters?: Partial<PromoteChatMember>): Promise<boolean | FetchError>;
|
|
6
|
-
}
|
package/childs/promote.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Promote = void 0;
|
|
4
|
-
const child_1 = require("../modules/child");
|
|
5
|
-
class Promote extends child_1.Child {
|
|
6
|
-
async chatMember(chatID, userID, parameters) {
|
|
7
|
-
return this.telegram.api.post('promoteChatMember', { chat_id: chatID, user_id: userID, ...parameters });
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
exports.Promote = Promote;
|
package/childs/restrict.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { FetchError } from '@aracna/core';
|
|
2
|
-
import { ChatPermissions, RestrictChatMember } from '@aracna/telegram-bot-types';
|
|
3
|
-
import { Child } from '../modules/child';
|
|
4
|
-
export declare class Restrict extends Child {
|
|
5
|
-
chatMember(chatID: number, userID: number, permissions: ChatPermissions, parameters?: Partial<RestrictChatMember>): Promise<boolean | FetchError>;
|
|
6
|
-
}
|
package/childs/restrict.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Restrict = void 0;
|
|
4
|
-
const child_1 = require("../modules/child");
|
|
5
|
-
class Restrict extends child_1.Child {
|
|
6
|
-
async chatMember(chatID, userID, permissions, parameters) {
|
|
7
|
-
return this.telegram.api.post('restrictChatMember', {
|
|
8
|
-
chat_id: chatID,
|
|
9
|
-
permissions: permissions,
|
|
10
|
-
user_id: userID,
|
|
11
|
-
...parameters
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
exports.Restrict = Restrict;
|
package/childs/send.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { FetchError } from '@aracna/core';
|
|
2
|
-
import { InlineKeyboardButton, InputPollOption, LabeledPrice, Message, SendAnimation, SendAudio, SendContact, SendDice, SendDocument, SendGame, SendInvoice, SendLocation, SendMediaGroup, SendMessage, SendPhoto, SendPoll, SendSticker, SendVenue, SendVideo, SendVideoNote, SendVoice } from '@aracna/telegram-bot-types';
|
|
3
|
-
import { InputMediaAlternative } from '../definitions/interfaces';
|
|
4
|
-
import { InputFile } from '../definitions/types';
|
|
5
|
-
import { Child } from '../modules/child';
|
|
6
|
-
import { SendPrivate } from './privates/send.private';
|
|
7
|
-
export declare class Send extends Child {
|
|
8
|
-
private: SendPrivate;
|
|
9
|
-
animation(chatID: number, file: InputFile, parameters?: Partial<SendAnimation>): Promise<Message | FetchError>;
|
|
10
|
-
audio(chatID: number, file: InputFile, parameters?: Partial<SendAudio>): Promise<Message | FetchError>;
|
|
11
|
-
document(chatID: number, file: InputFile, parameters?: Partial<SendDocument>): Promise<Message | FetchError>;
|
|
12
|
-
buttons(chatID: number, text: string, buttons: InlineKeyboardButton[], parameters?: Partial<SendMessage>): Promise<Message | FetchError | Error>;
|
|
13
|
-
chatAction(chatID: number, action: string): Promise<boolean | FetchError>;
|
|
14
|
-
contact(chatID: number, phoneNumber: string, firstName: string, parameters?: Partial<SendContact>): Promise<Message | FetchError>;
|
|
15
|
-
dice(chatID: number, parameters?: Partial<SendDice>): Promise<Message | FetchError>;
|
|
16
|
-
game(chatID: number, gameShortName: string, parameters?: Partial<SendGame>): Promise<Message | FetchError>;
|
|
17
|
-
html(chatID: number, text: string, parameters?: Partial<SendMessage>): Promise<Message | FetchError>;
|
|
18
|
-
invoice(chatID: number, title: string, description: string, payload: string, providerToken: string, startParameter: string, currency: string, prices: LabeledPrice[], parameters?: Partial<SendInvoice>): Promise<Message | FetchError>;
|
|
19
|
-
location(chatID: number, latitude: number, longitude: number, parameters?: Partial<SendLocation>): Promise<Message | FetchError>;
|
|
20
|
-
mediaGroup(chatID: number, media: InputMediaAlternative[], parameters?: Partial<SendMediaGroup>): Promise<Message | FetchError>;
|
|
21
|
-
message(chatID: number, text: string, parameters?: Partial<SendMessage>): Promise<Message | FetchError>;
|
|
22
|
-
photo(chatID: number, file: InputFile, parameters?: Partial<SendPhoto>): Promise<Message | FetchError>;
|
|
23
|
-
poll(chatID: number, question: string, options: InputPollOption[], parameters?: Partial<SendPoll>): Promise<Message | FetchError>;
|
|
24
|
-
repliable<T>(chatID: number, text: string, data: T, type: string, parameters?: Partial<SendMessage>, fromChatID?: number): Promise<Message | FetchError>;
|
|
25
|
-
sticker(chatID: number, file: InputFile, parameters?: Partial<SendSticker>): Promise<Message | FetchError>;
|
|
26
|
-
venue(chatID: number, latitude: number, longitude: number, title: string, address: string, parameters?: Partial<SendVenue>): Promise<Message | FetchError>;
|
|
27
|
-
video(chatID: number, file: InputFile, parameters?: Partial<SendVideo>): Promise<Message | FetchError>;
|
|
28
|
-
videoNote(chatID: number, file: InputFile, parameters?: Partial<SendVideoNote>): Promise<Message | FetchError>;
|
|
29
|
-
voice(chatID: number, file: InputFile, parameters?: Partial<SendVoice>): Promise<Message | FetchError>;
|
|
30
|
-
private file;
|
|
31
|
-
}
|
package/childs/send.js
DELETED
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Send = void 0;
|
|
4
|
-
const core_1 = require("@aracna/core");
|
|
5
|
-
const child_1 = require("../modules/child");
|
|
6
|
-
const configuration_1 = require("../modules/configuration");
|
|
7
|
-
const html_utils_1 = require("../utils/html.utils");
|
|
8
|
-
const inline_keyboard_utils_1 = require("../utils/inline.keyboard.utils");
|
|
9
|
-
const reply_to_message_utils_1 = require("../utils/reply.to.message.utils");
|
|
10
|
-
const send_private_1 = require("./privates/send.private");
|
|
11
|
-
class Send extends child_1.Child {
|
|
12
|
-
private = new send_private_1.SendPrivate(this.telegram);
|
|
13
|
-
async animation(chatID, file, parameters) {
|
|
14
|
-
return this.file(chatID, file, 'animation', parameters);
|
|
15
|
-
}
|
|
16
|
-
async audio(chatID, file, parameters) {
|
|
17
|
-
return this.file(chatID, file, 'audio', parameters);
|
|
18
|
-
}
|
|
19
|
-
async document(chatID, file, parameters) {
|
|
20
|
-
return this.file(chatID, file, 'document', parameters);
|
|
21
|
-
}
|
|
22
|
-
async buttons(chatID, text, buttons, parameters) {
|
|
23
|
-
return buttons.length <= 0
|
|
24
|
-
? configuration_1.Configuration.handler.send.buttons.empty(chatID)
|
|
25
|
-
: this.message(chatID, text, {
|
|
26
|
-
reply_markup: {
|
|
27
|
-
inline_keyboard: buttons
|
|
28
|
-
.concat(await (0, core_1.getObjectProperty)(configuration_1.Configuration.default.buttons, inline_keyboard_utils_1.InlineKeyboardUtils.getButtonsType(buttons), async (chatID) => [])(chatID))
|
|
29
|
-
.map((v) => [v])
|
|
30
|
-
},
|
|
31
|
-
...parameters
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
async chatAction(chatID, action) {
|
|
35
|
-
return this.telegram.api.post('sendChatAction', { chat_id: chatID, action: action });
|
|
36
|
-
}
|
|
37
|
-
async contact(chatID, phoneNumber, firstName, parameters) {
|
|
38
|
-
return this.telegram.api.post('sendContact', { chat_id: chatID, first_name: firstName, phone_number: phoneNumber, ...parameters });
|
|
39
|
-
}
|
|
40
|
-
async dice(chatID, parameters) {
|
|
41
|
-
return this.telegram.api.post('sendDice', { chat_id: chatID, ...parameters });
|
|
42
|
-
}
|
|
43
|
-
async game(chatID, gameShortName, parameters) {
|
|
44
|
-
return this.telegram.api.post('sendGame', { chat_id: chatID, game_short_name: gameShortName, ...parameters });
|
|
45
|
-
}
|
|
46
|
-
async html(chatID, text, parameters) {
|
|
47
|
-
return this.message(chatID, html_utils_1.HTMLUtils.sanitize(text), {
|
|
48
|
-
parse_mode: 'HTML',
|
|
49
|
-
...parameters
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
async invoice(chatID, title, description, payload, providerToken, startParameter, currency, prices, parameters) {
|
|
53
|
-
return this.telegram.api.post('sendInvoice', {
|
|
54
|
-
chat_id: chatID,
|
|
55
|
-
currency: currency,
|
|
56
|
-
description: description,
|
|
57
|
-
payload: payload,
|
|
58
|
-
prices: prices,
|
|
59
|
-
provider_token: providerToken,
|
|
60
|
-
start_parameter: startParameter,
|
|
61
|
-
title: title,
|
|
62
|
-
...parameters
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
async location(chatID, latitude, longitude, parameters) {
|
|
66
|
-
return this.telegram.api.post('sendLocation', { chat_id: chatID, latitude: latitude, longitude: longitude, ...parameters });
|
|
67
|
-
}
|
|
68
|
-
async mediaGroup(chatID, media, parameters) {
|
|
69
|
-
return this.telegram.api.post('sendMediaGroup', media.every((v) => v.media instanceof Buffer)
|
|
70
|
-
? {
|
|
71
|
-
chat_id: chatID,
|
|
72
|
-
media: media.map((v, k) => ({ ...v, media: `attach://media_${k}` })),
|
|
73
|
-
...media.reduce((r, v, k) => ({ ...r, [`media_${k}`]: v.media }), {}),
|
|
74
|
-
...parameters
|
|
75
|
-
}
|
|
76
|
-
: { chat_id: chatID, media: media, ...parameters });
|
|
77
|
-
}
|
|
78
|
-
async message(chatID, text, parameters) {
|
|
79
|
-
return this.telegram.api.post('sendMessage', {
|
|
80
|
-
chat_id: chatID,
|
|
81
|
-
text: text,
|
|
82
|
-
...parameters
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
async photo(chatID, file, parameters) {
|
|
86
|
-
return this.file(chatID, file, 'photo', parameters);
|
|
87
|
-
}
|
|
88
|
-
async poll(chatID, question, options, parameters) {
|
|
89
|
-
return this.telegram.api.post('sendPoll', { chat_id: chatID, options: options, question: question, ...parameters });
|
|
90
|
-
}
|
|
91
|
-
async repliable(chatID, text, data, type, parameters, fromChatID) {
|
|
92
|
-
return this.html(chatID, text + reply_to_message_utils_1.ReplyToMessageUtils.encodeBody(data, type, fromChatID), {
|
|
93
|
-
reply_markup: {
|
|
94
|
-
force_reply: true,
|
|
95
|
-
selective: true
|
|
96
|
-
},
|
|
97
|
-
...parameters
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
async sticker(chatID, file, parameters) {
|
|
101
|
-
return this.file(chatID, file, 'sticker', parameters);
|
|
102
|
-
}
|
|
103
|
-
async venue(chatID, latitude, longitude, title, address, parameters) {
|
|
104
|
-
return this.telegram.api.post('sendVanue', {
|
|
105
|
-
address: address,
|
|
106
|
-
chat_id: chatID,
|
|
107
|
-
latitude: latitude,
|
|
108
|
-
longitude: longitude,
|
|
109
|
-
title: title,
|
|
110
|
-
...parameters
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
async video(chatID, file, parameters) {
|
|
114
|
-
return this.file(chatID, file, 'video', parameters);
|
|
115
|
-
}
|
|
116
|
-
async videoNote(chatID, file, parameters) {
|
|
117
|
-
return this.file(chatID, file, 'video_note', parameters);
|
|
118
|
-
}
|
|
119
|
-
async voice(chatID, file, parameters) {
|
|
120
|
-
return this.file(chatID, file, 'voice', parameters);
|
|
121
|
-
}
|
|
122
|
-
file(chatID, data, type, parameters) {
|
|
123
|
-
return this.telegram.api.post('send' + (0, core_1.getPascalCaseString)(type), {
|
|
124
|
-
chat_id: chatID,
|
|
125
|
-
[type]: data,
|
|
126
|
-
...parameters
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
exports.Send = Send;
|
package/childs/set.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { FetchError } from '@aracna/core';
|
|
2
|
-
import { BotCommand, ChatPermissions, PassportElementError, SetGameScore, SetMyCommands, SetStickerSetThumbnail } from '@aracna/telegram-bot-types';
|
|
3
|
-
import { InputFile } from '../definitions/types';
|
|
4
|
-
import { Child } from '../modules/child';
|
|
5
|
-
export declare class Set extends Child {
|
|
6
|
-
chatAdministratorCustomTitle(chatID: number, userID: number, customTitle: string): Promise<boolean | FetchError>;
|
|
7
|
-
chatDescription(chatID: number, description: string): Promise<boolean | FetchError>;
|
|
8
|
-
chatPermissions(chatID: number, permissions: ChatPermissions): Promise<boolean | FetchError>;
|
|
9
|
-
chatPhoto(chatID: number, photo: InputFile): Promise<boolean | FetchError>;
|
|
10
|
-
chatStickerSet(chatID: number, stickerSetName: string): Promise<boolean | FetchError>;
|
|
11
|
-
chatTitle(chatID: number, title: string): Promise<boolean | FetchError>;
|
|
12
|
-
commands(commands: BotCommand[], parameters?: Partial<SetMyCommands>): Promise<boolean | FetchError>;
|
|
13
|
-
gameScore(userID: number, score: number, parameters?: Partial<SetGameScore>): Promise<boolean | FetchError>;
|
|
14
|
-
passportDataErrors(userID: number, errors: PassportElementError[]): Promise<boolean | FetchError>;
|
|
15
|
-
stickerPositionInSet(sticker: string, position: number): Promise<boolean | FetchError>;
|
|
16
|
-
stickerSetThumb(name: string, userID: number, format: string, parameters?: Partial<SetStickerSetThumbnail>): Promise<boolean | FetchError>;
|
|
17
|
-
}
|
package/childs/set.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Set = void 0;
|
|
4
|
-
const child_1 = require("../modules/child");
|
|
5
|
-
class Set extends child_1.Child {
|
|
6
|
-
async chatAdministratorCustomTitle(chatID, userID, customTitle) {
|
|
7
|
-
return this.telegram.api.post('setChatAdministratorCustomTitle', {
|
|
8
|
-
custom_title: customTitle,
|
|
9
|
-
chat_id: chatID,
|
|
10
|
-
user_id: userID
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
async chatDescription(chatID, description) {
|
|
14
|
-
return this.telegram.api.post('setChatDescription', { chat_id: chatID, description: description });
|
|
15
|
-
}
|
|
16
|
-
async chatPermissions(chatID, permissions) {
|
|
17
|
-
return this.telegram.api.post('setChatTitle', { chat_id: chatID, permissions: permissions });
|
|
18
|
-
}
|
|
19
|
-
async chatPhoto(chatID, photo) {
|
|
20
|
-
return this.telegram.api.post('setChatPhoto', { chat_id: chatID, photo: photo });
|
|
21
|
-
}
|
|
22
|
-
async chatStickerSet(chatID, stickerSetName) {
|
|
23
|
-
return this.telegram.api.post('setChatStickerSet', { chat_id: chatID, sticker_set_name: stickerSetName });
|
|
24
|
-
}
|
|
25
|
-
async chatTitle(chatID, title) {
|
|
26
|
-
return this.telegram.api.post('setChatTitle', { chat_id: chatID, title: title });
|
|
27
|
-
}
|
|
28
|
-
async commands(commands, parameters) {
|
|
29
|
-
return this.telegram.api.post('setMyCommands', { commands: commands, ...parameters });
|
|
30
|
-
}
|
|
31
|
-
async gameScore(userID, score, parameters) {
|
|
32
|
-
return this.telegram.api.post('setGameScore', { score: score, user_id: userID, ...parameters });
|
|
33
|
-
}
|
|
34
|
-
async passportDataErrors(userID, errors) {
|
|
35
|
-
return this.telegram.api.post('setPassportDataErrors', { errors: errors, user_id: userID });
|
|
36
|
-
}
|
|
37
|
-
async stickerPositionInSet(sticker, position) {
|
|
38
|
-
return this.telegram.api.post('setStickerPositionInSet', { position: position, sticker: sticker });
|
|
39
|
-
}
|
|
40
|
-
async stickerSetThumb(name, userID, format, parameters) {
|
|
41
|
-
return this.telegram.api.post('setStickerSetThumb', { format: format, name: name, user_id: userID, ...parameters });
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
exports.Set = Set;
|
package/childs/stop.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { FetchError } from '@aracna/core';
|
|
2
|
-
import { Message, Poll, StopMessageLiveLocation, StopPoll } from '@aracna/telegram-bot-types';
|
|
3
|
-
import { Child } from '../modules/child';
|
|
4
|
-
export declare class Stop extends Child {
|
|
5
|
-
messageLiveLocation(parameters: StopMessageLiveLocation): Promise<Message | boolean | FetchError>;
|
|
6
|
-
poll(chatID: number, message: number, parameters?: Partial<StopPoll>): Promise<Poll | FetchError>;
|
|
7
|
-
}
|
package/childs/stop.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Stop = void 0;
|
|
4
|
-
const child_1 = require("../modules/child");
|
|
5
|
-
class Stop extends child_1.Child {
|
|
6
|
-
async messageLiveLocation(parameters) {
|
|
7
|
-
return this.telegram.api.post('stopMessageLiveLocation', parameters);
|
|
8
|
-
}
|
|
9
|
-
async poll(chatID, message, parameters) {
|
|
10
|
-
return this.telegram.api.post('stopPoll', { chat_id: chatID, message_id: message, ...parameters });
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
exports.Stop = Stop;
|