chz-telegram-bot 0.7.20 → 0.7.22

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.
Files changed (57) hide show
  1. package/dist/dtos/responses/imageMessage.d.ts +2 -3
  2. package/dist/dtos/responses/imageMessage.d.ts.map +1 -1
  3. package/dist/dtos/responses/imageMessage.js +4 -3
  4. package/dist/dtos/responses/pin.d.ts +15 -0
  5. package/dist/dtos/responses/pin.d.ts.map +1 -0
  6. package/dist/dtos/responses/pin.js +15 -0
  7. package/dist/dtos/responses/textMessage.d.ts +1 -0
  8. package/dist/dtos/responses/textMessage.d.ts.map +1 -1
  9. package/dist/dtos/responses/textMessage.js +3 -0
  10. package/dist/dtos/responses/videoMessage.d.ts +2 -3
  11. package/dist/dtos/responses/videoMessage.d.ts.map +1 -1
  12. package/dist/dtos/responses/videoMessage.js +4 -3
  13. package/dist/entities/actions/commandAction.d.ts +1 -0
  14. package/dist/entities/actions/commandAction.d.ts.map +1 -1
  15. package/dist/entities/actions/commandAction.js +10 -8
  16. package/dist/entities/actions/inlineQueryAction.d.ts.map +1 -1
  17. package/dist/entities/actions/inlineQueryAction.js +2 -1
  18. package/dist/entities/actions/replyCaptureAction.d.ts.map +1 -1
  19. package/dist/entities/actions/replyCaptureAction.js +2 -1
  20. package/dist/entities/actions/scheduledAction.d.ts +1 -0
  21. package/dist/entities/actions/scheduledAction.d.ts.map +1 -1
  22. package/dist/entities/actions/scheduledAction.js +3 -2
  23. package/dist/entities/context/chatContext.d.ts +9 -3
  24. package/dist/entities/context/chatContext.d.ts.map +1 -1
  25. package/dist/entities/context/chatContext.js +13 -4
  26. package/dist/entities/context/messageContext.d.ts +5 -5
  27. package/dist/entities/context/messageContext.d.ts.map +1 -1
  28. package/dist/entities/context/messageContext.js +8 -8
  29. package/dist/entities/context/replyContext.d.ts +5 -5
  30. package/dist/entities/context/replyContext.d.ts.map +1 -1
  31. package/dist/entities/context/replyContext.js +12 -12
  32. package/dist/helpers/constants.d.ts +8 -0
  33. package/dist/helpers/constants.d.ts.map +1 -0
  34. package/dist/helpers/constants.js +7 -0
  35. package/dist/helpers/mapUtils.d.ts +1 -0
  36. package/dist/helpers/mapUtils.d.ts.map +1 -1
  37. package/dist/helpers/mapUtils.js +8 -0
  38. package/dist/services/actionProcessingService.d.ts.map +1 -1
  39. package/dist/services/actionProcessingService.js +2 -2
  40. package/dist/services/actionProcessors/commandActionProcessor.d.ts.map +1 -1
  41. package/dist/services/actionProcessors/commandActionProcessor.js +21 -23
  42. package/dist/services/actionProcessors/inlineQueryActionProcessor.d.ts.map +1 -1
  43. package/dist/services/actionProcessors/inlineQueryActionProcessor.js +19 -24
  44. package/dist/services/actionProcessors/scheduledActionProcessor.d.ts.map +1 -1
  45. package/dist/services/actionProcessors/scheduledActionProcessor.js +16 -24
  46. package/dist/services/jsonFileStorage.d.ts +2 -1
  47. package/dist/services/jsonFileStorage.d.ts.map +1 -1
  48. package/dist/services/jsonFileStorage.js +7 -5
  49. package/dist/services/responseProcessingQueue.d.ts.map +1 -1
  50. package/dist/services/responseProcessingQueue.js +1 -1
  51. package/dist/services/telegramApi.d.ts +0 -2
  52. package/dist/services/telegramApi.d.ts.map +1 -1
  53. package/dist/services/telegramApi.js +85 -99
  54. package/dist/types/response.d.ts +4 -2
  55. package/dist/types/response.d.ts.map +1 -1
  56. package/dist/types/response.js +1 -0
  57. package/package.json +5 -4
@@ -1,5 +1,4 @@
1
1
  import { IReplyResponseWithContent } from '../../types/response';
2
- import { MessageSendingOptions } from '../../types/messageSendingOptions';
3
2
  import { IAction } from '../../types/action';
4
3
  import { ChatInfo } from '../chatInfo';
5
4
  import { TraceId } from '../../types/trace';
@@ -15,8 +14,8 @@ export declare class ImageMessage implements IReplyResponseWithContent<InputFile
15
14
  readonly replyInfo: ReplyInfo | undefined;
16
15
  readonly traceId: TraceId;
17
16
  readonly disableWebPreview = false;
