@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
package/childs/webhook.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { FetchError } from '@aracna/core';
|
|
2
|
-
import { SetWebhook } from '@aracna/telegram-bot-types';
|
|
1
|
+
import type { FetchError } from '@aracna/core';
|
|
2
|
+
import type { DeleteWebhook, SetWebhook, WebhookInfo } from '@aracna/telegram-bot-types';
|
|
3
3
|
import { Child } from '../modules/child';
|
|
4
4
|
export declare class Webhook extends Child {
|
|
5
|
-
|
|
5
|
+
close(): Promise<boolean | FetchError>;
|
|
6
|
+
delete(parameters?: Partial<DeleteWebhook>): Promise<boolean | FetchError>;
|
|
7
|
+
getInfo(): Promise<WebhookInfo | FetchError>;
|
|
6
8
|
set(route?: string, parameters?: Partial<SetWebhook>): Promise<boolean | FetchError>;
|
|
7
9
|
url(route: string): string;
|
|
8
10
|
}
|
package/childs/webhook.js
CHANGED
|
@@ -4,8 +4,14 @@ exports.Webhook = void 0;
|
|
|
4
4
|
const enums_1 = require("../definitions/enums");
|
|
5
5
|
const child_1 = require("../modules/child");
|
|
6
6
|
class Webhook extends child_1.Child {
|
|
7
|
-
async
|
|
8
|
-
return this.telegram.api.post('
|
|
7
|
+
async close() {
|
|
8
|
+
return this.telegram.api.post('close');
|
|
9
|
+
}
|
|
10
|
+
async delete(parameters) {
|
|
11
|
+
return this.telegram.api.post('deleteWebhook', parameters);
|
|
12
|
+
}
|
|
13
|
+
async getInfo() {
|
|
14
|
+
return this.telegram.api.post('getWebhookInfo');
|
|
9
15
|
}
|
|
10
16
|
async set(route = '', parameters) {
|
|
11
17
|
return this.telegram.api.post('setWebhook', {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { FetchResponse } from '@aracna/core';
|
|
2
|
-
import {
|
|
3
|
-
import { UpdateType } from './enums';
|
|
4
|
-
import { HandlerMiddleware, InputFile } from './types';
|
|
1
|
+
import type { FetchResponse } from '@aracna/core';
|
|
2
|
+
import type { ChatJoinRequest, ChatMemberUpdated, ChosenInlineResult, InlineKeyboardButton, InlineQuery, InputMediaAudio, InputMediaDocument, InputMediaPhoto, InputMediaVideo, Message, CallbackQuery as NativeCallbackQuery, Poll, PollAnswer, PreCheckoutQuery, SendMediaGroup, SendMessage, SendPaidMedia, ShippingQuery } from '@aracna/telegram-bot-types';
|
|
3
|
+
import type { UpdateType } from './enums';
|
|
4
|
+
import type { HandlerMiddleware, InputFile } from './types';
|
|
5
5
|
export interface APIResponse<T> extends FetchResponse<APIResponseData<T>> {
|
|
6
6
|
}
|
|
7
7
|
export interface APIResponseData<T> {
|
|
@@ -12,7 +12,7 @@ export interface CallbackQuery<T = any> extends NativeCallbackQuery {
|
|
|
12
12
|
body: CallbackQueryBody<T>;
|
|
13
13
|
}
|
|
14
14
|
export interface CallbackQueryBody<T = any> {
|
|
15
|
-
c?:
|
|
15
|
+
c?: bigint;
|
|
16
16
|
d: T;
|
|
17
17
|
t: string;
|
|
18
18
|
}
|
|
@@ -25,20 +25,20 @@ export interface ConfigurationAPI {
|
|
|
25
25
|
}
|
|
26
26
|
export interface ConfigurationDefault {
|
|
27
27
|
buttons: {
|
|
28
|
-
text: (chatID:
|
|
29
|
-
url: (chatID:
|
|
30
|
-
login: (chatID:
|
|
31
|
-
callback: (chatID:
|
|
32
|
-
query: (chatID:
|
|
33
|
-
queryCurrentChat: (chatID:
|
|
34
|
-
game: (chatID:
|
|
35
|
-
pay: (chatID:
|
|
28
|
+
text: (chatID: bigint) => Promise<InlineKeyboardButton[]>;
|
|
29
|
+
url: (chatID: bigint) => Promise<InlineKeyboardButton[]>;
|
|
30
|
+
login: (chatID: bigint) => Promise<InlineKeyboardButton[]>;
|
|
31
|
+
callback: (chatID: bigint) => Promise<InlineKeyboardButton[]>;
|
|
32
|
+
query: (chatID: bigint) => Promise<InlineKeyboardButton[]>;
|
|
33
|
+
queryCurrentChat: (chatID: bigint) => Promise<InlineKeyboardButton[]>;
|
|
34
|
+
game: (chatID: bigint) => Promise<InlineKeyboardButton[]>;
|
|
35
|
+
pay: (chatID: bigint) => Promise<InlineKeyboardButton[]>;
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
38
|
export interface ConfigurationHandler {
|
|
39
39
|
send: {
|
|
40
40
|
buttons: {
|
|
41
|
-
empty: (chatID:
|
|
41
|
+
empty: (chatID: bigint) => Error;
|
|
42
42
|
};
|
|
43
43
|
};
|
|
44
44
|
}
|
|
@@ -77,8 +77,11 @@ export interface HandlerOptions {
|
|
|
77
77
|
export interface InputMediaAlternative extends Omit<InputMediaAudio | InputMediaDocument | InputMediaPhoto | InputMediaVideo, 'media'> {
|
|
78
78
|
media: InputFile;
|
|
79
79
|
}
|
|
80
|
+
export interface InputPaidMediaAlternative extends Omit<InputMediaPhoto | InputMediaVideo, 'media'> {
|
|
81
|
+
media: InputFile;
|
|
82
|
+
}
|
|
80
83
|
export interface MessageBody<T = any> {
|
|
81
|
-
chatID?:
|
|
84
|
+
chatID?: bigint;
|
|
82
85
|
data: T;
|
|
83
86
|
type: string;
|
|
84
87
|
}
|
|
@@ -88,6 +91,15 @@ export interface ReplyToMessage<T = any> extends Message {
|
|
|
88
91
|
export interface SendMediaGroupAlternative extends Omit<SendMediaGroup, 'media'> {
|
|
89
92
|
media: InputMediaAlternative[];
|
|
90
93
|
}
|
|
94
|
+
export interface SendPaidMediaAlternative extends Omit<SendPaidMedia, 'media'> {
|
|
95
|
+
media: InputPaidMediaAlternative[];
|
|
96
|
+
}
|
|
97
|
+
export interface SendRepliable<T = any> extends SendMessage {
|
|
98
|
+
data: T;
|
|
99
|
+
from_chat_id?: bigint;
|
|
100
|
+
text: string;
|
|
101
|
+
type: string;
|
|
102
|
+
}
|
|
91
103
|
export interface Start<T = any> extends Message {
|
|
92
104
|
body: MessageBody<T>;
|
|
93
105
|
}
|
package/definitions/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { UpdateType } from './enums';
|
|
2
|
-
import { Context } from './interfaces';
|
|
1
|
+
import type { UpdateType } from './enums';
|
|
2
|
+
import type { Context } from './interfaces';
|
|
3
3
|
export type HandlerMiddleware<T extends UpdateType> = (context: Context[T]) => any;
|
|
4
4
|
export type InputFile = File | string;
|