chz-telegram-bot 0.7.30 → 0.7.32
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/dist/dtos/responses/deleteMessage.d.ts +14 -0
- package/dist/dtos/responses/deleteMessage.d.ts.map +1 -0
- package/dist/dtos/responses/deleteMessage.js +15 -0
- package/dist/dtos/responses/imageMessage.d.ts +2 -2
- package/dist/dtos/responses/imageMessage.d.ts.map +1 -1
- package/dist/dtos/responses/imageMessage.js +1 -1
- package/dist/dtos/responses/pin.d.ts +3 -4
- package/dist/dtos/responses/pin.d.ts.map +1 -1
- package/dist/dtos/responses/textMessage.d.ts +2 -2
- package/dist/dtos/responses/textMessage.d.ts.map +1 -1
- package/dist/dtos/responses/textMessage.js +1 -1
- package/dist/dtos/responses/videoMessage.d.ts +2 -2
- package/dist/dtos/responses/videoMessage.d.ts.map +1 -1
- package/dist/dtos/responses/videoMessage.js +1 -1
- package/dist/entities/actions/commandAction.js +1 -1
- package/dist/entities/actions/scheduledAction.d.ts.map +1 -1
- package/dist/entities/actions/scheduledAction.js +12 -7
- package/dist/entities/context/baseContext.d.ts +2 -2
- package/dist/entities/context/baseContext.d.ts.map +1 -1
- package/dist/entities/context/baseContext.js +14 -2
- package/dist/entities/context/chatContext.d.ts +3 -3
- package/dist/entities/context/chatContext.js +3 -3
- package/dist/entities/context/messageContext.d.ts +6 -6
- package/dist/entities/context/messageContext.js +3 -3
- package/dist/entities/context/replyContext.d.ts +6 -6
- package/dist/entities/context/replyContext.js +3 -3
- package/dist/helpers/mapUtils.d.ts +1 -1
- package/dist/helpers/mapUtils.d.ts.map +1 -1
- package/dist/helpers/mapUtils.js +3 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/services/actionProcessors/commandActionProcessor.d.ts +4 -3
- package/dist/services/actionProcessors/commandActionProcessor.d.ts.map +1 -1
- package/dist/services/actionProcessors/commandActionProcessor.js +21 -21
- package/dist/services/nodeTimeoutScheduler.d.ts.map +1 -1
- package/dist/services/nodeTimeoutScheduler.js +6 -1
- package/dist/services/telegramApi.d.ts +2 -2
- package/dist/services/telegramApi.d.ts.map +1 -1
- package/dist/services/telegramApi.js +25 -5
- package/dist/types/events.d.ts +4 -4
- package/dist/types/events.js +4 -4
- package/dist/types/postSendOperations.d.ts +39 -0
- package/dist/types/postSendOperations.d.ts.map +1 -0
- package/dist/types/postSendOperations.js +1 -0
- package/dist/types/response.d.ts +5 -3
- package/dist/types/response.d.ts.map +1 -1
- package/dist/types/response.js +2 -1
- package/package.json +1 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IAction } from '../../types/action';
|
|
2
|
+
import { IChatResponse } from '../../types/response';
|
|
3
|
+
import { TraceId } from '../../types/trace';
|
|
4
|
+
import { ChatInfo } from '../chatInfo';
|
|
5
|
+
export declare class DeleteMessageResponse implements IChatResponse {
|
|
6
|
+
readonly kind: "deleteMessage";
|
|
7
|
+
readonly createdAt: number;
|
|
8
|
+
readonly messageId: number;
|
|
9
|
+
readonly chatInfo: ChatInfo;
|
|
10
|
+
readonly traceId: TraceId;
|
|
11
|
+
readonly action: IAction;
|
|
12
|
+
constructor(messageId: number, chatInfo: ChatInfo, traceId: TraceId, action: IAction);
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=deleteMessage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deleteMessage.d.ts","sourceRoot":"","sources":["../../../src/dtos/responses/deleteMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAoB,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,qBAAa,qBAAsB,YAAW,aAAa;IACvD,QAAQ,CAAC,IAAI,kBAAkC;IAC/C,QAAQ,CAAC,SAAS,SAAc;IAEhC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;gBAGrB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,OAAO;CAOtB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BotResponseTypes } from '../../types/response';
|
|
2
|
+
export class DeleteMessageResponse {
|
|
3
|
+
kind = BotResponseTypes.deleteMessage;
|
|
4
|
+
createdAt = Date.now();
|
|
5
|
+
messageId;
|
|
6
|
+
chatInfo;
|
|
7
|
+
traceId;
|
|
8
|
+
action;
|
|
9
|
+
constructor(messageId, chatInfo, traceId, action) {
|
|
10
|
+
this.messageId = messageId;
|
|
11
|
+
this.chatInfo = chatInfo;
|
|
12
|
+
this.traceId = traceId;
|
|
13
|
+
this.action = action;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -3,12 +3,12 @@ import { IAction } from '../../types/action';
|
|
|
3
3
|
import { ChatInfo } from '../chatInfo';
|
|
4
4
|
import { TraceId } from '../../types/trace';
|
|
5
5
|
import { ReplyInfo } from '../replyInfo';
|
|
6
|
-
import {
|
|
6
|
+
import { PostSendOperation } from '../../types/postSendOperations';
|
|
7
7
|
import { InputFile } from '../../types/inputFile';
|
|
8
8
|
export declare class ImageMessage implements IReplyResponseWithContent<InputFile> {
|
|
9
9
|
readonly kind: "image";
|
|
10
10
|
readonly createdAt: number;
|
|
11
|
-
readonly
|
|
11
|
+
readonly postSendOperations: PostSendOperation[];
|
|
12
12
|
readonly content: InputFile;
|
|
13
13
|
readonly chatInfo: ChatInfo;
|
|
14
14
|
readonly replyInfo: ReplyInfo | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imageMessage.d.ts","sourceRoot":"","sources":["../../../src/dtos/responses/imageMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,yBAAyB,EAC5B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"imageMessage.d.ts","sourceRoot":"","sources":["../../../src/dtos/responses/imageMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,yBAAyB,EAC5B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,qBAAa,YAAa,YAAW,yBAAyB,CAAC,SAAS,CAAC;IACrE,QAAQ,CAAC,IAAI,UAA0B;IACvC,QAAQ,CAAC,SAAS,SAAc;IAChC,QAAQ,CAAC,kBAAkB,EAAE,iBAAiB,EAAE,CAAM;IAEtD,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,SAAS,GAAG,SAAS,CAAC;IAC1C,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,iBAAiB,SAAS;IACnC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;gBAGrB,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,OAAO,EACf,SAAS,CAAC,EAAE,SAAS;IASzB,IAAI,cAAc,iBAQjB;CACJ"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { IChatResponse } from '../../types/response';
|
|
2
|
-
import {
|
|
3
|
-
import { IActionState } from '../../types/actionState';
|
|
2
|
+
import { IAction } from '../../types/action';
|
|
4
3
|
import { ChatInfo } from '../chatInfo';
|
|
5
4
|
import { TraceId } from '../../types/trace';
|
|
6
5
|
export declare class PinResponse implements IChatResponse {
|
|
@@ -9,7 +8,7 @@ export declare class PinResponse implements IChatResponse {
|
|
|
9
8
|
readonly messageId: number;
|
|
10
9
|
readonly chatInfo: ChatInfo;
|
|
11
10
|
readonly traceId: TraceId;
|
|
12
|
-
readonly action:
|
|
13
|
-
constructor(messageId: number, chatInfo: ChatInfo, traceId: TraceId, action:
|
|
11
|
+
readonly action: IAction;
|
|
12
|
+
constructor(messageId: number, chatInfo: ChatInfo, traceId: TraceId, action: IAction);
|
|
14
13
|
}
|
|
15
14
|
//# sourceMappingURL=pin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pin.d.ts","sourceRoot":"","sources":["../../../src/dtos/responses/pin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"pin.d.ts","sourceRoot":"","sources":["../../../src/dtos/responses/pin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,qBAAa,WAAY,YAAW,aAAa;IAC7C,QAAQ,CAAC,IAAI,QAAwB;IACrC,QAAQ,CAAC,SAAS,SAAc;IAEhC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;gBAGrB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,OAAO;CAOtB"}
|
|
@@ -4,12 +4,12 @@ import { IAction } from '../../types/action';
|
|
|
4
4
|
import { ChatInfo } from '../chatInfo';
|
|
5
5
|
import { TraceId } from '../../types/trace';
|
|
6
6
|
import { ReplyInfo } from '../replyInfo';
|
|
7
|
-
import {
|
|
7
|
+
import { PostSendOperation } from '../../types/postSendOperations';
|
|
8
8
|
import { TelegramInlineKeyboardButton } from '../../types/externalAliases';
|
|
9
9
|
export declare class TextMessage implements IReplyResponseWithContent<string> {
|
|
10
10
|
readonly kind: "text";
|
|
11
11
|
readonly createdAt: number;
|
|
12
|
-
readonly
|
|
12
|
+
readonly postSendOperations: PostSendOperation[];
|
|
13
13
|
readonly content: string;
|
|
14
14
|
readonly chatInfo: ChatInfo;
|
|
15
15
|
readonly replyInfo: ReplyInfo | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textMessage.d.ts","sourceRoot":"","sources":["../../../src/dtos/responses/textMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,EAEH,yBAAyB,EAC5B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,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,EAClB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,OAAO,EACf,SAAS,CAAC,EAAE,SAAS,EACrB,OAAO,CAAC,EAAE,yBAAyB;IAYvC,IAAI,cAAc,gBASjB;CACJ"}
|
|
@@ -3,12 +3,12 @@ import { IAction } from '../../types/action';
|
|
|
3
3
|
import { ChatInfo } from '../chatInfo';
|
|
4
4
|
import { TraceId } from '../../types/trace';
|
|
5
5
|
import { ReplyInfo } from '../replyInfo';
|
|
6
|
-
import {
|
|
6
|
+
import { PostSendOperation } from '../../types/postSendOperations';
|
|
7
7
|
import { InputFile } from '../../types/inputFile';
|
|
8
8
|
export declare class VideoMessage implements IReplyResponseWithContent<InputFile> {
|
|
9
9
|
readonly kind: "video";
|
|
10
10
|
readonly createdAt: number;
|
|
11
|
-
readonly
|
|
11
|
+
readonly postSendOperations: PostSendOperation[];
|
|
12
12
|
readonly content: InputFile;
|
|
13
13
|
readonly chatInfo: ChatInfo;
|
|
14
14
|
readonly replyInfo: ReplyInfo | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"videoMessage.d.ts","sourceRoot":"","sources":["../../../src/dtos/responses/videoMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,yBAAyB,EAC5B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"videoMessage.d.ts","sourceRoot":"","sources":["../../../src/dtos/responses/videoMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,yBAAyB,EAC5B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,qBAAa,YAAa,YAAW,yBAAyB,CAAC,SAAS,CAAC;IACrE,QAAQ,CAAC,IAAI,UAA0B;IACvC,QAAQ,CAAC,SAAS,SAAc;IAChC,QAAQ,CAAC,kBAAkB,EAAE,iBAAiB,EAAE,CAAM;IAEtD,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,SAAS,GAAG,SAAS,CAAC;IAC1C,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,iBAAiB,SAAS;IACnC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;gBAGrB,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,OAAO,EACf,SAAS,CAAC,EAAE,SAAS;IASzB,IAAI,cAAc,iBAQjB;CACJ"}
|
|
@@ -41,7 +41,7 @@ export class CommandAction {
|
|
|
41
41
|
this.maxAllowedSimultaniousExecutions =
|
|
42
42
|
maxAllowedSimultaniousExecutions;
|
|
43
43
|
this.semaphoreFactory = () => new Semaphore(this.maxAllowedSimultaniousExecutions);
|
|
44
|
-
this.key = `command:${this.name.
|
|
44
|
+
this.key = `command:${this.name.replaceAll('.', '-')}`;
|
|
45
45
|
}
|
|
46
46
|
async exec(ctx) {
|
|
47
47
|
let lock;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheduledAction.d.ts","sourceRoot":"","sources":["../../../src/entities/act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AC;gBAG7C,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,gBAAgB,CAAC,YAAY,CAAC,EACvC,SAAS,EAAE,wBAAwB,EACnC,oBAAoB,EAAE,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,EACrD,gBAAgB,EAAE,MAAM,YAAY;IAclC,IAAI,CAAC,GAAG,EAAE,mBAAmB,CAAC,YAAY,CAAC;YAoDnC,cAAc;IAgE5B,OAAO,CAAC,uBAAuB;CAqBlC"}
|
|
@@ -17,7 +17,7 @@ export class ScheduledAction {
|
|
|
17
17
|
handler;
|
|
18
18
|
constructor(name, handler, providers, cachedStateFactories, stateConstructor) {
|
|
19
19
|
this.name = name;
|
|
20
|
-
this.key = `scheduled:${this.name.
|
|
20
|
+
this.key = `scheduled:${this.name.replaceAll('.', '-')}`;
|
|
21
21
|
this.timeinHoursProvider = providers.timeinHoursProvider;
|
|
22
22
|
this.activeProvider = providers.isActiveProvider;
|
|
23
23
|
this.chatsWhitelistProvider = providers.chatsWhitelistProvider;
|
|
@@ -67,7 +67,10 @@ export class ScheduledAction {
|
|
|
67
67
|
});
|
|
68
68
|
const value = await cachedItemFactory.getValue();
|
|
69
69
|
this.cachedState.set(key, value);
|
|
70
|
-
ctx.scheduler.createOnetimeTask(`Drop cached value [${this.name} : ${key}]`, () =>
|
|
70
|
+
ctx.scheduler.createOnetimeTask(`Drop cached value [${this.name} : ${key}]`, () => {
|
|
71
|
+
this.cachedState.delete(key);
|
|
72
|
+
ScheduledAction.locks.delete(semaphoreKey);
|
|
73
|
+
}, hoursToMilliseconds(cachedItemFactory.invalidationTimeoutInHours), ctx.botName);
|
|
71
74
|
return value;
|
|
72
75
|
}
|
|
73
76
|
finally {
|
|
@@ -82,12 +85,14 @@ export class ScheduledAction {
|
|
|
82
85
|
}
|
|
83
86
|
checkIfShouldBeExecuted(state, ctx) {
|
|
84
87
|
const now = new Date();
|
|
85
|
-
const startOfToday =
|
|
88
|
+
const startOfToday = now.getTime() -
|
|
89
|
+
(now.getHours() * 3600000 +
|
|
90
|
+
now.getMinutes() * 60000 +
|
|
91
|
+
now.getSeconds() * 1000 +
|
|
92
|
+
now.getMilliseconds());
|
|
86
93
|
const lastExecutedDate = new Date(state.lastExecutedDate);
|
|
87
|
-
const
|
|
88
|
-
const
|
|
89
|
-
scheduledTime.setTime(scheduledTime.getTime() + this.timeinHoursProvider(ctx) * 3600000);
|
|
90
|
-
const isAllowedToTrigger = currentTime >= scheduledTime;
|
|
94
|
+
const scheduledTime = new Date(startOfToday + this.timeinHoursProvider(ctx) * 3600000);
|
|
95
|
+
const isAllowedToTrigger = now >= scheduledTime;
|
|
91
96
|
const hasTriggeredToday = lastExecutedDate.getTime() > startOfToday;
|
|
92
97
|
return isAllowedToTrigger && !hasTriggeredToday;
|
|
93
98
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ChatInfo } from '../../dtos/chatInfo';
|
|
2
2
|
import { IAction, IActionWithState } from '../../types/action';
|
|
3
3
|
import { IActionState } from '../../types/actionState';
|
|
4
|
-
import { ICaptureController } from '../../types/capture';
|
|
5
4
|
import { TypedEventEmitter } from '../../types/events';
|
|
5
|
+
import { IPostSendOperationController } from '../../types/postSendOperations';
|
|
6
6
|
import { BotResponse, IReplyResponse } from '../../types/response';
|
|
7
7
|
import { IScheduler } from '../../types/scheduler';
|
|
8
8
|
import { IStorageClient } from '../../types/storage';
|
|
@@ -27,7 +27,7 @@ export declare abstract class BaseContextInternal<TAction extends IAction> {
|
|
|
27
27
|
};
|
|
28
28
|
get actionKey(): import("../..").ActionKey;
|
|
29
29
|
constructor(storage: IStorageClient, scheduler: IScheduler, eventEmitter: TypedEventEmitter, action: TAction, chatInfo: ChatInfo, traceId: TraceId, botName: string);
|
|
30
|
-
protected
|
|
30
|
+
protected createPostSendOperationController(response: IReplyResponse): IPostSendOperationController;
|
|
31
31
|
/**
|
|
32
32
|
* Loads state of another action for current chat.
|
|
33
33
|
* @param action Action to load state of.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baseContext.d.ts","sourceRoot":"","sources":["../../../src/entities/context/baseContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"baseContext.d.ts","sourceRoot":"","sources":["../../../src/entities/context/baseContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAG5C,MAAM,MAAM,2BAA2B,GACjC,QAAQ,GACR,eAAe,GACf,SAAS,GACT,WAAW,GACX,WAAW,CAAC;AAElB,8BAAsB,mBAAmB,CAAC,OAAO,SAAS,OAAO;IAC7D,QAAQ,CAAC,SAAS,EAAE,WAAW,EAAE,CAAM;IACvC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,iEAAiE;IACjE,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;IACjC,2DAA2D;IAC3D,QAAQ,CAAC,SAAS,EAAE,UAAU,CAAC;IAC/B,+CAA+C;IAC/C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,wBAAwB;IACxB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAE5B,QAAQ,CAAC,aAAa,EAAE;QACpB,qEAAqE;QACrE,YAAY,EAAE,iBAAiB,CAAC;QAChC,sCAAsC;QACtC,OAAO,EAAE,OAAO,CAAC;KACpB,CAAC;IAEF,IAAI,SAAS,8BAEZ;gBAGG,OAAO,EAAE,cAAc,EACvB,SAAS,EAAE,UAAU,EACrB,YAAY,EAAE,iBAAiB,EAC/B,MAAM,EAAE,OAAO,EACf,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,MAAM;IAanB,SAAS,CAAC,iCAAiC,CACvC,QAAQ,EAAE,cAAc,GACzB,4BAA4B;IA+B/B;;;;OAIG;IACH,WAAW,CAAC,mBAAmB,SAAS,YAAY,EAChD,MAAM,EAAE,gBAAgB,CAAC,mBAAmB,CAAC;IAWjD;;;;;OAKG;IACG,aAAa,CAAC,mBAAmB,SAAS,YAAY,EACxD,MAAM,EAAE,gBAAgB,CAAC,mBAAmB,CAAC,EAC7C,QAAQ,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,OAAO,CAAC,IAAI,CAAC;CAI9D"}
|
|
@@ -24,15 +24,27 @@ export class BaseContextInternal {
|
|
|
24
24
|
traceId
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
|
|
27
|
+
createPostSendOperationController(response) {
|
|
28
28
|
return {
|
|
29
29
|
captureReplies: (trigger, handler, abortController) => {
|
|
30
|
-
response.
|
|
30
|
+
response.postSendOperations.push({
|
|
31
|
+
kind: 'captureReplies',
|
|
31
32
|
trigger,
|
|
32
33
|
handler,
|
|
33
34
|
abortController: abortController ?? new AbortController(),
|
|
34
35
|
action: this.action
|
|
35
36
|
});
|
|
37
|
+
},
|
|
38
|
+
pin: () => {
|
|
39
|
+
response.postSendOperations.push({
|
|
40
|
+
kind: 'pin'
|
|
41
|
+
});
|
|
42
|
+
},
|
|
43
|
+
deleteAfter: (timeout) => {
|
|
44
|
+
response.postSendOperations.push({
|
|
45
|
+
kind: 'deleteAfterTimeout',
|
|
46
|
+
timeout: timeout
|
|
47
|
+
});
|
|
36
48
|
}
|
|
37
49
|
};
|
|
38
50
|
}
|
|
@@ -19,21 +19,21 @@ export declare class ChatContextInternal<TActionState extends IActionState, TAct
|
|
|
19
19
|
* @param text Message contents.
|
|
20
20
|
* @param options Message sending option.
|
|
21
21
|
*/
|
|
22
|
-
text: (text: string, options?: TextMessageSendingOptions) => import("../..").
|
|
22
|
+
text: (text: string, options?: TextMessageSendingOptions) => import("../..").IPostSendOperationController;
|
|
23
23
|
/**
|
|
24
24
|
* Sends image message to chat after action execution is finished.
|
|
25
25
|
* If multiple responses are sent, they will be sent in the order they were added, with delay of at least 35ms as per Telegram rate-limit.
|
|
26
26
|
* @param name Message contents.
|
|
27
27
|
* @param options Message sending option.
|
|
28
28
|
*/
|
|
29
|
-
image: (name: string) => import("../..").
|
|
29
|
+
image: (name: string) => import("../..").IPostSendOperationController;
|
|
30
30
|
/**
|
|
31
31
|
* Sends video/gif message to chat after action execution is finished.
|
|
32
32
|
* If multiple responses are sent, they will be sent in the order they were added, with delay of at least 35ms as per Telegram rate-limit.
|
|
33
33
|
* @param name Message contents.
|
|
34
34
|
* @param options Message sending option.
|
|
35
35
|
*/
|
|
36
|
-
video: (name: string) => import("../..").
|
|
36
|
+
video: (name: string) => import("../..").IPostSendOperationController;
|
|
37
37
|
};
|
|
38
38
|
/**
|
|
39
39
|
* Unpins message after action execution is finished.
|
|
@@ -23,7 +23,7 @@ export class ChatContextInternal extends BaseContextInternal {
|
|
|
23
23
|
text: (text, options) => {
|
|
24
24
|
const response = new TextMessage(text, this.chatInfo, this.observability.traceId, this.action, undefined, options);
|
|
25
25
|
this.responses.push(response);
|
|
26
|
-
return this.
|
|
26
|
+
return this.createPostSendOperationController(response);
|
|
27
27
|
},
|
|
28
28
|
/**
|
|
29
29
|
* Sends image message to chat after action execution is finished.
|
|
@@ -34,7 +34,7 @@ export class ChatContextInternal extends BaseContextInternal {
|
|
|
34
34
|
image: (name) => {
|
|
35
35
|
const response = new ImageMessage({ source: resolve(`./content/${name}.png`) }, this.chatInfo, this.observability.traceId, this.action);
|
|
36
36
|
this.responses.push(response);
|
|
37
|
-
return this.
|
|
37
|
+
return this.createPostSendOperationController(response);
|
|
38
38
|
},
|
|
39
39
|
/**
|
|
40
40
|
* Sends video/gif message to chat after action execution is finished.
|
|
@@ -45,7 +45,7 @@ export class ChatContextInternal extends BaseContextInternal {
|
|
|
45
45
|
video: (name) => {
|
|
46
46
|
const response = new VideoMessage({ source: resolve(`./content/${name}.mp4`) }, this.chatInfo, this.observability.traceId, this.action);
|
|
47
47
|
this.responses.push(response);
|
|
48
|
-
return this.
|
|
48
|
+
return this.createPostSendOperationController(response);
|
|
49
49
|
}
|
|
50
50
|
};
|
|
51
51
|
/**
|
|
@@ -49,21 +49,21 @@ export declare class MessageContextInternal<TActionState extends IActionState> e
|
|
|
49
49
|
* @param text Message contents.
|
|
50
50
|
* @param options Message sending option.
|
|
51
51
|
*/
|
|
52
|
-
withText: (text: string, quote?: string, options?: TextMessageSendingOptions) => import("../..").
|
|
52
|
+
withText: (text: string, quote?: string, options?: TextMessageSendingOptions) => import("../..").IPostSendOperationController;
|
|
53
53
|
/**
|
|
54
54
|
* Reply with image message to message that triggered this action after action execution is finished.
|
|
55
55
|
* If multiple responses are sent, they will be sent in the order they were added, with delay of at least 35ms as per Telegram rate-limit.
|
|
56
56
|
* @param text Message contents.
|
|
57
57
|
* @param options Message sending option.
|
|
58
58
|
*/
|
|
59
|
-
withImage: (name: string, quote?: string) => import("../..").
|
|
59
|
+
withImage: (name: string, quote?: string) => import("../..").IPostSendOperationController;
|
|
60
60
|
/**
|
|
61
61
|
* Reply with video/gif message to message that triggered this action after action execution is finished.
|
|
62
62
|
* If multiple responses are sent, they will be sent in the order they were added, with delay of at least 35ms as per Telegram rate-limit.
|
|
63
63
|
* @param text Message contents.
|
|
64
64
|
* @param options Message sending option.
|
|
65
65
|
*/
|
|
66
|
-
withVideo: (name: string, quote?: string) => import("../..").
|
|
66
|
+
withVideo: (name: string, quote?: string) => import("../..").IPostSendOperationController;
|
|
67
67
|
};
|
|
68
68
|
/**
|
|
69
69
|
* Reply with text message to message that triggered this action after action execution is finished.
|
|
@@ -71,21 +71,21 @@ export declare class MessageContextInternal<TActionState extends IActionState> e
|
|
|
71
71
|
* @param text Message contents.
|
|
72
72
|
* @param options Message sending option.
|
|
73
73
|
*/
|
|
74
|
-
withText: (text: string, options?: TextMessageSendingOptions) => import("../..").
|
|
74
|
+
withText: (text: string, options?: TextMessageSendingOptions) => import("../..").IPostSendOperationController;
|
|
75
75
|
/**
|
|
76
76
|
* Reply with image message to message that triggered this action after action execution is finished.
|
|
77
77
|
* If multiple responses are sent, they will be sent in the order they were added, with delay of at least 35ms as per Telegram rate-limit.
|
|
78
78
|
* @param text Message contents.
|
|
79
79
|
* @param options Message sending option.
|
|
80
80
|
*/
|
|
81
|
-
withImage: (name: string) => import("../..").
|
|
81
|
+
withImage: (name: string) => import("../..").IPostSendOperationController;
|
|
82
82
|
/**
|
|
83
83
|
* Reply with video/gif message to message that triggered this action after action execution is finished.
|
|
84
84
|
* If multiple responses are sent, they will be sent in the order they were added, with delay of at least 35ms as per Telegram rate-limit.
|
|
85
85
|
* @param text Message contents.
|
|
86
86
|
* @param options Message sending option.
|
|
87
87
|
*/
|
|
88
|
-
withVideo: (name: string) => import("../..").
|
|
88
|
+
withVideo: (name: string) => import("../..").IPostSendOperationController;
|
|
89
89
|
/**
|
|
90
90
|
* React to the message that triggered this action after action execution is finished.
|
|
91
91
|
* If multiple responses are sent, they will be sent in the order they were added, with delay of at least 35ms as per Telegram rate-limit.
|
|
@@ -37,19 +37,19 @@ export class MessageContextInternal extends ChatContextInternal {
|
|
|
37
37
|
const quotedPart = getQuotedText(this, quote);
|
|
38
38
|
const response = new TextMessage(text, this.chatInfo, this.observability.traceId, this.action, new ReplyInfo(this.messageInfo.id, quote ? quotedPart : undefined), options);
|
|
39
39
|
this.responses.push(response);
|
|
40
|
-
return this.
|
|
40
|
+
return this.createPostSendOperationController(response);
|
|
41
41
|
}
|
|
42
42
|
replyWithImage(name, quote) {
|
|
43
43
|
const quotedPart = getQuotedText(this, quote);
|
|
44
44
|
const response = new ImageMessage({ source: resolve(`./content/${name}.png`) }, this.chatInfo, this.observability.traceId, this.action, new ReplyInfo(this.messageInfo.id, quote ? quotedPart : undefined));
|
|
45
45
|
this.responses.push(response);
|
|
46
|
-
return this.
|
|
46
|
+
return this.createPostSendOperationController(response);
|
|
47
47
|
}
|
|
48
48
|
replyWithVideo(name, quote) {
|
|
49
49
|
const quotedPart = getQuotedText(this, quote);
|
|
50
50
|
const response = new VideoMessage({ source: resolve(`./content/${name}.mp4`) }, this.chatInfo, this.observability.traceId, this.action, new ReplyInfo(this.messageInfo.id, quote ? quotedPart : undefined));
|
|
51
51
|
this.responses.push(response);
|
|
52
|
-
return this.
|
|
52
|
+
return this.createPostSendOperationController(response);
|
|
53
53
|
}
|
|
54
54
|
skipCooldown() {
|
|
55
55
|
this.startCooldown = false;
|
|
@@ -44,21 +44,21 @@ export declare class ReplyContextInternal<TParentActionState extends IActionStat
|
|
|
44
44
|
* @param text Message contents.
|
|
45
45
|
* @param options Message sending option.
|
|
46
46
|
*/
|
|
47
|
-
withText: (text: string, quote?: string, options?: TextMessageSendingOptions) => import("../..").
|
|
47
|
+
withText: (text: string, quote?: string, options?: TextMessageSendingOptions) => import("../..").IPostSendOperationController;
|
|
48
48
|
/**
|
|
49
49
|
* Reply with image message to message that triggered this action after action execution is finished.
|
|
50
50
|
* If multiple responses are sent, they will be sent in the order they were added, with delay of at least 35ms as per Telegram rate-limit.
|
|
51
51
|
* @param text Message contents.
|
|
52
52
|
* @param options Message sending option.
|
|
53
53
|
*/
|
|
54
|
-
withImage: (name: string, quote?: string) => import("../..").
|
|
54
|
+
withImage: (name: string, quote?: string) => import("../..").IPostSendOperationController;
|
|
55
55
|
/**
|
|
56
56
|
* Reply with video/gif message to message that triggered this action after action execution is finished.
|
|
57
57
|
* If multiple responses are sent, they will be sent in the order they were added, with delay of at least 35ms as per Telegram rate-limit.
|
|
58
58
|
* @param text Message contents.
|
|
59
59
|
* @param options Message sending option.
|
|
60
60
|
*/
|
|
61
|
-
withVideo: (name: string, quote?: string) => import("../..").
|
|
61
|
+
withVideo: (name: string, quote?: string) => import("../..").IPostSendOperationController;
|
|
62
62
|
};
|
|
63
63
|
/**
|
|
64
64
|
* Reply with text message to message that triggered this action after action execution is finished.
|
|
@@ -66,21 +66,21 @@ export declare class ReplyContextInternal<TParentActionState extends IActionStat
|
|
|
66
66
|
* @param text Message contents.
|
|
67
67
|
* @param options Message sending option.
|
|
68
68
|
*/
|
|
69
|
-
withText: (text: string, options?: TextMessageSendingOptions) => import("../..").
|
|
69
|
+
withText: (text: string, options?: TextMessageSendingOptions) => import("../..").IPostSendOperationController;
|
|
70
70
|
/**
|
|
71
71
|
* Reply with image message to message that triggered this action after action execution is finished.
|
|
72
72
|
* If multiple responses are sent, they will be sent in the order they were added, with delay of at least 35ms as per Telegram rate-limit.
|
|
73
73
|
* @param text Message contents.
|
|
74
74
|
* @param options Message sending option.
|
|
75
75
|
*/
|
|
76
|
-
withImage: (name: string) => import("../..").
|
|
76
|
+
withImage: (name: string) => import("../..").IPostSendOperationController;
|
|
77
77
|
/**
|
|
78
78
|
* Reply with video/gif message to message that triggered this action after action execution is finished.
|
|
79
79
|
* If multiple responses are sent, they will be sent in the order they were added, with delay of at least 35ms as per Telegram rate-limit.
|
|
80
80
|
* @param text Message contents.
|
|
81
81
|
* @param options Message sending option.
|
|
82
82
|
*/
|
|
83
|
-
withVideo: (name: string) => import("../..").
|
|
83
|
+
withVideo: (name: string) => import("../..").IPostSendOperationController;
|
|
84
84
|
/**
|
|
85
85
|
* React to the message that triggered this action after action execution is finished.
|
|
86
86
|
* If multiple responses are sent, they will be sent in the order they were added, with delay of at least 35ms as per Telegram rate-limit.
|
|
@@ -33,19 +33,19 @@ export class ReplyContextInternal extends BaseContextInternal {
|
|
|
33
33
|
const quotedPart = getQuotedText(this, quote);
|
|
34
34
|
const response = new TextMessage(text, this.chatInfo, this.observability.traceId, this.action, new ReplyInfo(this.messageInfo.id, quote ? quotedPart : undefined), options);
|
|
35
35
|
this.responses.push(response);
|
|
36
|
-
return this.
|
|
36
|
+
return this.createPostSendOperationController(response);
|
|
37
37
|
}
|
|
38
38
|
replyWithImage(name, quote) {
|
|
39
39
|
const quotedPart = getQuotedText(this, quote);
|
|
40
40
|
const response = new ImageMessage({ source: resolve(`./content/${name}.png`) }, this.chatInfo, this.observability.traceId, this.action, new ReplyInfo(this.messageInfo.id, quote ? quotedPart : undefined));
|
|
41
41
|
this.responses.push(response);
|
|
42
|
-
return this.
|
|
42
|
+
return this.createPostSendOperationController(response);
|
|
43
43
|
}
|
|
44
44
|
replyWithVideo(name, quote) {
|
|
45
45
|
const quotedPart = getQuotedText(this, quote);
|
|
46
46
|
const response = new VideoMessage({ source: resolve(`./content/${name}.mp4`) }, this.chatInfo, this.observability.traceId, this.action, new ReplyInfo(this.messageInfo.id, quote ? quotedPart : undefined));
|
|
47
47
|
this.responses.push(response);
|
|
48
|
-
return this.
|
|
48
|
+
return this.createPostSendOperationController(response);
|
|
49
49
|
}
|
|
50
50
|
/**
|
|
51
51
|
* Stops capturing replies and removes this action
|
|
@@ -6,6 +6,6 @@ type KeyedWriteableCollection<K, V> = KeyedReadonlyCollection<K, V> & {
|
|
|
6
6
|
};
|
|
7
7
|
export declare function getOrCreateIfNotExists<K, V>(map: KeyedWriteableCollection<K, V>, key: K, fallbackFactory: () => V): V;
|
|
8
8
|
export declare function getOrSetIfNotExists<K, V>(map: KeyedWriteableCollection<K, V>, key: K, fallback: V): V;
|
|
9
|
-
export declare function getOrThrow<K, V>(map: KeyedReadonlyCollection<K, V>, key: K, error?: string):
|
|
9
|
+
export declare function getOrThrow<K, V>(map: KeyedReadonlyCollection<K, V>, key: K, error?: string): V & ({} | null);
|
|
10
10
|
export {};
|
|
11
11
|
//# sourceMappingURL=mapUtils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapUtils.d.ts","sourceRoot":"","sources":["../../src/helpers/mapUtils.ts"],"names":[],"mappings":"AAAA,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI;IAAE,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,SAAS,CAAA;CAAE,CAAC;AACxE,KAAK,wBAAwB,CAAC,CAAC,EAAE,CAAC,IAAI,uBAAuB,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;IAClE,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,KAAK,wBAAwB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;CAC7D,CAAC;AAEF,wBAAgB,sBAAsB,CAAC,CAAC,EAAE,CAAC,EACvC,GAAG,EAAE,wBAAwB,CAAC,CAAC,EAAE,CAAC,CAAC,EACnC,GAAG,EAAE,CAAC,EACN,eAAe,EAAE,MAAM,CAAC,KAS3B;AAED,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,CAAC,EACpC,GAAG,EAAE,wBAAwB,CAAC,CAAC,EAAE,CAAC,CAAC,EACnC,GAAG,EAAE,CAAC,EACN,QAAQ,EAAE,CAAC,KAQd;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,CAAC,EAC3B,GAAG,EAAE,uBAAuB,CAAC,CAAC,EAAE,CAAC,CAAC,EAClC,GAAG,EAAE,CAAC,EACN,KAAK,GAAE,MAAsC,
|
|
1
|
+
{"version":3,"file":"mapUtils.d.ts","sourceRoot":"","sources":["../../src/helpers/mapUtils.ts"],"names":[],"mappings":"AAAA,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI;IAAE,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,SAAS,CAAA;CAAE,CAAC;AACxE,KAAK,wBAAwB,CAAC,CAAC,EAAE,CAAC,IAAI,uBAAuB,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;IAClE,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,KAAK,wBAAwB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;CAC7D,CAAC;AAEF,wBAAgB,sBAAsB,CAAC,CAAC,EAAE,CAAC,EACvC,GAAG,EAAE,wBAAwB,CAAC,CAAC,EAAE,CAAC,CAAC,EACnC,GAAG,EAAE,CAAC,EACN,eAAe,EAAE,MAAM,CAAC,KAS3B;AAED,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,CAAC,EACpC,GAAG,EAAE,wBAAwB,CAAC,CAAC,EAAE,CAAC,CAAC,EACnC,GAAG,EAAE,CAAC,EACN,QAAQ,EAAE,CAAC,KAQd;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,CAAC,EAC3B,GAAG,EAAE,uBAAuB,CAAC,CAAC,EAAE,CAAC,CAAC,EAClC,GAAG,EAAE,CAAC,EACN,KAAK,GAAE,MAAsC,mBAMhD"}
|
package/dist/helpers/mapUtils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export function getOrCreateIfNotExists(map, key, fallbackFactory) {
|
|
2
2
|
const existingValue = map.get(key);
|
|
3
|
-
if (existingValue)
|
|
3
|
+
if (existingValue !== undefined)
|
|
4
4
|
return existingValue;
|
|
5
5
|
const fallback = fallbackFactory();
|
|
6
6
|
map.set(key, fallback);
|
|
@@ -8,14 +8,14 @@ export function getOrCreateIfNotExists(map, key, fallbackFactory) {
|
|
|
8
8
|
}
|
|
9
9
|
export function getOrSetIfNotExists(map, key, fallback) {
|
|
10
10
|
const existingValue = map.get(key);
|
|
11
|
-
if (existingValue)
|
|
11
|
+
if (existingValue !== undefined)
|
|
12
12
|
return existingValue;
|
|
13
13
|
map.set(key, fallback);
|
|
14
14
|
return fallback;
|
|
15
15
|
}
|
|
16
16
|
export function getOrThrow(map, key, error = 'Key not found in collection') {
|
|
17
17
|
const existingValue = map.get(key);
|
|
18
|
-
if (existingValue)
|
|
18
|
+
if (existingValue !== undefined)
|
|
19
19
|
return existingValue;
|
|
20
20
|
throw new Error(error);
|
|
21
21
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export * from './types/action';
|
|
|
10
10
|
export * from './types/externalAliases';
|
|
11
11
|
export * from './types/storage';
|
|
12
12
|
export * from './types/scheduler';
|
|
13
|
+
export * from './types/postSendOperations';
|
|
13
14
|
export { CommandAction } from './entities/actions/commandAction';
|
|
14
15
|
export { InlineQueryAction } from './entities/actions/inlineQueryAction';
|
|
15
16
|
export { ReplyCaptureAction } from './entities/actions/replyCaptureAction';
|
|
@@ -19,7 +20,6 @@ export { ChatContext } from './entities/context/chatContext';
|
|
|
19
20
|
export { InlineQueryContext } from './entities/context/inlineQueryContext';
|
|
20
21
|
export { MessageContext } from './entities/context/messageContext';
|
|
21
22
|
export { ReplyContext } from './entities/context/replyContext';
|
|
22
|
-
export { ICaptureController } from './types/capture';
|
|
23
23
|
export { ChatInfo } from './dtos/chatInfo';
|
|
24
24
|
export { MessageInfo } from './dtos/messageInfo';
|
|
25
25
|
export { UserInfo } from './dtos/userInfo';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,6CAA6C,CAAC;AAC5D,cAAc,yCAAyC,CAAC;AACxD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,qBAAqB,CAAC;AACpC,cAAc,mCAAmC,CAAC;AAClD,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBA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AAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EACH,YAAY,EACZ,WAAW,IAAI,oBAAoB,EACnC,iBAAiB,EACjB,QAAQ,EACR,YAAY,EACf,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -10,6 +10,7 @@ export * from './types/action';
|
|
|
10
10
|
export * from './types/externalAliases';
|
|
11
11
|
export * from './types/storage';
|
|
12
12
|
export * from './types/scheduler';
|
|
13
|
+
export * from './types/postSendOperations';
|
|
13
14
|
export { CommandAction } from './entities/actions/commandAction';
|
|
14
15
|
export { InlineQueryAction } from './entities/actions/inlineQueryAction';
|
|
15
16
|
export { ReplyCaptureAction } from './entities/actions/replyCaptureAction';
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { CommandAction } from '../../entities/actions/commandAction';
|
|
2
2
|
import { IActionState } from '../../types/actionState';
|
|
3
3
|
import { TelegramApiService } from '../telegramApi';
|
|
4
|
-
import { IReplyCapture } from '../../types/capture';
|
|
5
4
|
import { ChatInfo } from '../../dtos/chatInfo';
|
|
6
5
|
import { BaseActionProcessor } from './baseProcessor';
|
|
7
6
|
import { BotInfo, TelegramBot } from '../../types/externalAliases';
|
|
8
7
|
import { TraceId } from '../../types/trace';
|
|
8
|
+
import { ReplyCapture } from '../../types/postSendOperations';
|
|
9
9
|
export declare class CommandActionProcessor extends BaseActionProcessor {
|
|
10
|
-
private static readonly
|
|
10
|
+
private static readonly fallbackFactoryForChatHistory;
|
|
11
|
+
private static readonly fallbackFactoryForCaptures;
|
|
11
12
|
private readonly replyCaptures;
|
|
12
13
|
private readonly chatHistory;
|
|
13
14
|
private botInfo;
|
|
14
15
|
private commands;
|
|
15
16
|
initialize(api: TelegramApiService, telegram: TelegramBot, commands: CommandAction<IActionState>[], botInfo: BotInfo): void;
|
|
16
|
-
captureRegistrationCallback(capture:
|
|
17
|
+
captureRegistrationCallback(capture: ReplyCapture, parentMessageId: number, chatInfo: ChatInfo, traceId: TraceId): void;
|
|
17
18
|
private updateChatHistory;
|
|
18
19
|
private processCommand;
|
|
19
20
|
private processReply;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commandActionProcessor.d.ts","sourceRoot":"","sources":["../../../src/services/actionProcessors/commandActionProcessor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAIrE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"commandActionProcessor.d.ts","sourceRoot":"","sources":["../../../src/services/actionProcessors/commandActionProcessor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAIrE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAM/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAGtD,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAEnE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAE9D,qBAAa,sBAAuB,SAAQ,mBAAmB;IAC3D,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,6BAA6B,CACxC;IACb,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,0BAA0B,CACrC;IAEb,OAAO,CAAC,QAAQ,CAAC,aAAa,CAG1B;IACJ,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA2C;IACvE,OAAO,CAAC,OAAO,CAAW;IAE1B,OAAO,CAAC,QAAQ,CAKd;IAEF,UAAU,CACN,GAAG,EAAE,kBAAkB,EACvB,QAAQ,EAAE,WAAW,EACrB,QAAQ,EAAE,aAAa,CAAC,YAAY,CAAC,EAAE,EACvC,OAAO,EAAE,OAAO;IAoDpB,2BAA2B,CACvB,OAAO,EAAE,YAAY,EACrB,eAAe,EAAE,MAAM,EACvB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO;IAmDpB,OAAO,CAAC,iBAAiB;YA0BX,cAAc;YAwBd,YAAY;YAwBZ,sBAAsB;CAuCvC"}
|
|
@@ -10,8 +10,9 @@ import { ChatHistoryMessage } from '../../dtos/chatHistoryMessage';
|
|
|
10
10
|
import { BotEventType } from '../../types/events';
|
|
11
11
|
import { MESSAGE_HISTORY_LENGTH_LIMIT } from '../../helpers/constants';
|
|
12
12
|
export class CommandActionProcessor extends BaseActionProcessor {
|
|
13
|
-
static
|
|
14
|
-
|
|
13
|
+
static fallbackFactoryForChatHistory = () => [];
|
|
14
|
+
static fallbackFactoryForCaptures = () => [];
|
|
15
|
+
replyCaptures = new Map();
|
|
15
16
|
chatHistory = new Map();
|
|
16
17
|
botInfo;
|
|
17
18
|
commands = typeSafeObjectFromEntries(Object.values(MessageType).map((x) => [
|
|
@@ -35,7 +36,7 @@ export class CommandActionProcessor extends BaseActionProcessor {
|
|
|
35
36
|
}
|
|
36
37
|
if (commands.length > 0) {
|
|
37
38
|
telegram.on('message', ({ message }) => {
|
|
38
|
-
const internalMessage = new IncomingMessage(message, this.botName, getOrCreateIfNotExists(this.chatHistory, message.chat.id, CommandActionProcessor.
|
|
39
|
+
const internalMessage = new IncomingMessage(message, this.botName, getOrCreateIfNotExists(this.chatHistory, message.chat.id, CommandActionProcessor.fallbackFactoryForChatHistory));
|
|
39
40
|
this.eventEmitter.emit(BotEventType.messageRecieved, {
|
|
40
41
|
botInfo: this.botInfo,
|
|
41
42
|
message: internalMessage,
|
|
@@ -52,12 +53,16 @@ export class CommandActionProcessor extends BaseActionProcessor {
|
|
|
52
53
|
chatInfo,
|
|
53
54
|
traceId
|
|
54
55
|
});
|
|
55
|
-
this.replyCaptures.
|
|
56
|
+
const chatCaptures = getOrCreateIfNotExists(this.replyCaptures, chatInfo.id, CommandActionProcessor.fallbackFactoryForCaptures);
|
|
57
|
+
chatCaptures.push(replyAction);
|
|
56
58
|
capture.abortController.signal.addEventListener('abort', () => {
|
|
57
|
-
const
|
|
59
|
+
const chatCaptures = this.replyCaptures.get(chatInfo.id);
|
|
60
|
+
if (!chatCaptures)
|
|
61
|
+
return;
|
|
62
|
+
const capturesWithController = chatCaptures.filter((x) => x.abortController == capture.abortController);
|
|
58
63
|
for (const captureToCancel of capturesWithController) {
|
|
59
|
-
const index =
|
|
60
|
-
|
|
64
|
+
const index = chatCaptures.indexOf(captureToCancel);
|
|
65
|
+
chatCaptures.splice(index, 1);
|
|
61
66
|
this.eventEmitter.emit(BotEventType.commandActionCaptureAborted, {
|
|
62
67
|
parentMessageId,
|
|
63
68
|
chatInfo,
|
|
@@ -67,36 +72,30 @@ export class CommandActionProcessor extends BaseActionProcessor {
|
|
|
67
72
|
}, { once: true });
|
|
68
73
|
}
|
|
69
74
|
updateChatHistory(msg) {
|
|
70
|
-
const chatHistoryArray = getOrCreateIfNotExists(this.chatHistory, msg.chatInfo.id, CommandActionProcessor.
|
|
71
|
-
|
|
72
|
-
chatHistoryArray.
|
|
75
|
+
const chatHistoryArray = getOrCreateIfNotExists(this.chatHistory, msg.chatInfo.id, CommandActionProcessor.fallbackFactoryForChatHistory);
|
|
76
|
+
if (chatHistoryArray.length >= MESSAGE_HISTORY_LENGTH_LIMIT)
|
|
77
|
+
chatHistoryArray.splice(0, chatHistoryArray.length - MESSAGE_HISTORY_LENGTH_LIMIT + 1);
|
|
73
78
|
chatHistoryArray.push(new ChatHistoryMessage(msg.messageId, msg.from, msg.text, msg.type, msg.traceId, msg.replyToMessageId, msg.updateObject.date));
|
|
74
79
|
}
|
|
75
80
|
async processCommand(command, msg) {
|
|
76
81
|
const ctx = new MessageContextInternal(this.storage, this.scheduler, this.eventEmitter, command, msg, this.botName, this.botInfo);
|
|
77
82
|
const { proxy, revoke } = Proxy.revocable(ctx, {});
|
|
78
|
-
let responses = undefined;
|
|
79
83
|
try {
|
|
80
|
-
|
|
84
|
+
await this.executeAction(command, proxy);
|
|
81
85
|
}
|
|
82
86
|
finally {
|
|
83
|
-
|
|
84
|
-
this.api.flushResponses();
|
|
85
|
-
}
|
|
87
|
+
this.api.flushResponses();
|
|
86
88
|
revoke();
|
|
87
89
|
}
|
|
88
90
|
}
|
|
89
91
|
async processReply(capture, msg) {
|
|
90
92
|
const ctx = new ReplyContextInternal(this.storage, this.scheduler, this.eventEmitter, capture, msg, this.botName, this.botInfo);
|
|
91
93
|
const { proxy, revoke } = Proxy.revocable(ctx, {});
|
|
92
|
-
let responses = undefined;
|
|
93
94
|
try {
|
|
94
|
-
|
|
95
|
+
await this.executeAction(capture, proxy);
|
|
95
96
|
}
|
|
96
97
|
finally {
|
|
97
|
-
|
|
98
|
-
this.api.flushResponses();
|
|
99
|
-
}
|
|
98
|
+
this.api.flushResponses();
|
|
100
99
|
revoke();
|
|
101
100
|
}
|
|
102
101
|
}
|
|
@@ -115,7 +114,8 @@ export class CommandActionProcessor extends BaseActionProcessor {
|
|
|
115
114
|
for (const command of commandsToCheck) {
|
|
116
115
|
actionPromises.push(this.processCommand(command, msg));
|
|
117
116
|
}
|
|
118
|
-
|
|
117
|
+
const chatCaptures = getOrCreateIfNotExists(this.replyCaptures, msg.chatInfo.id, CommandActionProcessor.fallbackFactoryForCaptures);
|
|
118
|
+
for (const capture of chatCaptures) {
|
|
119
119
|
actionPromises.push(this.processReply(capture, msg));
|
|
120
120
|
}
|
|
121
121
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodeTimeoutScheduler.d.ts","sourceRoot":"","sources":["../../src/services/nodeTimeoutScheduler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,OAAO,EAAgB,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,qBAAa,oBAAqB,YAAW,UAAU;IAI/C,QAAQ,CAAC,YAAY,EAAE,iBAAiB;IACxC,QAAQ,CAAC,OAAO,EAAE,MAAM;IAJ5B,QAAQ,CAAC,WAAW,EAAE,UAAU,EAAE,CAAM;gBAG3B,YAAY,EAAE,iBAAiB,EAC/B,OAAO,EAAE,MAAM;IAG5B,OAAO;IAQP,UAAU,CACN,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,OAAO,EACrB,QAAQ,EAAE,YAAY,EACtB,gBAAgB,EAAE,OAAO,EACzB,SAAS,EAAE,MAAM;IA4BrB,iBAAiB,CACb,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,OAAO,EACrB,KAAK,EAAE,YAAY,EACnB,SAAS,EAAE,MAAM;
|
|
1
|
+
{"version":3,"file":"nodeTimeoutScheduler.d.ts","sourceRoot":"","sources":["../../src/services/nodeTimeoutScheduler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,OAAO,EAAgB,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,qBAAa,oBAAqB,YAAW,UAAU;IAI/C,QAAQ,CAAC,YAAY,EAAE,iBAAiB;IACxC,QAAQ,CAAC,OAAO,EAAE,MAAM;IAJ5B,QAAQ,CAAC,WAAW,EAAE,UAAU,EAAE,CAAM;gBAG3B,YAAY,EAAE,iBAAiB,EAC/B,OAAO,EAAE,MAAM;IAG5B,OAAO;IAQP,UAAU,CACN,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,OAAO,EACrB,QAAQ,EAAE,YAAY,EACtB,gBAAgB,EAAE,OAAO,EACzB,SAAS,EAAE,MAAM;IA4BrB,iBAAiB,CACb,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,OAAO,EACrB,KAAK,EAAE,YAAY,EACnB,SAAS,EAAE,MAAM;CA2BxB"}
|
|
@@ -49,7 +49,12 @@ export class NodeTimeoutScheduler {
|
|
|
49
49
|
});
|
|
50
50
|
action();
|
|
51
51
|
};
|
|
52
|
-
setTimeout(
|
|
52
|
+
const handle = setTimeout(() => {
|
|
53
|
+
this.activeTasks.splice(this.activeTasks.indexOf(task), 1);
|
|
54
|
+
actionWrapper();
|
|
55
|
+
}, delay);
|
|
56
|
+
const task = new TaskRecord(name, handle, delay, traceId);
|
|
57
|
+
this.activeTasks.push(task);
|
|
53
58
|
this.eventEmitter.emit(BotEventType.taskCreated, {
|
|
54
59
|
name,
|
|
55
60
|
ownerName,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IStorageClient } from '../types/storage';
|
|
2
2
|
import { BotResponse } from '../types/response';
|
|
3
|
-
import {
|
|
3
|
+
import { ReplyCapture } from '../types/postSendOperations';
|
|
4
4
|
import { TraceId } from '../types/trace';
|
|
5
5
|
import { ChatInfo } from '../dtos/chatInfo';
|
|
6
6
|
import { TelegramApiClient } from '../types/externalAliases';
|
|
@@ -13,7 +13,7 @@ export declare class TelegramApiService {
|
|
|
13
13
|
private readonly captureRegistrationCallback;
|
|
14
14
|
private readonly TELEGRAM_API_SERVICE_ERROR_TRACEID;
|
|
15
15
|
private readonly methodMap;
|
|
16
|
-
constructor(botName: string, telegram: TelegramApiClient, storage: IStorageClient, eventEmitter: TypedEventEmitter, captureRegistrationCallback: (capture:
|
|
16
|
+
constructor(botName: string, telegram: TelegramApiClient, storage: IStorageClient, eventEmitter: TypedEventEmitter, captureRegistrationCallback: (capture: ReplyCapture, parentMessageId: number, chatInfo: ChatInfo, traceId: TraceId) => void);
|
|
17
17
|
enqueueBatchedResponses(responses: BotResponse[]): void;
|
|
18
18
|
flushResponses(): void;
|
|
19
19
|
private processResponse;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"telegramApi.d.ts","sourceRoot":"","sources":["../../src/services/telegramApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAoB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"telegramApi.d.ts","sourceRoot":"","sources":["../../src/services/telegramApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAoB,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAE3D,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAmB,MAAM,0BAA0B,CAAC;AAC9E,OAAO,EAAgB,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AASlE,qBAAa,kBAAkB;IAC3B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAiC;IACvD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAoB;IAC7C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAiB;IACzC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAoB;IACjD,OAAO,CAAC,QAAQ,CAAC,2BAA2B,CAKlC;IAEV,OAAO,CAAC,QAAQ,CAAC,kCAAkC,CAAU;IAE7D,OAAO,CAAC,QAAQ,CAAC,SAAS,CAaxB;gBAGE,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,iBAAiB,EAC3B,OAAO,EAAE,cAAc,EACvB,YAAY,EAAE,iBAAiB,EAC/B,2BAA2B,EAAE,CACzB,OAAO,EAAE,YAAY,EACrB,eAAe,EAAE,MAAM,EACvB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,KACf,IAAI;IAcb,uBAAuB,CAAC,SAAS,EAAE,WAAW,EAAE;IA4DhD,cAAc;YAYA,eAAe;YAwCf,cAAc;CA6H/B"}
|
|
@@ -2,6 +2,9 @@ import { ResponseProcessingQueue } from './responseProcessingQueue';
|
|
|
2
2
|
import { BotEventType } from '../types/events';
|
|
3
3
|
import { createTrace } from '../helpers/traceFactory';
|
|
4
4
|
import { TELEGRAM_ERROR_QUOTE_INVALID } from '../helpers/constants';
|
|
5
|
+
import { setTimeout } from 'timers/promises';
|
|
6
|
+
import { DeleteMessageResponse } from '../dtos/responses/deleteMessage';
|
|
7
|
+
import { PinResponse } from '../dtos/responses/pin';
|
|
5
8
|
export class TelegramApiService {
|
|
6
9
|
queue = new ResponseProcessingQueue();
|
|
7
10
|
telegram;
|
|
@@ -17,6 +20,7 @@ export class TelegramApiService {
|
|
|
17
20
|
pin: 'pinChatMessage',
|
|
18
21
|
image: 'sendPhoto',
|
|
19
22
|
video: 'sendVideo',
|
|
23
|
+
deleteMessage: 'deleteMessage',
|
|
20
24
|
delay: null
|
|
21
25
|
};
|
|
22
26
|
constructor(botName, telegram, storage, eventEmitter, captureRegistrationCallback) {
|
|
@@ -87,8 +91,19 @@ export class TelegramApiService {
|
|
|
87
91
|
async processResponse(response) {
|
|
88
92
|
const sentMessage = await this.sendApiRequest(response);
|
|
89
93
|
if (sentMessage && 'content' in response) {
|
|
90
|
-
for (const
|
|
91
|
-
|
|
94
|
+
for (const operation of response.postSendOperations) {
|
|
95
|
+
switch (operation.kind) {
|
|
96
|
+
case 'captureReplies':
|
|
97
|
+
this.captureRegistrationCallback(operation, sentMessage.message_id, response.chatInfo, response.traceId);
|
|
98
|
+
break;
|
|
99
|
+
case 'deleteAfterTimeout':
|
|
100
|
+
await setTimeout(operation.timeout);
|
|
101
|
+
await this.sendApiRequest(new DeleteMessageResponse(sentMessage.message_id, response.chatInfo, response.traceId, response.action));
|
|
102
|
+
break;
|
|
103
|
+
case 'pin':
|
|
104
|
+
await this.sendApiRequest(new PinResponse(sentMessage.message_id, response.chatInfo, response.traceId, response.action));
|
|
105
|
+
break;
|
|
106
|
+
}
|
|
92
107
|
}
|
|
93
108
|
}
|
|
94
109
|
}
|
|
@@ -144,13 +159,18 @@ export class TelegramApiService {
|
|
|
144
159
|
return null;
|
|
145
160
|
case 'pin':
|
|
146
161
|
await this.telegram.pinChatMessage(response.chatInfo.id, response.messageId, { disable_notification: true });
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
162
|
+
if ('stateConstructor' in response.action) {
|
|
163
|
+
await this.storage.updateStateFor(response.action, response.chatInfo.id, (state) => {
|
|
164
|
+
state.pinnedMessages.push(response.messageId);
|
|
165
|
+
});
|
|
166
|
+
}
|
|
150
167
|
return null;
|
|
151
168
|
case 'inlineQuery':
|
|
152
169
|
await this.telegram.answerInlineQuery(response.queryId, response.queryResults, { cache_time: 0 });
|
|
153
170
|
return null;
|
|
171
|
+
case 'deleteMessage':
|
|
172
|
+
await this.telegram.deleteMessage(response.chatInfo.id, response.messageId);
|
|
173
|
+
return null;
|
|
154
174
|
case 'delay':
|
|
155
175
|
return null;
|
|
156
176
|
}
|
package/dist/types/events.d.ts
CHANGED
|
@@ -13,18 +13,18 @@ import { Milliseconds } from './timeValues';
|
|
|
13
13
|
import { TraceId } from './trace';
|
|
14
14
|
export declare const BotEventType: {
|
|
15
15
|
readonly error: "error.generic";
|
|
16
|
-
readonly messageRecieved: "message.
|
|
16
|
+
readonly messageRecieved: "message.received";
|
|
17
17
|
readonly messageProcessingStarted: "message.processingStarted";
|
|
18
18
|
readonly messageProcessingFinished: "message.processingFinished";
|
|
19
19
|
readonly commandActionExecuting: "command.actionExecuting";
|
|
20
20
|
readonly commandActionExecuted: "command.actionExecuted";
|
|
21
|
-
readonly commandActionCaptureStarted: "command.
|
|
22
|
-
readonly commandActionCaptureAborted: "command.
|
|
21
|
+
readonly commandActionCaptureStarted: "command.captureStarted";
|
|
22
|
+
readonly commandActionCaptureAborted: "command.captureAborted";
|
|
23
23
|
readonly replyActionExecuting: "reply.actionExecuting";
|
|
24
24
|
readonly replyActionExecuted: "reply.actionExecuted";
|
|
25
25
|
readonly inlineProcessingStarted: "inline.processingStarted";
|
|
26
26
|
readonly inlineProcessingFinished: "inline.processingFinished";
|
|
27
|
-
readonly inlineQueryRecieved: "inline.
|
|
27
|
+
readonly inlineQueryRecieved: "inline.queryReceived";
|
|
28
28
|
readonly inlineActionExecuting: "inline.actionExecuting";
|
|
29
29
|
readonly inlineActionExecuted: "inline.actionExecuted";
|
|
30
30
|
readonly inlineProcessingAborting: "inline.processingAborting";
|
package/dist/types/events.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
export const BotEventType = {
|
|
2
2
|
error: 'error.generic',
|
|
3
|
-
messageRecieved: 'message.
|
|
3
|
+
messageRecieved: 'message.received',
|
|
4
4
|
messageProcessingStarted: 'message.processingStarted',
|
|
5
5
|
messageProcessingFinished: 'message.processingFinished',
|
|
6
6
|
commandActionExecuting: 'command.actionExecuting',
|
|
7
7
|
commandActionExecuted: 'command.actionExecuted',
|
|
8
|
-
commandActionCaptureStarted: 'command.
|
|
9
|
-
commandActionCaptureAborted: 'command.
|
|
8
|
+
commandActionCaptureStarted: 'command.captureStarted',
|
|
9
|
+
commandActionCaptureAborted: 'command.captureAborted',
|
|
10
10
|
replyActionExecuting: 'reply.actionExecuting',
|
|
11
11
|
replyActionExecuted: 'reply.actionExecuted',
|
|
12
12
|
inlineProcessingStarted: 'inline.processingStarted',
|
|
13
13
|
inlineProcessingFinished: 'inline.processingFinished',
|
|
14
|
-
inlineQueryRecieved: 'inline.
|
|
14
|
+
inlineQueryRecieved: 'inline.queryReceived',
|
|
15
15
|
inlineActionExecuting: 'inline.actionExecuting',
|
|
16
16
|
inlineActionExecuted: 'inline.actionExecuted',
|
|
17
17
|
inlineProcessingAborting: 'inline.processingAborting',
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ReplyContext, ReplyContextInternal } from '../entities/context/replyContext';
|
|
2
|
+
import { IAction } from './action';
|
|
3
|
+
import { IActionState } from './actionState';
|
|
4
|
+
import { CommandTrigger } from './commandTrigger';
|
|
5
|
+
import { Milliseconds } from './timeValues';
|
|
6
|
+
export interface IPostSendOperationController {
|
|
7
|
+
/**
|
|
8
|
+
* Captures replies based on the specified trigger and handler.
|
|
9
|
+
* @param trigger Array of command triggers that will activate the handler.
|
|
10
|
+
* @param handler Callback function that will be called when a trigger is matched.
|
|
11
|
+
* @param abortController Optional abort controller to manually abort capturing.
|
|
12
|
+
*/
|
|
13
|
+
captureReplies: <TParentActionState extends IActionState>(trigger: CommandTrigger[], handler: (replyContext: ReplyContext<TParentActionState>) => Promise<void>, abortController?: AbortController) => void;
|
|
14
|
+
/**
|
|
15
|
+
* Pins the message associated with this response.
|
|
16
|
+
*/
|
|
17
|
+
pin: () => void;
|
|
18
|
+
/**
|
|
19
|
+
* Deletes the message associated with this response after the specified timeout.
|
|
20
|
+
* @param timeout Time in milliseconds after which the message will be deleted.
|
|
21
|
+
*/
|
|
22
|
+
deleteAfter: (timeout: number) => void;
|
|
23
|
+
}
|
|
24
|
+
export type PostSendOperation = DeleteAfterTimeout | ReplyCapture | Pin;
|
|
25
|
+
export type Pin = {
|
|
26
|
+
kind: 'pin';
|
|
27
|
+
};
|
|
28
|
+
export type DeleteAfterTimeout = {
|
|
29
|
+
kind: 'deleteAfterTimeout';
|
|
30
|
+
timeout: Milliseconds;
|
|
31
|
+
};
|
|
32
|
+
export type ReplyCapture = {
|
|
33
|
+
kind: 'captureReplies';
|
|
34
|
+
trigger: CommandTrigger[];
|
|
35
|
+
handler: (replyContext: ReplyContextInternal<IActionState>) => Promise<void>;
|
|
36
|
+
abortController: AbortController;
|
|
37
|
+
action: IAction;
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=postSendOperations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postSendOperations.d.ts","sourceRoot":"","sources":["../../src/types/postSendOperations.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,YAAY,EACZ,oBAAoB,EACvB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,WAAW,4BAA4B;IACzC;;;;;OAKG;IACH,cAAc,EAAE,CAAC,kBAAkB,SAAS,YAAY,EACpD,OAAO,EAAE,cAAc,EAAE,EACzB,OAAO,EAAE,CACL,YAAY,EAAE,YAAY,CAAC,kBAAkB,CAAC,KAC7C,OAAO,CAAC,IAAI,CAAC,EAClB,eAAe,CAAC,EAAE,eAAe,KAChC,IAAI,CAAC;IAEV;;OAEG;IACH,GAAG,EAAE,MAAM,IAAI,CAAC;IAEhB;;;OAGG;IACH,WAAW,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAC1C;AAED,MAAM,MAAM,iBAAiB,GAAG,kBAAkB,GAAG,YAAY,GAAG,GAAG,CAAC;AAExE,MAAM,MAAM,GAAG,GAAG;IACd,IAAI,EAAE,KAAK,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC7B,IAAI,EAAE,oBAAoB,CAAC;IAE3B,OAAO,EAAE,YAAY,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACvB,IAAI,EAAE,gBAAgB,CAAC;IAEvB,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,OAAO,EAAE,CACL,YAAY,EAAE,oBAAoB,CAAC,YAAY,CAAC,KAC/C,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB,eAAe,EAAE,eAAe,CAAC;IACjC,MAAM,EAAE,OAAO,CAAC;CACnB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/types/response.d.ts
CHANGED
|
@@ -6,11 +6,12 @@ import { Reaction } from '../dtos/responses/reaction';
|
|
|
6
6
|
import { TextMessage } from '../dtos/responses/textMessage';
|
|
7
7
|
import { UnpinResponse } from '../dtos/responses/unpin';
|
|
8
8
|
import { VideoMessage } from '../dtos/responses/videoMessage';
|
|
9
|
-
import { IReplyCapture } from './capture';
|
|
10
9
|
import { ReplyInfo } from '../dtos/replyInfo';
|
|
11
10
|
import { TraceId } from './trace';
|
|
12
11
|
import { IAction } from './action';
|
|
12
|
+
import { PostSendOperation } from './postSendOperations';
|
|
13
13
|
import { PinResponse } from '../dtos/responses/pin';
|
|
14
|
+
import { DeleteMessageResponse } from '../dtos/responses/deleteMessage';
|
|
14
15
|
export declare const BotResponseTypes: {
|
|
15
16
|
readonly pin: "pin";
|
|
16
17
|
readonly unpin: "unpin";
|
|
@@ -20,8 +21,9 @@ export declare const BotResponseTypes: {
|
|
|
20
21
|
readonly react: "react";
|
|
21
22
|
readonly delay: "delay";
|
|
22
23
|
readonly inlineQuery: "inlineQuery";
|
|
24
|
+
readonly deleteMessage: "deleteMessage";
|
|
23
25
|
};
|
|
24
|
-
export type BotResponse = UnpinResponse | Reaction | TextMessage | VideoMessage | DelayResponse | InlineQueryResponse | ImageMessage | PinResponse;
|
|
26
|
+
export type BotResponse = UnpinResponse | Reaction | TextMessage | VideoMessage | DelayResponse | InlineQueryResponse | ImageMessage | PinResponse | DeleteMessageResponse;
|
|
25
27
|
export interface IChatResponse {
|
|
26
28
|
readonly kind: keyof typeof BotResponseTypes;
|
|
27
29
|
readonly chatInfo: ChatInfo;
|
|
@@ -30,7 +32,7 @@ export interface IChatResponse {
|
|
|
30
32
|
readonly action: IAction;
|
|
31
33
|
}
|
|
32
34
|
export interface IReplyResponse extends IChatResponse {
|
|
33
|
-
readonly
|
|
35
|
+
readonly postSendOperations: PostSendOperation[];
|
|
34
36
|
readonly replyInfo: ReplyInfo | undefined;
|
|
35
37
|
readonly disableWebPreview: boolean;
|
|
36
38
|
get quotelessReply(): IReplyResponse;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../src/types/response.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../src/types/response.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,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