18
- readonly shouldPin: boolean;
19
17
  readonly action: IAction;
20
- constructor(image: InputFile, chatInfo: ChatInfo, traceId: TraceId, action: IAction, replyInfo: ReplyInfo | undefined, options?: MessageSendingOptions);
18
+ constructor(image: InputFile, chatInfo: ChatInfo, traceId: TraceId, action: IAction, replyInfo?: ReplyInfo);
19
+ get quotelessReply(): ImageMessage;
21
20
  }
22
21
  //# sourceMappingURL=imageMessage.d.ts.map
@@ -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,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,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,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,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,QAAQ,EAAE,aAAa,EAAE,CAAM;IAExC,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,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;gBAGrB,KAAK,EAAE,SAAS,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yInfo;
9
9
  traceId;
10
10
  disableWebPreview = false;
11
- shouldPin;
12
11
  action;
13
- constructor(image, chatInfo, traceId, action, replyInfo, options) {
12
+ constructor(image, chatInfo, traceId, action, replyInfo) {
14
13
  this.content = image;
15
14
  this.chatInfo = chatInfo;
16
15
  this.replyInfo = replyInfo;
17
16
  this.traceId = traceId;
18
- this.shouldPin = options?.pin ?? false;
19
17
  this.action = action;
20
18
  }
19
+ get quotelessReply() {
20
+ return new ImageMessage(this.content, this.chatInfo, this.traceId, this.action, undefined);
21
+ }
21
22
  }
@@ -0,0 +1,15 @@
1
+ import { IChatResponse } from '../../types/response';
2
+ import { IActionWithState } from '../../types/action';
3
+ import { IActionState } from '../../types/actionState';
4
+ import { ChatInfo } from '../chatInfo';
5
+ import { TraceId } from '../../types/trace';
6
+ export declare class PinResponse implements IChatResponse {
7
+ readonly kind: "pin";
8
+ readonly createdAt: number;
9
+ readonly messageId: number;
10
+ readonly chatInfo: ChatInfo;
11
+ readonly traceId: TraceId;
12
+ readonly action: IActionWithState<IActionState>;
13
+ constructor(messageId: number, chatInfo: ChatInfo, traceId: TraceId, action: IActionWithState<IActionState>);
14
+ }
15
+ //# sourceMappingURL=pin.d.ts.map
@@ -0,0 +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,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,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,gBAAgB,CAAC,YAAY,CAAC,CAAC;gBAG5C,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,gBAAgB,CAAC,YAAY,CAAC;CAO7C"}
@@ -0,0 +1,15 @@
1
+ import { BotResponseTypes } from '../../types/response';
2
+ export class PinResponse {
3
+ kind = BotResponseTypes.pin;
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
+ }
@@ -19,5 +19,6 @@ export declare class TextMessage implements IReplyResponseWithContent<string> {
19
19
  readonly action: IAction;
20
20
  readonly keyboard?: TelegramInlineKeyboardButton[][];
21
21
  constructor(text: string, chatInfo: ChatInfo, traceId: TraceId, action: IAction, replyInfo?: ReplyInfo, options?: TextMessageSendingOptions);
22
+ get quotelessReply(): TextMessage;
22
23
  }
23
24
  //# sourceMappingURL=textMessage.d.ts.map
@@ -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,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC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,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAC;AAE3E,qBAAa,WAAY,YAAW,yBAAyB,CAAC,MAAM,CAAC;IACjE,QAAQ,CAAC,IAAI,SAAyB;IACtC,QAAQ,CAAC,SAAS,SAAc;IAChC,QAAQ,CAAC,QAAQ,EAAE,aAAa,EAAE,CAAM;IAExC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,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,EAAE,OAAO,CAAC;IACpC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,QAAQ,CAAC,EAAE,4BAA4B,EAAE,EAAE,CAAC;gBAGjD,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,OAAO,EACf,SAAS,CAAC,EAAE,SAAS,EACrB,OAAO,CAAC,EAAE,yBAAyB;IAYvC,IAAI,cAAc,gBASjB;CACJ"}
@@ -21,4 +21,7 @@ export class TextMessage {
21
21
  this.action = action;
22
22
  this.keyboard = options?.keyboard;
23
23
  }
24
+ get quotelessReply() {
25
+ return new TextMessage(this.content, this.chatInfo, this.traceId, this.action, undefined, { pin: this.shouldPin });
26
+ }
24
27
  }
@@ -1,5 +1,4 @@
1
1
  import { IReplyResponseWithContent } from '../../types/response';
2
- import { MessageSendingOptions } from '../../types/messageSendingOptions';
3
2
  import { IAction } from '../../types/action';
4
3
  import { ChatInfo } from '../chatInfo';
5
4
  import { TraceId } from '../../types/trace';
@@ -15,8 +14,8 @@ export declare class VideoMessage implements IReplyResponseWithContent<InputFile
15
14
  readonly replyInfo: ReplyInfo | undefined;
