chz-telegram-bot 0.7.17 → 0.7.19
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/userInfo.d.ts +6 -6
- package/dist/dtos/userInfo.d.ts.map +1 -1
- package/dist/dtos/userInfo.js +2 -2
- package/dist/entities/actions/commandAction.d.ts.map +1 -1
- package/dist/entities/actions/commandAction.js +2 -1
- package/dist/entities/context/messageContext.d.ts +0 -1
- package/dist/entities/context/messageContext.d.ts.map +1 -1
- package/dist/entities/context/messageContext.js +5 -11
- package/dist/entities/context/replyContext.d.ts +0 -1
- package/dist/entities/context/replyContext.d.ts.map +1 -1
- package/dist/entities/context/replyContext.js +5 -11
- package/dist/helpers/getQuotedText.d.ts +8 -0
- package/dist/helpers/getQuotedText.d.ts.map +1 -0
- package/dist/helpers/getQuotedText.js +8 -0
- package/dist/services/actionProcessors/commandActionProcessor.d.ts.map +1 -1
- package/dist/services/actionProcessors/commandActionProcessor.js +10 -7
- package/dist/services/actionProcessors/inlineQueryActionProcessor.d.ts.map +1 -1
- package/dist/services/actionProcessors/inlineQueryActionProcessor.js +19 -2
- package/dist/services/actionProcessors/scheduledActionProcessor.d.ts.map +1 -1
- package/dist/services/actionProcessors/scheduledActionProcessor.js +11 -2
- package/dist/services/nodeTimeoutScheduler.d.ts.map +1 -1
- package/dist/services/nodeTimeoutScheduler.js +1 -0
- package/dist/services/responseProcessingQueue.d.ts +3 -3
- package/dist/services/responseProcessingQueue.d.ts.map +1 -1
- package/dist/services/responseProcessingQueue.js +4 -2
- package/dist/services/telegramApi.d.ts +1 -1
- package/dist/services/telegramApi.d.ts.map +1 -1
- package/dist/services/telegramApi.js +11 -3
- package/dist/types/events.d.ts +0 -7
- package/dist/types/events.d.ts.map +1 -1
- package/dist/types/events.js +0 -1
- package/package.json +1 -1
package/dist/dtos/userInfo.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export declare class UserInfo {
|
|
2
|
-
/** Id of a user that sent a message that triggered this action. */
|
|
3
|
-
readonly id: number;
|
|
4
|
-
/** Name of a user that sent a message that triggered this action. */
|
|
2
|
+
/** Id of a user that sent a message that triggered this action. `null` if the user is unknown. */
|
|
3
|
+
readonly id: number | null;
|
|
4
|
+
/** Name of a user that sent a message that triggered this action. `Unknown user` if the user is unknown. */
|
|
5
5
|
readonly name: string;
|
|
6
6
|
constructor(
|
|
7
|
-
/** Id of a user that sent a message that triggered this action. */
|
|
8
|
-
id: number,
|
|
9
|
-
/** Name of a user that sent a message that triggered this action. */
|
|
7
|
+
/** Id of a user that sent a message that triggered this action. `null` if the user is unknown. */
|
|
8
|
+
id: number | null,
|
|
9
|
+
/** Name of a user that sent a message that triggered this action. `Unknown user` if the user is unknown. */
|
|
10
10
|
name: string);
|
|
11
11
|
}
|
|
12
12
|
//# sourceMappingURL=userInfo.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userInfo.d.ts","sourceRoot":"","sources":["../../src/dtos/userInfo.ts"],"names":[],"mappings":"AAAA,qBAAa,QAAQ;IAEb,
|
|
1
|
+
{"version":3,"file":"userInfo.d.ts","sourceRoot":"","sources":["../../src/dtos/userInfo.ts"],"names":[],"mappings":"AAAA,qBAAa,QAAQ;IAEb,kGAAkG;IAClG,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAC1B,4GAA4G;IAC5G,QAAQ,CAAC,IAAI,EAAE,MAAM;;IAHrB,kGAAkG;IACzF,EAAE,EAAE,MAAM,GAAG,IAAI;IAC1B,4GAA4G;IACnG,IAAI,EAAE,MAAM;CAE5B"}
|
package/dist/dtos/userInfo.js
CHANGED
|
@@ -2,9 +2,9 @@ export class UserInfo {
|
|
|
2
2
|
id;
|
|
3
3
|
name;
|
|
4
4
|
constructor(
|
|
5
|
-
/** Id of a user that sent a message that triggered this action. */
|
|
5
|
+
/** Id of a user that sent a message that triggered this action. `null` if the user is unknown. */
|
|
6
6
|
id,
|
|
7
|
-
/** Name of a user that sent a message that triggered this action. */
|
|
7
|
+
/** Name of a user that sent a message that triggered this action. `Unknown user` if the user is unknown. */
|
|
8
8
|
name) {
|
|
9
9
|
this.id = id;
|
|
10
10
|
this.name = name;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commandAction.d.ts","sourceRoot":"","sources":["../../../src/entities/actions/commandAction.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAGhE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAG5D,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,YAAY,CAAC;AAO/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"commandAction.d.ts","sourceRoot":"","sources":["../../../src/entities/actions/commandAction.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAGhE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAG5D,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,YAAY,CAAC;AAO/C,OA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GAAG,EAAE,sBAAsB,CAAC,YAAY,CAAC,GAC1C,OAAO,CAAC,WAAW,EAAE,CAAC;IA2FzB,OAAO,CAAC,uBAAuB;IA6D/B,OAAO,CAAC,YAAY;CAwCvB"}
|
|
@@ -9,6 +9,7 @@ import { getOrSetIfNotExists } from '../../helpers/mapUtils';
|
|
|
9
9
|
import { TextMessage } from '../../dtos/responses/textMessage';
|
|
10
10
|
import { ReplyInfo } from '../../dtos/replyInfo';
|
|
11
11
|
import { BotEventType } from '../../types/events';
|
|
12
|
+
const REGEX_MATCH_LIMIT = 100;
|
|
12
13
|
export class CommandAction {
|
|
13
14
|
cooldownInfoProvider;
|
|
14
15
|
isActiveProvider;
|
|
@@ -132,9 +133,9 @@ export class CommandAction {
|
|
|
132
133
|
trigger.lastIndex = 0;
|
|
133
134
|
const execResult = trigger.exec(ctx.messageInfo.text);
|
|
134
135
|
if (execResult != null) {
|
|
135
|
-
let regexMatchLimit = 100;
|
|
136
136
|
matchResults.push(execResult);
|
|
137
137
|
if (trigger.global) {
|
|
138
|
+
let regexMatchLimit = REGEX_MATCH_LIMIT;
|
|
138
139
|
while (regexMatchLimit > 0) {
|
|
139
140
|
const nextResult = trigger.exec(ctx.messageInfo.text);
|
|
140
141
|
if (nextResult == null)
|
|
@@ -29,7 +29,6 @@ export declare class MessageContextInternal<TActionState extends IActionState> e
|
|
|
29
29
|
/** Collection of Regexp match results on a message that triggered this action. Will be empty if trigger is not a Regexp. */
|
|
30
30
|
matchResults: RegExpMatchArray[];
|
|
31
31
|
constructor(storage: IStorageClient, scheduler: IScheduler, eventEmitter: TypedEventEmitter, action: CommandAction<TActionState>, message: IncomingMessage, botName: string, botInfo: BotInfo);
|
|
32
|
-
private getQuotePart;
|
|
33
32
|
private replyWithText;
|
|
34
33
|
private replyWithImage;
|
|
35
34
|
private replyWithVideo;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messageContext.d.ts","sourceRoot":"","sources":["../../../src/entities/context/messageContext.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAKvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EACH,qBAAqB,EACrB,yBAAyB,EAC5B,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"messageContext.d.ts","sourceRoot":"","sources":["../../../src/entities/context/messageContext.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAKvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EACH,qBAAqB,EACrB,yBAAyB,EAC5B,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,O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WAGG;;YAEC;;;;;eAKG;6BAEO,MAAM,UACJ,MAAM,YACJ,yBAAyB;YAEvC;;;;;eAKG;8BAEO,MAAM,UACJ,MAAM,YACJ,qBAAqB;YAGnC;;;;;eAKG;8BAEO,MAAM,UACJ,MAAM,YACJ,qBAAqB;;QAIvC;;;;;WAKG;yBACc,MAAM,YAAY,yBAAyB;QAE5D;;;;;WAKG;0BACe,MAAM,YAAY,qBAAqB;QAGzD;;;;;WAKG;0BACe,MAAM,YAAY,qBAAqB;QAGzD;;;;WAIG;8BACmB,aAAa;MAWrC;CACL"}
|
|
@@ -7,6 +7,7 @@ import { ChatContextInternal } from './chatContext';
|
|
|
7
7
|
import { ReplyInfo } from '../../dtos/replyInfo';
|
|
8
8
|
import { MessageInfo } from '../../dtos/messageInfo';
|
|
9
9
|
import { UserInfo } from '../../dtos/userInfo';
|
|
10
|
+
import { getQuotedText } from '../../helpers/getQuotedText';
|
|
10
11
|
/**
|
|
11
12
|
* Context of action executed in chat, in response to a message
|
|
12
13
|
*/
|
|
@@ -26,31 +27,24 @@ export class MessageContextInternal extends ChatContextInternal {
|
|
|
26
27
|
constructor(storage, scheduler, eventEmitter, action, message, botName, botInfo) {
|
|
27
28
|
super(storage, scheduler, eventEmitter, action, message.chatInfo, message.traceId, botName);
|
|
28
29
|
this.messageInfo = new MessageInfo(message.messageId, message.text, message.type, message.updateObject);
|
|
29
|
-
this.userInfo = new UserInfo(message.from?.id ??
|
|
30
|
+
this.userInfo = new UserInfo(message.from?.id ?? null, (message.from?.first_name ?? 'Unknown user') +
|
|
30
31
|
(message.from?.last_name ? ` ${message.from.last_name}` : ''));
|
|
31
32
|
this.botInfo = botInfo;
|
|
32
33
|
}
|
|
33
|
-
getQuotePart(quote) {
|
|
34
|
-
if (typeof quote != 'boolean')
|
|
35
|
-
return quote;
|
|
36
|
-
return this.matchResults.length == 0
|
|
37
|
-
? this.messageInfo.text
|
|
38
|
-
: this.matchResults[0][1];
|
|
39
|
-
}
|
|
40
34
|
replyWithText(text, quote, options) {
|
|
41
|
-
const quotedPart = this
|
|
35
|
+
const quotedPart = getQuotedText(this, quote);
|
|
42
36
|
const response = new TextMessage(text, this.chatInfo, this.observability.traceId, this.action, new ReplyInfo(this.messageInfo.id, quote ? quotedPart : undefined), options);
|
|
43
37
|
this.responses.push(response);
|
|
44
38
|
return this.createCaptureController(response);
|
|
45
39
|
}
|
|
46
40
|
replyWithImage(name, quote, options) {
|
|
47
|
-
const quotedPart = this
|
|
41
|
+
const quotedPart = getQuotedText(this, quote);
|
|
48
42
|
const response = new ImageMessage({ source: resolve(`./content/${name}.png`) }, this.chatInfo, this.observability.traceId, this.action, new ReplyInfo(this.messageInfo.id, quote ? quotedPart : undefined), options);
|
|
49
43
|
this.responses.push(response);
|
|
50
44
|
return this.createCaptureController(response);
|
|
51
45
|
}
|
|
52
46
|
replyWithVideo(name, quote, options) {
|
|
53
|
-
const quotedPart = this
|
|
47
|
+
const quotedPart = getQuotedText(this, quote);
|
|
54
48
|
const response = new VideoMessage({ source: resolve(`./content/${name}.mp4`) }, this.chatInfo, this.observability.traceId, this.action, new ReplyInfo(this.messageInfo.id, quote ? quotedPart : undefined), options);
|
|
55
49
|
this.responses.push(response);
|
|
56
50
|
return this.createCaptureController(response);
|
|
@@ -22,7 +22,6 @@ export declare class ReplyContextInternal<TParentActionState extends IActionStat
|
|
|
22
22
|
/** Bot info from Telegram */
|
|
23
23
|
readonly botInfo: TelegramUser;
|
|
24
24
|
constructor(storage: IStorageClient, scheduler: IScheduler, eventEmitter: TypedEventEmitter, action: ReplyCaptureAction<TParentActionState>, message: IncomingMessage, botName: string, botInfo: BotInfo);
|
|
25
|
-
private getQuotePart;
|
|
26
25
|
private replyWithText;
|
|
27
26
|
private replyWithImage;
|
|
28
27
|
private replyWithVideo;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replyContext.d.ts","sourceRoot":"","sources":["../../../src/entities/context/replyContext.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EACH,yBAAyB,EACzB,qBAAqB,EACxB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAEnE,OAAO,EACH,mBAAmB,EACnB,2BAA2B,EAC9B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EACH,YAAY,EACZ,aAAa,EACb,OAAO,EACV,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"replyContext.d.ts","sourceRoot":"","sources":["../../../src/entities/context/replyContext.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EACH,yBAAyB,EACzB,qBAAqB,EACxB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAEnE,OAAO,EACH,mBAAmB,EACnB,2BAA2B,EAC9B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EACH,YAAY,EACZ,aAAa,EACb,OAAO,EACV,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,cAAc,EA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MAAM,YAAY,qBAAqB;QAIzD;;;;;WAKG;0BACe,MAAM,YAAY,qBAAqB;QAIzD;;;;WAIG;8BACmB,aAAa;MAWrC;CACL"}
|
|
@@ -7,6 +7,7 @@ import { resolve } from 'path';
|
|
|
7
7
|
import { BaseContextInternal } from './baseContext';
|
|
8
8
|
import { UserInfo } from '../../dtos/userInfo';
|
|
9
9
|
import { MessageInfo } from '../../dtos/messageInfo';
|
|
10
|
+
import { getQuotedText } from '../../helpers/getQuotedText';
|
|
10
11
|
export class ReplyContextInternal extends BaseContextInternal {
|
|
11
12
|
/** Collection of Regexp match results on a message that triggered this action. Will be empty if trigger is not a Regexp. */
|
|
12
13
|
matchResults = [];
|
|
@@ -22,31 +23,24 @@ export class ReplyContextInternal extends BaseContextInternal {
|
|
|
22
23
|
super(storage, scheduler, eventEmitter, action, message.chatInfo, message.traceId, botName);
|
|
23
24
|
this.replyMessageId = message.replyToMessageId;
|
|
24
25
|
this.messageInfo = new MessageInfo(message.messageId, message.text, message.type, message.updateObject);
|
|
25
|
-
this.userInfo = new UserInfo(message.from?.id ??
|
|
26
|
+
this.userInfo = new UserInfo(message.from?.id ?? null, (message.from?.first_name ?? 'Unknown user') +
|
|
26
27
|
(message.from?.last_name ? ` ${message.from.last_name}` : ''));
|
|
27
28
|
this.botInfo = botInfo;
|
|
28
29
|
}
|
|
29
|
-
getQuotePart(quote) {
|
|
30
|
-
if (typeof quote != 'boolean')
|
|
31
|
-
return quote;
|
|
32
|
-
return this.matchResults.length == 0
|
|
33
|
-
? this.messageInfo.text
|
|
34
|
-
: this.matchResults[0][1];
|
|
35
|
-
}
|
|
36
30
|
replyWithText(text, quote, options) {
|
|
37
|
-
const quotedPart = this
|
|
31
|
+
const quotedPart = getQuotedText(this, quote);
|
|
38
32
|
const response = new TextMessage(text, this.chatInfo, this.observability.traceId, this.action, new ReplyInfo(this.messageInfo.id, quote ? quotedPart : undefined), options);
|
|
39
33
|
this.responses.push(response);
|
|
40
34
|
return this.createCaptureController(response);
|
|
41
35
|
}
|
|
42
36
|
replyWithImage(name, quote, options) {
|
|
43
|
-
const quotedPart = this
|
|
37
|
+
const quotedPart = getQuotedText(this, quote);
|
|
44
38
|
const response = new ImageMessage({ source: resolve(`./content/${name}.png`) }, this.chatInfo, this.observability.traceId, this.action, new ReplyInfo(this.messageInfo.id, quote ? quotedPart : undefined), options);
|
|
45
39
|
this.responses.push(response);
|
|
46
40
|
return this.createCaptureController(response);
|
|
47
41
|
}
|
|
48
42
|
replyWithVideo(name, quote, options) {
|
|
49
|
-
const quotedPart = this
|
|
43
|
+
const quotedPart = getQuotedText(this, quote);
|
|
50
44
|
const response = new VideoMessage({ source: resolve(`./content/${name}.mp4`) }, this.chatInfo, this.observability.traceId, this.action, new ReplyInfo(this.messageInfo.id, quote ? quotedPart : undefined), options);
|
|
51
45
|
this.responses.push(response);
|
|
52
46
|
return this.createCaptureController(response);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { MessageInfo } from '../dtos/messageInfo';
|
|
2
|
+
type ContextWithMessageInfo = {
|
|
3
|
+
readonly messageInfo: MessageInfo;
|
|
4
|
+
readonly matchResults: RegExpMatchArray[];
|
|
5
|
+
};
|
|
6
|
+
export declare function getQuotedText(context: ContextWithMessageInfo, quote: boolean | string): string;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=getQuotedText.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getQuotedText.d.ts","sourceRoot":"","sources":["../../src/helpers/getQuotedText.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD,KAAK,sBAAsB,GAAG;IAC1B,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAClC,QAAQ,CAAC,YAAY,EAAE,gBAAgB,EAAE,CAAC;CAC7C,CAAC;AAEF,wBAAgB,aAAa,CACzB,OAAO,EAAE,sBAAsB,EAC/B,KAAK,EAAE,OAAO,GAAG,MAAM,UAQ1B"}
|
|
@@ -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,aAAa,EAAE,MAAM,qBAAqB,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;AAI5C,qBAAa,sBAAuB,SAAQ,mBAAmB;IAC3D,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA0C;IACxE,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;IAgDpB,2BAA2B,CACvB,OAAO,EAAE,aAAa,EACtB,eAAe,EAAE,MAAM,EACvB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO;IA2CpB,OAAO,CAAC,sBAAsB;
|
|
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,aAAa,EAAE,MAAM,qBAAqB,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;AAI5C,qBAAa,sBAAuB,SAAQ,mBAAmB;IAC3D,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA0C;IACxE,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;IAgDpB,2BAA2B,CACvB,OAAO,EAAE,aAAa,EACtB,eAAe,EAAE,MAAM,EACvB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO;IA2CpB,OAAO,CAAC,sBAAsB;CAmGjC"}
|
|
@@ -81,12 +81,6 @@ export class CommandActionProcessor extends BaseActionProcessor {
|
|
|
81
81
|
commandsToCheck.add(command);
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
|
-
this.eventEmitter.emit(BotEventType.beforeActionsExecuting, {
|
|
85
|
-
botInfo: this.botInfo,
|
|
86
|
-
message: msg,
|
|
87
|
-
commands: commandsToCheck,
|
|
88
|
-
traceId: msg.traceId
|
|
89
|
-
});
|
|
90
84
|
const promises = [...commandsToCheck].map((command) => {
|
|
91
85
|
const ctx = new MessageContextInternal(this.storage, this.scheduler, this.eventEmitter, command, msg, this.botName, this.botInfo);
|
|
92
86
|
const { proxy, revoke } = Proxy.revocable(ctx, {});
|
|
@@ -108,12 +102,21 @@ export class CommandActionProcessor extends BaseActionProcessor {
|
|
|
108
102
|
});
|
|
109
103
|
promises.push(...replyPromises);
|
|
110
104
|
}
|
|
111
|
-
void Promise.allSettled(promises)
|
|
105
|
+
void Promise.allSettled(promises)
|
|
106
|
+
.then(() => {
|
|
112
107
|
this.eventEmitter.emit(BotEventType.messageProcessingFinished, {
|
|
113
108
|
botInfo: this.botInfo,
|
|
114
109
|
message: msg,
|
|
115
110
|
traceId: msg.traceId
|
|
116
111
|
});
|
|
112
|
+
})
|
|
113
|
+
.catch((reason) => {
|
|
114
|
+
this.eventEmitter.emit(BotEventType.error, {
|
|
115
|
+
error: reason instanceof Error
|
|
116
|
+
? reason
|
|
117
|
+
: new Error('Unknown error'),
|
|
118
|
+
traceId: msg.traceId
|
|
119
|
+
});
|
|
117
120
|
});
|
|
118
121
|
}
|
|
119
122
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inlineQueryActionProcessor.d.ts","sourceRoot":"","sources":["../../../src/services/actionProcessors/inlineQueryActionProcessor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAI7E,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtD,qBAAa,0BAA2B,SAAQ,mBAAmB;IAC/D,OAAO,CAAC,aAAa,CAAuB;IAC5C,yDAAyD;IACzD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAI3B;IAEF,UAAU,CACN,GAAG,EAAE,kBAAkB,EACvB,QAAQ,EAAE,WAAW,EACrB,aAAa,EAAE,iBAAiB,EAAE,EAClC,MAAM,EAAE,YAAY;
|
|
1
|
+
{"version":3,"file":"inlineQueryActionProcessor.d.ts","sourceRoot":"","sources":["../../../src/services/actionProcessors/inlineQueryActionProcessor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAI7E,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtD,qBAAa,0BAA2B,SAAQ,mBAAmB;IAC/D,OAAO,CAAC,aAAa,CAAuB;IAC5C,yDAAyD;IACzD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAI3B;IAEF,UAAU,CACN,GAAG,EAAE,kBAAkB,EACvB,QAAQ,EAAE,WAAW,EACrB,aAAa,EAAE,iBAAiB,EAAE,EAClC,MAAM,EAAE,YAAY;CAmK3B"}
|
|
@@ -65,16 +65,33 @@ export class InlineQueryActionProcessor extends BaseActionProcessor {
|
|
|
65
65
|
this.api.flushResponses();
|
|
66
66
|
});
|
|
67
67
|
});
|
|
68
|
-
const queryPromise = Promise.allSettled(actionPromises)
|
|
68
|
+
const queryPromise = Promise.allSettled(actionPromises)
|
|
69
|
+
.then(() => {
|
|
69
70
|
queriesInProcessing.delete(inlineQuery.userId);
|
|
70
71
|
this.eventEmitter.emit(BotEventType.inlineProcessingFinished, {
|
|
71
72
|
botName: this.botName,
|
|
72
73
|
traceId: inlineQuery.traceId
|
|
73
74
|
});
|
|
75
|
+
})
|
|
76
|
+
.catch((reason) => {
|
|
77
|
+
queriesInProcessing.delete(inlineQuery.userId);
|
|
78
|
+
this.eventEmitter.emit(BotEventType.error, {
|
|
79
|
+
error: reason instanceof Error
|
|
80
|
+
? reason
|
|
81
|
+
: new Error('Unknown error'),
|
|
82
|
+
traceId: inlineQuery.traceId
|
|
83
|
+
});
|
|
74
84
|
});
|
|
75
85
|
promises.push(queryPromise);
|
|
76
86
|
}
|
|
77
|
-
void Promise.allSettled(promises)
|
|
87
|
+
void Promise.allSettled(promises).catch((reason) => {
|
|
88
|
+
this.eventEmitter.emit(BotEventType.error, {
|
|
89
|
+
error: reason instanceof Error
|
|
90
|
+
? reason
|
|
91
|
+
: new Error('Unknown error'),
|
|
92
|
+
traceId: createTrace(this, this.botName, 'Error')
|
|
93
|
+
});
|
|
94
|
+
});
|
|
78
95
|
}, period, false, this.botName);
|
|
79
96
|
}
|
|
80
97
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheduledActionProcessor.d.ts","sourceRoot":"","sources":["../../../src/services/actionProcessors/scheduledActionProcessor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AAIzE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAgB,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAgB,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAErE,qBAAa,wBAAyB,SAAQ,mBAAmB;IAC7D,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAyB;IAC/C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAIxB;IAEF,OAAO,CAAC,SAAS,CAAmC;gBAGhD,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC7B,OAAO,EAAE,cAAc,EACvB,SAAS,EAAE,UAAU,EACrB,YAAY,EAAE,iBAAiB;IAMnC,UAAU,CACN,GAAG,EAAE,kBAAkB,EACvB,SAAS,EAAE,eAAe,CAAC,YAAY,CAAC,EAAE,EAC1C,MAAM,EAAE,OAAO;IAkDnB,OAAO,CAAC,YAAY;
|
|
1
|
+
{"version":3,"file":"scheduledActionProcessor.d.ts","sourceRoot":"","sources":["../../../src/services/actionProcessors/scheduledActionProcessor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AAIzE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAgB,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAgB,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAErE,qBAAa,wBAAyB,SAAQ,mBAAmB;IAC7D,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAyB;IAC/C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAIxB;IAEF,OAAO,CAAC,SAAS,CAAmC;gBAGhD,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC7B,OAAO,EAAE,cAAc,EACvB,SAAS,EAAE,UAAU,EACrB,YAAY,EAAE,iBAAiB;IAMnC,UAAU,CACN,GAAG,EAAE,kBAAkB,EACvB,SAAS,EAAE,eAAe,CAAC,YAAY,CAAC,EAAE,EAC1C,MAAM,EAAE,OAAO;IAkDnB,OAAO,CAAC,YAAY;CA4DvB"}
|
|
@@ -54,11 +54,20 @@ export class ScheduledActionProcessor extends BaseActionProcessor {
|
|
|
54
54
|
});
|
|
55
55
|
});
|
|
56
56
|
});
|
|
57
|
-
void Promise.allSettled(promises)
|
|
58
|
-
|
|
57
|
+
void Promise.allSettled(promises)
|
|
58
|
+
.then(() => {
|
|
59
|
+
this.eventEmitter.emit(BotEventType.scheduledProcessingFinished, {
|
|
59
60
|
botName: this.botName,
|
|
60
61
|
traceId: this.taskTrace
|
|
61
62
|
});
|
|
63
|
+
})
|
|
64
|
+
.catch((reason) => {
|
|
65
|
+
this.eventEmitter.emit(BotEventType.error, {
|
|
66
|
+
error: reason instanceof Error
|
|
67
|
+
? reason
|
|
68
|
+
: new Error('Unknown error'),
|
|
69
|
+
traceId: this.taskTrace
|
|
70
|
+
});
|
|
62
71
|
});
|
|
63
72
|
}
|
|
64
73
|
}
|
|
@@ -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;
|
|
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;CAqBxB"}
|
|
@@ -13,6 +13,7 @@ export class NodeTimeoutScheduler {
|
|
|
13
13
|
for (const task of this.activeTasks) {
|
|
14
14
|
clearInterval(task.taskId);
|
|
15
15
|
}
|
|
16
|
+
this.activeTasks.length = 0;
|
|
16
17
|
}
|
|
17
18
|
createTask(name, action, interval, executeRightAway, ownerName) {
|
|
18
19
|
const traceId = createTrace(this, this.botName, name);
|
|
@@ -3,9 +3,9 @@ export type QueueItem = {
|
|
|
3
3
|
callback: () => Promise<void>;
|
|
4
4
|
};
|
|
5
5
|
export declare class ResponseProcessingQueue {
|
|
6
|
-
|
|
7
|
-
items
|
|
8
|
-
isFlushing
|
|
6
|
+
private readonly rateLimiter;
|
|
7
|
+
private readonly items;
|
|
8
|
+
private isFlushing;
|
|
9
9
|
enqueue(item: QueueItem): void;
|
|
10
10
|
flushReadyItems(): Promise<void>;
|
|
11
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"responseProcessingQueue.d.ts","sourceRoot":"","sources":["../../src/services/responseProcessingQueue.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,SAAS,GAAG;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACjC,CAAC;AAQF,qBAAa,uBAAuB;IAChC,WAAW,
|
|
1
|
+
{"version":3,"file":"responseProcessingQueue.d.ts","sourceRoot":"","sources":["../../src/services/responseProcessingQueue.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,SAAS,GAAG;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACjC,CAAC;AAQF,qBAAa,uBAAuB;IAChC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAEzB;IACH,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAmB;IACzC,OAAO,CAAC,UAAU,CAAS;IAE3B,OAAO,CAAC,IAAI,EAAE,SAAS;IAmBjB,eAAe;CAkBxB"}
|
|
@@ -4,7 +4,9 @@ function notEmpty(arr) {
|
|
|
4
4
|
}
|
|
5
5
|
const TELEGRAM_RATELIMIT_DELAY = 35;
|
|
6
6
|
export class ResponseProcessingQueue {
|
|
7
|
-
rateLimiter = RateLimit(1, {
|
|
7
|
+
rateLimiter = RateLimit(1, {
|
|
8
|
+
timeUnit: TELEGRAM_RATELIMIT_DELAY
|
|
9
|
+
});
|
|
8
10
|
items = [];
|
|
9
11
|
isFlushing = false;
|
|
10
12
|
enqueue(item) {
|
|
@@ -25,8 +27,8 @@ export class ResponseProcessingQueue {
|
|
|
25
27
|
return;
|
|
26
28
|
this.isFlushing = true;
|
|
27
29
|
while (notEmpty(this.items)) {
|
|
30
|
+
await this.rateLimiter();
|
|
28
31
|
if (Date.now() >= this.items[0].priority) {
|
|
29
|
-
await this.rateLimiter();
|
|
30
32
|
const [item] = this.items;
|
|
31
33
|
this.items.shift();
|
|
32
34
|
await item.callback();
|
|
@@ -12,7 +12,7 @@ export declare class TelegramApiService {
|
|
|
12
12
|
private readonly storage;
|
|
13
13
|
private readonly eventEmitter;
|
|
14
14
|
private readonly captureRegistrationCallback;
|
|
15
|
-
private readonly
|
|
15
|
+
private readonly TELEGRAM_API_SERVICE_ERROR_TRACEID;
|
|
16
16
|
private readonly methodMap;
|
|
17
17
|
constructor(botName: string, telegram: TelegramApiClient, storage: IStorageClient, eventEmitter: TypedEventEmitter, captureRegistrationCallback: (capture: IReplyCapture, parentMessageId: number, chatInfo: ChatInfo, traceId: TraceId) => void);
|
|
18
18
|
enqueueBatchedResponses(responses: BotResponse[]): void;
|
|
@@ -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,EACH,WAAW,EAGd,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGjD,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;
|
|
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,EACH,WAAW,EAGd,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGjD,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;AAGlE,eAAO,MAAM,4BAA4B,uBAAuB,CAAC;AAEjE,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,CAYxB;gBAGE,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,iBAAiB,EAC3B,OAAO,EAAE,cAAc,EACvB,YAAY,EAAE,iBAAiB,EAC/B,2BAA2B,EAAE,CACzB,OAAO,EAAE,aAAa,EACtB,eAAe,EAAE,MAAM,EACvB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,KACf,IAAI;IAcb,uBAAuB,CAAC,SAAS,EAAE,WAAW,EAAE;IAyDhD,cAAc;YAYA,WAAW;YA+BX,eAAe;YAsBf,cAAc;CAmG/B"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ResponseProcessingQueue } from './responseProcessingQueue';
|
|
2
2
|
import { BotEventType } from '../types/events';
|
|
3
|
+
import { createTrace } from '../helpers/traceFactory';
|
|
3
4
|
export const TELEGRAM_ERROR_QUOTE_INVALID = 'QUOTE_TEXT_INVALID';
|
|
4
5
|
export class TelegramApiService {
|
|
5
6
|
queue = new ResponseProcessingQueue();
|
|
@@ -7,7 +8,7 @@ export class TelegramApiService {
|
|
|
7
8
|
storage;
|
|
8
9
|
eventEmitter;
|
|
9
10
|
captureRegistrationCallback;
|
|
10
|
-
|
|
11
|
+
TELEGRAM_API_SERVICE_ERROR_TRACEID;
|
|
11
12
|
methodMap = {
|
|
12
13
|
inlineQuery: 'answerInlineQuery',
|
|
13
14
|
text: 'sendMessage',
|
|
@@ -20,10 +21,10 @@ export class TelegramApiService {
|
|
|
20
21
|
};
|
|
21
22
|
constructor(botName, telegram, storage, eventEmitter, captureRegistrationCallback) {
|
|
22
23
|
this.telegram = telegram;
|
|
23
|
-
this.botName = botName;
|
|
24
24
|
this.storage = storage;
|
|
25
25
|
this.eventEmitter = eventEmitter;
|
|
26
26
|
this.captureRegistrationCallback = captureRegistrationCallback;
|
|
27
|
+
this.TELEGRAM_API_SERVICE_ERROR_TRACEID = createTrace(this, botName, 'Error');
|
|
27
28
|
}
|
|
28
29
|
enqueueBatchedResponses(responses) {
|
|
29
30
|
let offset = 0;
|
|
@@ -71,7 +72,14 @@ export class TelegramApiService {
|
|
|
71
72
|
}
|
|
72
73
|
}
|
|
73
74
|
flushResponses() {
|
|
74
|
-
void this.queue.flushReadyItems()
|
|
75
|
+
void this.queue.flushReadyItems().catch((reason) => {
|
|
76
|
+
this.eventEmitter.emit(BotEventType.error, {
|
|
77
|
+
error: reason instanceof Error
|
|
78
|
+
? reason
|
|
79
|
+
: new Error('Unknown error'),
|
|
80
|
+
traceId: this.TELEGRAM_API_SERVICE_ERROR_TRACEID
|
|
81
|
+
});
|
|
82
|
+
});
|
|
75
83
|
}
|
|
76
84
|
async pinIfShould(response, message) {
|
|
77
85
|
if (response.shouldPin) {
|
package/dist/types/events.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ChatInfo } from '../dtos/chatInfo';
|
|
2
2
|
import { IncomingMessage } from '../dtos/incomingMessage';
|
|
3
3
|
import { IncomingInlineQuery } from '../dtos/incomingQuery';
|
|
4
|
-
import { CommandAction } from '../entities/actions/commandAction';
|
|
5
4
|
import { ChatContext } from '../entities/context/chatContext';
|
|
6
5
|
import { InlineQueryContext } from '../entities/context/inlineQueryContext';
|
|
7
6
|
import { MessageContext } from '../entities/context/messageContext';
|
|
@@ -17,7 +16,6 @@ export declare const BotEventType: {
|
|
|
17
16
|
readonly messageRecieved: "message.recieved";
|
|
18
17
|
readonly messageProcessingStarted: "message.processingStarted";
|
|
19
18
|
readonly messageProcessingFinished: "message.processingFinished";
|
|
20
|
-
readonly beforeActionsExecuting: "message.beforeActionsExecuting";
|
|
21
19
|
readonly commandActionExecuting: "command.actionExecuting";
|
|
22
20
|
readonly commandActionExecuted: "command.actionExecuted";
|
|
23
21
|
readonly commandActionCaptureStarted: "command.captionStarted";
|
|
@@ -60,11 +58,6 @@ export type BotEventMap = {
|
|
|
60
58
|
botInfo: BotInfo;
|
|
61
59
|
message: IncomingMessage;
|
|
62
60
|
};
|
|
63
|
-
[BotEventType.beforeActionsExecuting]: {
|
|
64
|
-
botInfo: BotInfo;
|
|
65
|
-
message: IncomingMessage;
|
|
66
|
-
commands: Set<CommandAction<IActionState>>;
|
|
67
|
-
};
|
|
68
61
|
[BotEventType.commandActionExecuting]: {
|
|
69
62
|
action: IActionWithState<IActionState>;
|
|
70
63
|
ctx: MessageContext<IActionState>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/types/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/types/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAE,c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O,KACZ,IAAI,CAAC;AAEV,qBAAa,iBAAiB,CAE1B,aAAa,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,EAAE;IAElD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAStB;IAEJ,EAAE,CAAC,CAAC,SAAS,MAAM,YAAY,CAAC,aAAa,CAAC,EAC1C,KAAK,EAAE,CAAC,EACR,EAAE,EAAE,QAAQ,CAAC,YAAY,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;IAYhD,MAAM,CAAC,EAAE,EAAE,YAAY,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;IAOpD,IAAI,CAAC,CAAC,SAAS,MAAM,YAAY,CAAC,aAAa,CAAC,EAC5C,KAAK,EAAE,CAAC,EACR,GAAG,IAAI,EAAE,YAAY,CAAC,YAAY,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC,GACtD,IAAI;IA0BP,MAAM,IAAI,CAAC,MAAM,YAAY,CAAC,aAAa,CAAC,GAAG,GAAG,CAAC,EAAE;CAGxD"}
|
package/dist/types/events.js
CHANGED
|
@@ -3,7 +3,6 @@ export const BotEventType = {
|
|
|
3
3
|
messageRecieved: 'message.recieved',
|
|
4
4
|
messageProcessingStarted: 'message.processingStarted',
|
|
5
5
|
messageProcessingFinished: 'message.processingFinished',
|
|
6
|
-
beforeActionsExecuting: 'message.beforeActionsExecuting',
|
|
7
6
|
commandActionExecuting: 'command.actionExecuting',
|
|
8
7
|
commandActionExecuted: 'command.actionExecuted',
|
|
9
8
|
commandActionCaptureStarted: 'command.captionStarted',
|