16
15
  readonly traceId: TraceId;
17
16
  readonly disableWebPreview = false;
18
- readonly shouldPin: boolean;
19
17
  readonly action: IAction;
20
- constructor(video: InputFile, chatInfo: ChatInfo, traceId: TraceId, action: IAction, replyInfo: ReplyInfo | undefined, options?: MessageSendingOptions);
18
+ constructor(video: InputFile, chatInfo: ChatInfo, traceId: TraceId, action: IAction, replyInfo?: ReplyInfo);
19
+ get quotelessReply(): VideoMessage;
21
20
  }
22
21
  //# sourceMappingURL=videoMessage.d.ts.map
@@ -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,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,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,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,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,QAAQ,EAAE,aAAa,EAAE,CAAM;IAExC,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;IAC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,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,OAAO,EACf,SAAS,CAAC,EAAE,SAAS;IASzB,IAAI,cAAc,iBAQjB;CACJ"}
@@ -8,14 +8,15 @@ export class VideoMessage {
8
8
  replyInfo;
9
9
  traceId;
10
10
  disableWebPreview = false;
11
- shouldPin;
12
11
  action;
13
- constructor(video, chatInfo, traceId, action, replyInfo, options) {
12
+ constructor(video, chatInfo, traceId, action, replyInfo) {
14
13
  this.content = video;
15
14
  this.chatInfo = chatInfo;
16
15
  this.replyInfo = replyInfo;
17
16
  this.traceId = traceId;
18
- this.shouldPin = options?.pin ?? false;
19
17
  this.action = action;
20
18
  }
19
+ get quotelessReply() {
20
+ return new VideoMessage(this.content, this.chatInfo, this.traceId, this.action, undefined);
21
+ }
21
22
  }
@@ -22,6 +22,7 @@ export declare class CommandAction<TActionState extends IActionState> implements
22
22
  readonly condition: CommandCondition<TActionState>;
23
23
  readonly stateConstructor: () => TActionState;
24
24
  readonly readmeFactory: (botName: string) => string;
25
+ readonly semaphoreFactory: () => Semaphore;
25
26
  private lastCustomCooldown;
26
27
  constructor(trigger: CommandTrigger | CommandTrigger[], handler: CommandHandler<TActionState>, name: string, providers: CommandActionProviders, maxAllowedSimultaniousExecutions: number, condition: CommandCondition<TActionState>, stateConstructor: () => TActionState, readmeFactory: (botName: string) => string);
27
28
  exec(ctx: MessageContextInternal<TActionState>): Promise<BotResponse[]>;
@@ -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,MAA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EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,mBAAmB,yBAAgC;IAC5D,QAAQ,CAAC,gCAAgC,EAAE,MAAM,CAAC;IAElD,QAAQ,CAAC,QAAQ,EAAE,cAAc,EAAE,CAAC;IAEpC,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC,YAAY,CAAC,CAAC;IAC/C,QAAQ,CAAC,SAAS,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAC;IACnD,QAAQ,CAAC,gBAAgB,EAAE,MAAM,YAAY,CAAC;IAC9C,QAAQ,CAAC,aAAa,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC;IACpD,QAAQ,CAAC,gBAAgB,EAAE,MAAM,SAAS,CAAC;IAE3C,OAAO,CAAC,kBAAkB,CAAsB;gBAG5C,OAAO,EAAE,cAAc,GAAG,cAAc,EAAE,EAC1C,OAAO,EAAE,cAAc,CAAC,YAAY,CAAC,EACrC,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,sBAAsB,EACjC,gCAAgC,EAAE,MAAM,EACxC,SAAS,EAAE,gBAAgB,CAAC,YAAY,CAAC,EACzC,gBAAgB,EAAE,MAAM,YAAY,EACpC,aAAa,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM;IAyBxC,IAAI,CACN,GAAG,EAAE,sBAAsB,CAAC,YAAY,CAAC,GAC1C,OAAO,CAAC,WAAW,EAAE,CAAC;IA2FzB,OAAO,CAAC,uBAAuB;IA6D/B,OAAO,CAAC,YAAY;CAwCvB"}
@@ -5,11 +5,11 @@ import { CommandTriggerCheckResult } from '../../dtos/commandTriggerCheckResult'
5
5
  import { Noop } from '../../helpers/noop';
6
6
  import { MessageType } from '../../types/messageTypes';
7
7
  import { Sema as Semaphore } from 'async-sema';
8
- import { getOrSetIfNotExists } from '../../helpers/mapUtils';
8
+ import { getOrCreateIfNotExists } 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
+ import { REGEX_MATCH_LIMIT } from '../../helpers/constants';
13
13
  export class CommandAction {
14
14
  cooldownInfoProvider;
15
15
  isActiveProvider;
@@ -25,6 +25,7 @@ export class CommandAction {
25
25
  condition;
26
26
  stateConstructor;
27
27
  readmeFactory;
28
+ semaphoreFactory;
28
29
  lastCustomCooldown;
29
30
  constructor(trigger, handler, name, providers, maxAllowedSimultaniousExecutions, condition, stateConstructor, readmeFactory) {
30
31
  this.triggers = toArray(trigger);
@@ -40,12 +41,13 @@ export class CommandAction {
40
41
  this.readmeFactory = readmeFactory;
41
42
  this.maxAllowedSimultaniousExecutions =
42
43
  maxAllowedSimultaniousExecutions;
44
+ this.semaphoreFactory = () => new Semaphore(this.maxAllowedSimultaniousExecutions);
43
45
  this.key = `command:${this.name.replace('.', '-')}`;
44
46
  }
45
47
  async exec(ctx) {
46
48
  let lock;
47
49
  if (this.maxAllowedSimultaniousExecutions != 0) {
48
- lock = getOrSetIfNotExists(this.ratelimitSemaphores, ctx.chatInfo.id, new Semaphore(this.maxAllowedSimultaniousExecutions));
50
+ lock = getOrCreateIfNotExists(this.ratelimitSemaphores, ctx.chatInfo.id, this.semaphoreFactory);
49
51
  await lock.acquire();
50
52
  }
51
53
  try {
@@ -93,8 +95,13 @@ export class CommandAction {
93
95
  }
94
96
  }
95
97
  checkIfShouldBeExecuted(ctx, trigger, state) {
98
+ if (!ctx.userInfo.id)
99
+ return CommandTriggerCheckResult.DontTriggerAndSkipCooldown('UserIdMissing');
96
100
  if (!this.isActiveProvider(ctx))
97
101
  return CommandTriggerCheckResult.DontTriggerAndSkipCooldown('ActionDisabled');
102
+ const triggerCheckResult = this.checkTrigger(ctx, trigger);
103
+ if (!triggerCheckResult.shouldExecute)
104
+ return triggerCheckResult;
98
105
  const chatsBlacklist = this.chatsBlacklistProvider(ctx);
99
106
  const chatsWhitelist = this.chatsWhitelistProvider(ctx);
100
107
  const isChatInBlacklist = chatsBlacklist.includes(ctx.chatInfo.id);
@@ -102,11 +109,6 @@ export class CommandAction {
102
109
  chatsWhitelist.includes(ctx.chatInfo.id);
103
110
  if (isChatInBlacklist || !isChatInWhitelist)
104
111
  return CommandTriggerCheckResult.DontTriggerAndSkipCooldown('ChatForbidden');
105
- const triggerCheckResult = this.checkTrigger(ctx, trigger);
106
- if (!triggerCheckResult.shouldExecute)
107
- return triggerCheckResult;
108
- if (!ctx.userInfo.id)
109
- return CommandTriggerCheckResult.DontTriggerAndSkipCooldown('UserIdMissing');
110
112
  const usersWhitelist = this.usersWhitelistProvider(ctx);
111
113
  const isUserAllowed = usersWhitelist.length == 0 ||
112
114
  usersWhitelist.includes(ctx.userInfo.id);
@@ -1 +1 @@
1
- {"version":3,"file":"inlineQueryAction.d.ts","sourceRoot":"","sources":["../../../src/entities/actions/inlineQueryAction.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,4BAA4B,EAAE,MAAM,8BAA8B,CAAC;AAI5E,qBAAa,iBAAkB,YAAW,OAAO;IAC7C,QAAQ,CAAC,GAAG,EAAE,SAAS,CAAC;IACxB,QAAQ,CAAC,gBAAgB,EAAE,4BAA4B,CAAC,OAAO,CAAC,CAAC;IACjE,QAAQ,CAAC,OAAO,EAAE,kBAAkB,CAAC;IACrC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;gBAGrB,OAAO,EAAE,kBAAkB,EAC3B,IAAI,EAAE,MAAM,EACZ,cAAc,EAAE,4BAA4B,CAAC,OAAO,CAAC,EACrD,OAAO,EAAE,MAAM;IAUb,IAAI,CAAC,GAAG,EAAE,0BAA0B;CAqD7C"}
1
+ {"version":3,"file":"inlineQueryAction.d.ts","sourceRoot":"","sources":["../../../src/entities/actions/inlineQueryAction.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,4BAA4B,EAAE,MAAM,8BAA8B,CAAC;AAK5E,qBAAa,iBAAkB,YAAW,OAAO;IAC7C,QAAQ,CAAC,GAAG,EAAE,SAAS,CAAC;IACxB,QAAQ,CAAC,gBAAgB,EAAE,4BAA4B,CAAC,OAAO,CAAC,CAAC;IACjE,QAAQ,CAAC,OAAO,EAAE,kBAAkB,CAAC;IACrC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;gBAGrB,OAAO,EAAE,kBAAkB,EAC3B,IAAI,EAAE,MAAM,EACZ,cAAc,EAAE,4BAA4B,CAAC,OAAO,CAAC,EACrD,OAAO,EAAE,MAAM;IAUb,IAAI,CAAC,GAAG,EAAE,0BAA0B;CAsD7C"}
@@ -1,6 +1,7 @@
1
1
  import { Noop } from '../../helpers/noop';
2
2
  import { BotEventType } from '../../types/events';
3
3
  import { InlineQueryResponse } from '../../dtos/responses/inlineQueryResponse';
4
+ import { REGEX_MATCH_LIMIT } from '../../helpers/constants';
4
5
  export class InlineQueryAction {
5
6
  key;
6
7
  isActiveProvider;
@@ -21,7 +22,7 @@ export class InlineQueryAction {
21
22
  this.pattern.lastIndex = 0;
22
23
  const execResult = this.pattern.exec(ctx.queryText);
23
24
  if (execResult != null) {
24
- let regexMatchLimit = 100;
25
+ let regexMatchLimit = REGEX_MATCH_LIMIT;
25
26
  matchResults.push(execResult);
26
27
  if (this.pattern.global) {
27
28
  while (regexMatchLimit > 0) {
@@ -1 +1 @@
1
- {"version":3,"file":"replyCaptureAction.d.ts","sourceRoot":"","sources":["../../../src/entities/actions/replyCaptureAction.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAG/D,qBAAa,kBAAkB,CAC3B,kBAAkB,SAAS,YAAY,CACzC,YAAW,OAAO;IAChB,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,GAAG,EAAE,SAAS,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,CACd,YAAY,EAAE,oBAAoB,CAAC,kBAAkB,CAAC,KACrD,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB,QAAQ,CAAC,QAAQ,EAAE,cAAc,EAAE,CAAC;IACpC,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;gBAGtC,eAAe,EAAE,MAAM,EACvB,YAAY,EAAE,OAAO,EACrB,OAAO,EAAE,CACL,YAAY,EAAE,oBAAoB,CAAC,kBAAkB,CAAC,KACrD,OAAO,CAAC,IAAI,CAAC,EAClB,QAAQ,EAAE,cAAc,EAAE,EAC1B,eAAe,EAAE,eAAe;IAY9B,IAAI,CAAC,GAAG,EAAE,oBAAoB,CAAC,kBAAkB,CAAC;IA2BxD,OAAO,CAAC,uBAAuB;CA4ClC"}
1
+ {"version":3,"file":"replyCaptureAction.d.ts","sourceRoot":"","sources":["../../../src/entities/actions/replyCaptureAction.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAI/D,qBAAa,kBAAkB,CAC3B,kBAAkB,SAAS,YAAY,CACzC,YAAW,OAAO;IAChB,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,GAAG,EAAE,SAAS,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,CACd,YAAY,EAAE,oBAAoB,CAAC,kBAAkB,CAAC,KACrD,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB,QAAQ,CAAC,QAAQ,EAAE,cAAc,EAAE,CAAC;IACpC,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;gBAGtC,eAAe,EAAE,MAAM,EACvB,YAAY,EAAE,OAAO,EACrB,OAAO,EAAE,CACL,YAAY,EAAE,oBAAoB,CAAC,kBAAkB,CAAC,KACrD,OAAO,CAAC,IAAI,CAAC,EAClB,QAAQ,EAAE,cAAc,EAAE,EAC1B,eAAe,EAAE,eAAe;IAY9B,IAAI,CAAC,GAAG,EAAE,oBAAoB,CAAC,kBAAkB,CAAC;IA4BxD,OAAO,CAAC,uBAAuB;CA4ClC"}
@@ -1,6 +1,7 @@
1
1
  import { CommandTriggerCheckResult } from '../../dtos/commandTriggerCheckResult';
2
2
  import { Noop } from '../../helpers/noop';
3
3
  import { BotEventType } from '../../types/events';
4
+ import { REGEX_MATCH_LIMIT } from '../../helpers/constants';
4
5
  export class ReplyCaptureAction {
5
6
  parentMessageId;
6
7
  key;
@@ -49,7 +50,7 @@ export class ReplyCaptureAction {
49
50
  trigger.lastIndex = 0;
50
51
  const execResult = trigger.exec(ctx.messageInfo.text);
51
52
  if (execResult != null) {
52
- let regexMatchLimit = 100;
53
+ let regexMatchLimit = REGEX_MATCH_LIMIT;
53
54
  matchResults.push(execResult);
54
55
  if (trigger.global) {
55
56
  while (regexMatchLimit > 0) {
@@ -7,6 +7,7 @@ import { ChatContextInternal } from '../context/chatContext';
7
7
  import { ScheduledActionProviders } from '../../dtos/propertyProviderSets';
8
8
  export declare class ScheduledAction<TActionState extends IActionState> implements IActionWithState<TActionState> {
9
9
  static readonly locks: Map<string, Semaphore>;
10
+ static readonly semaphoreFactory: () => Semaphore;
10
11
  readonly name: string;
11
12
  readonly key: ActionKey;
12
13
  private readonly timeinHoursProvider;
@@ -1 +1 @@
1
- {"version":3,"file":"scheduledAction.d.ts","sourceRoot":"","sources":["../../../src/entities/actions/scheduledAction.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAGxD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAI7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAG3E,qBAAa,eAAe,CACxB,YAAY,SAAS,YAAY,CACnC,YAAW,gBAAgB,CAAC,YAAY,CAAC;IACvC,MAAM,CAAC,QAAQ,CAAC,KAAK,yBAAgC;IAErD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,GAAG,EAAE,SAAS,CAAC;IAExB,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAA8C;IAClF,OAAO,CAAC,QAAQ,CAAC,cAAc,CAA2C;IAC1E,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAErC;IAEF,QAAQ,CAAC,WAAW,uBAA8B;IAClD,QAAQ,CAAC,gBAAgB,EAAE,MAAM,YAAY,CAAC;IAC9C,QAAQ,CAAC,oBAAoB,EAAE,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IAC/D,QAAQ,CAAC,O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B,CAErC;IAEF,QAAQ,CAAC,WAAW,uBAA8B;IAClD,QAAQ,CAAC,gBAAgB,EAAE,MAAM,YAAY,CAAC;IAC9C,QAAQ,CAAC,oBAAoB,EAAE,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IAC/D,QAAQ,CAAC,OAAO,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAC;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;IA6D5B,OAAO,CAAC,uBAAuB;CAgBlC"}
@@ -2,10 +2,11 @@ import moment from 'moment';
2
2
  import { Sema as Semaphore } from 'async-sema';
3
3
  import { hoursToMilliseconds } from '../../helpers/timeConvertions';
4
4
  import { Noop } from '../../helpers/noop';
5
- import { getOrSetIfNotExists, getOrThrow } from '../../helpers/mapUtils';
5
+ import { getOrCreateIfNotExists, getOrThrow } from '../../helpers/mapUtils';
6
6
  import { BotEventType } from '../../types/events';
7
7
  export class ScheduledAction {
8
8
  static locks = new Map();
9
+ static semaphoreFactory = () => new Semaphore(1);
9
10
  name;
10
11
  key;
11
12
  timeinHoursProvider;
@@ -53,7 +54,7 @@ export class ScheduledAction {
53
54
  async getCachedValue(key, ctx) {
54
55
  const cachedItemFactory = getOrThrow(this.cachedStateFactories, key, `No shared cache was set up for the key [${key}] in action '${this.name}'`);
55
56
  const semaphoreKey = `${this.key}_cached:${key}`;
56
- const semaphore = getOrSetIfNotExists(ScheduledAction.locks, semaphoreKey, new Semaphore(1));
57
+ const semaphore = getOrCreateIfNotExists(ScheduledAction.locks, semaphoreKey, ScheduledAction.semaphoreFactory);
57
58
  await semaphore.acquire();
58
59
  try {
59
60
  if (this.cachedState.has(key)) {
@@ -1,4 +1,4 @@
1
- import { MessageSendingOptions, TextMessageSendingOptions } from '../../types/messageSendingOptions';
1
+ import { TextMessageSendingOptions } from '../../types/messageSendingOptions';
2
2
  import { IActionWithState } from '../../types/action';
3
3
  import { IActionState } from '../../types/actionState';
4
4
  import { Milliseconds } from '../../types/timeValues';
@@ -26,14 +26,14 @@ export declare class ChatContextInternal<TActionState extends IActionState, TAct
26
26
  * @param name Message contents.
27
27
  * @param options Message sending option.
28
28
  */
29
- image: (name: string, options?: MessageSendingOptions) => import("../..").ICaptureController;
29
+ image: (name: string) => import("../..").ICaptureController;
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, options?: MessageSendingOptions) => import("../..").ICaptureController;
36
+ video: (name: string) => import("../..").ICaptureController;
37
37
  };
38
38
  /**
39
39
  * Unpins message after action execution is finished.
@@ -41,6 +41,12 @@ export declare class ChatContextInternal<TActionState extends IActionState, TAct
41
41
  * @param messageId Message id.
42
42
  */
43
43
  unpinMessage(messageId: number): void;
44
+ /**
45
+ * Pins message after action execution is finished.
46
+ * 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.
47
+ * @param messageId Message id.
48
+ */
49
+ pinMessage(messageId: number): void;
44
50
  /**
45
51
  * Delays next responses by specified amount of time.
46
52
  * @param delay Delay in milliseconds.
@@ -1 +1 @@
1
- {"version":3,"file":"chatContext.d.ts","sourceRoot":"","sources":["../../../src/entities/context/chatContext.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,qBAAqB,EACrB,yBAAyB,EAC5B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC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,MAAM,MAAM,WAAW,CACnB,YAAY,SAAS,YAAY,EACjC,OAAO,SAAS,gBAAgB,CAAC,YAAY,CAAC,GAC1C,eAAe,CAAC,YAAY,CAAC,IACjC,IAAI,CACJ,mBAAmB,CAAC,YAAY,EAAE,OAAO,CAAC,EAC1C,2BAA2B,CAC9B,CAAC;AAEF;;GAEG;AACH,qBAAa,mBAAmB,CAC5B,YAAY,SAAS,YAAY,EACjC,OAAO,SAAS,gBAAgB,CAAC,YAAY,CAAC,GAC1C,eAAe,CAAC,YAAY,CAAC,CACnC,SAAQ,mBAAmB,CAAC,OAAO,CAAC;IAClC;;OAEG;IACH,IAAI;QACA;;;;;WAKG;qBACU,MAAM,YAAY,yBAAyB;QAexD;;;;;WAKG;sBACW,MAAM;QAapB;;;;;WAKG;sBACW,MAAM;MAYtB;IAEF;;;;OAIG;IACH,YAAY,CAAC,SAAS,EAAE,MAAM;IAW9B;;;;OAIG;IACH,UAAU,CAAC,SAAS,EAAE,MAAM;IAW5B;;;OAGG;IACH,IAAI,CAAC,KAAK,EAAE,YAAY;CAU3B"}
@@ -5,6 +5,7 @@ import { VideoMessage } from '../../dtos/responses/videoMessage';
5
5
  import { UnpinResponse } from '../../dtos/responses/unpin';
6
6
  import { DelayResponse } from '../../dtos/responses/delay';
7
7
  import { BaseContextInternal } from './baseContext';
8
+ import { PinResponse } from '../../dtos/responses/pin';
8
9
  /**
9
10
  * Context of action executed in chat.
10
11
  */
@@ -30,8 +31,8 @@ export class ChatContextInternal extends BaseContextInternal {
30
31
  * @param name Message contents.
31
32
  * @param options Message sending option.
32
33
  */
33
- image: (name, options) => {
34
- const response = new ImageMessage({ source: resolve(`./content/${name}.png`) }, this.chatInfo, this.observability.traceId, this.action, undefined, options);
34
+ image: (name) => {
35
+ const response = new ImageMessage({ source: resolve(`./content/${name}.png`) }, this.chatInfo, this.observability.traceId, this.action);
35
36
  this.responses.push(response);
36
37
  return this.createCaptureController(response);
37
38
  },
@@ -41,8 +42,8 @@ export class ChatContextInternal extends BaseContextInternal {
41
42
  * @param name Message contents.
42
43
  * @param options Message sending option.
43
44
  */
44
- video: (name, options) => {
45
- const response = new VideoMessage({ source: resolve(`./content/${name}.mp4`) }, this.chatInfo, this.observability.traceId, this.action, undefined, options);
45
+ video: (name) => {
46
+ const response = new VideoMessage({ source: resolve(`./content/${name}.mp4`) }, this.chatInfo, this.observability.traceId, this.action);
46
47
  this.responses.push(response);
47
48
  return this.createCaptureController(response);
48
49
  }
@@ -55,6 +56,14 @@ export class ChatContextInternal extends BaseContextInternal {
55
56
  unpinMessage(messageId) {
56
57
  this.responses.push(new UnpinResponse(messageId, this.chatInfo, this.observability.traceId, this.action));
57
58
  }
59
+ /**
60
+ * Pins message after action execution is finished.
61
+ * 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.
62
+ * @param messageId Message id.
63
+ */
64
+ pinMessage(messageId) {
65
+ this.responses.push(new PinResponse(messageId, this.chatInfo, this.observability.traceId, this.action));
66
+ }
58
67
  /**
59
68
  * Delays next responses by specified amount of time.
60
69
  * @param delay Delay in milliseconds.
@@ -1,6 +1,6 @@
1
1
  import { IActionState } from '../../types/actionState';
2
2
  import { ChatContextInternal } from './chatContext';
3
- import { MessageSendingOptions, TextMessageSendingOptions } from '../../types/messageSendingOptions';
3
+ import { TextMessageSendingOptions } from '../../types/messageSendingOptions';
4
4
  import { CommandAction } from '../actions/commandAction';
5
5
  import { Seconds } from '../../types/timeValues';
6
6
  import { BaseContextPropertiesToOmit } from './baseContext';
@@ -56,14 +56,14 @@ export declare class MessageContextInternal<TActionState extends IActionState> e
56
56
  * @param text Message contents.
57
57
  * @param options Message sending option.
58
58
  */
59
- withImage: (name: string, quote?: string, options?: MessageSendingOptions) => import("../..").ICaptureController;
59
+ withImage: (name: string, quote?: string) => import("../..").ICaptureController;
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, options?: MessageSendingOptions) => import("../..").ICaptureController;
66
+ withVideo: (name: string, quote?: string) => import("../..").ICaptureController;
67
67
  };
68
68
  /**
69
69
  * Reply with text message to message that triggered this action after action execution is finished.
@@ -78,14 +78,14 @@ export declare class MessageContextInternal<TActionState extends IActionState> e
78
78
  * @param text Message contents.
79
79
  * @param options Message sending option.
80
80
  */
81
- withImage: (name: string, options?: MessageSendingOptions) => import("../..").ICaptureController;
81
+ withImage: (name: string) => import("../..").ICaptureController;
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, options?: MessageSendingOptions) => import("../..").ICaptureController;
88
+ withVideo: (name: string) => import("../..").ICaptureController;
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.
@@ -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,qBAAq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);
38
38
  return this.createCaptureController(response);
39
39
  }
40
- replyWithImage(name, quote, options) {
40
+ replyWithImage(name, quote) {
41
41
  const quotedPart = getQuotedText(this, quote);
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);
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));
43
43
  this.responses.push(response);
44
44
  return this.createCaptureController(response);
45
45
  }
46
- replyWithVideo(name, quote, options) {
46
+ replyWithVideo(name, quote) {
47
47
  const quotedPart = getQuotedText(this, quote);
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);
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));
49
49
  this.responses.push(response);
50
50
  return this.createCaptureController(response);
51
51
  }
@@ -78,14 +78,14 @@ export class MessageContextInternal extends ChatContextInternal {
78
78
  * @param text Message contents.
79
79
  * @param options Message sending option.
80
80
  */
81
- withImage: (name, quote, options) => this.replyWithImage(name, quote ?? true, options),
81
+ withImage: (name, quote) => this.replyWithImage(name, quote ?? true),
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, quote, options) => this.replyWithVideo(name, quote ?? true, options)
88
+ withVideo: (name, quote) => this.replyWithVideo(name, quote ?? true)
89
89
  },
90
90
  /**
91
91
  * Reply with text message to message that triggered this action after action execution is finished.
@@ -100,14 +100,14 @@ export class MessageContextInternal extends ChatContextInternal {
100
100
  * @param text Message contents.
101
101
  * @param options Message sending option.
102
102
  */
103
- withImage: (name, options) => this.replyWithImage(name, false, options),
103
+ withImage: (name) => this.replyWithImage(name, false),
104
104
  /**
105
105
  * Reply with video/gif message to message that triggered this action after action execution is finished.
106
106
  * 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.
107
107
  * @param text Message contents.
108
108
  * @param options Message sending option.
109
109
  */
110
- withVideo: (name, options) => this.replyWithVideo(name, false, options),
110
+ withVideo: (name) => this.replyWithVideo(name, false),
111
111
  /**
112
112
  * React to the message that triggered this action after action execution is finished.
113
113
  * 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.
@@ -1,5 +1,5 @@
1
1
  import { IActionState } from '../../types/actionState';
2
- import { TextMessageSendingOptions, MessageSendingOptions } from '../../types/messageSendingOptions';
2
+ import { TextMessageSendingOptions } from '../../types/messageSendingOptions';
3
3
  import { ReplyCaptureAction } from '../actions/replyCaptureAction';
4
4
  import { BaseContextInternal, BaseContextPropertiesToOmit } from './baseContext';
5
5
  import { UserInfo } from '../../dtos/userInfo';
@@ -51,14 +51,14 @@ export declare class ReplyContextInternal<TParentActionState extends IActionStat
51
51
  * @param text Message contents.
52
52
  * @param options Message sending option.
53
53
  */
54
- withImage: (name: string, quote?: string, options?: MessageSendingOptions) => import("../..").ICaptureController;
54
+ withImage: (name: string, quote?: string) => import("../..").ICaptureController;
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, options?: MessageSendingOptions) => import("../..").ICaptureController;
61
+ withVideo: (name: string, quote?: string) => import("../..").ICaptureController;
62
62
  };
63
63
  /**
64
64
  * Reply with text message to message that triggered this action after action execution is finished.
@@ -73,14 +73,14 @@ export declare class ReplyContextInternal<TParentActionState extends IActionStat
73
73
  * @param text Message contents.
74
74
  * @param options Message sending option.
75
75
  */
76
- withImage: (name: string, options?: MessageSendingOptions) => import("../..").ICaptureController;
76
+ withImage: (name: string) => import("../..").ICaptureController;
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, options?: MessageSendingOptions) => import("../..").ICaptureController;
83
+ withVideo: (name: string) => import("../..").ICaptureController;
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.
@@ -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;AAG7D,MAAM,MAAM,YAAY,CAAC,Y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