chz-telegram-bot 0.0.46 → 0.0.48

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 (60) hide show
  1. package/dist/entities/actionExecutionResult.d.ts +3 -3
  2. package/dist/entities/actionExecutionResult.d.ts.map +1 -1
  3. package/dist/entities/actions/commandAction.d.ts +2 -2
  4. package/dist/entities/actions/commandAction.d.ts.map +1 -1
  5. package/dist/entities/actions/commandAction.js +6 -4
  6. package/dist/entities/actions/scheduledAction.d.ts +2 -2
  7. package/dist/entities/actions/scheduledAction.d.ts.map +1 -1
  8. package/dist/entities/actions/scheduledAction.js +4 -2
  9. package/dist/entities/botInstance.d.ts.map +1 -1
  10. package/dist/entities/botInstance.js +4 -2
  11. package/dist/entities/context/chatContext.d.ts +21 -9
  12. package/dist/entities/context/chatContext.d.ts.map +1 -1
  13. package/dist/entities/context/chatContext.js +24 -10
  14. package/dist/entities/context/messageContext.d.ts +9 -6
  15. package/dist/entities/context/messageContext.d.ts.map +1 -1
  16. package/dist/entities/context/messageContext.js +14 -10
  17. package/dist/entities/responses/delay.d.ts +13 -0
  18. package/dist/entities/responses/delay.d.ts.map +1 -0
  19. package/dist/entities/responses/delay.js +14 -0
  20. package/dist/entities/responses/imageMessage.d.ts +3 -2
  21. package/dist/entities/responses/imageMessage.d.ts.map +1 -1
  22. package/dist/entities/responses/reaction.d.ts +3 -2
  23. package/dist/entities/responses/reaction.d.ts.map +1 -1
  24. package/dist/entities/responses/textMessage.d.ts +3 -2
  25. package/dist/entities/responses/textMessage.d.ts.map +1 -1
  26. package/dist/entities/responses/unpin.d.ts +3 -2
  27. package/dist/entities/responses/unpin.d.ts.map +1 -1
  28. package/dist/entities/responses/videoMessage.d.ts +3 -2
  29. package/dist/entities/responses/videoMessage.d.ts.map +1 -1
  30. package/dist/services/jsonFileStorage.d.ts +5 -5
  31. package/dist/services/jsonFileStorage.d.ts.map +1 -1
  32. package/dist/services/jsonFileStorage.js +1 -1
  33. package/dist/services/telegramApi.d.ts +1 -12
  34. package/dist/services/telegramApi.d.ts.map +1 -1
  35. package/dist/services/telegramApi.js +7 -10
  36. package/dist/types/actionWithState.d.ts +2 -2
  37. package/dist/types/actionWithState.d.ts.map +1 -1
  38. package/dist/types/response.d.ts +5 -2
  39. package/dist/types/response.d.ts.map +1 -1
  40. package/dist/types/response.js +2 -1
  41. package/dist/types/storage.d.ts +4 -4
  42. package/dist/types/storage.d.ts.map +1 -1
  43. package/entities/actionExecutionResult.ts +3 -3
  44. package/entities/actions/commandAction.ts +12 -5
  45. package/entities/actions/scheduledAction.ts +11 -3
  46. package/entities/botInstance.ts +4 -2
  47. package/entities/context/chatContext.ts +32 -15
  48. package/entities/context/messageContext.ts +13 -13
  49. package/entities/responses/delay.ts +25 -0
  50. package/entities/responses/imageMessage.ts +3 -2
  51. package/entities/responses/reaction.ts +3 -2
  52. package/entities/responses/textMessage.ts +3 -2
  53. package/entities/responses/unpin.ts +3 -2
  54. package/entities/responses/videoMessage.ts +3 -2
  55. package/package.json +1 -1
  56. package/services/jsonFileStorage.ts +22 -13
  57. package/services/telegramApi.ts +5 -23
  58. package/types/actionWithState.ts +2 -2
  59. package/types/response.ts +6 -2
  60. package/types/storage.ts +9 -6
@@ -1,7 +1,7 @@
1
1
  import { IActionState } from '../types/actionState';
2
- export declare class ActionExecutionResult {
3
- data: IActionState;
2
+ export declare class ActionExecutionResult<TActionState extends IActionState> {
3
+ data: TActionState;
4
4
  shouldUpdate: boolean;
5
- constructor(data: IActionState, shouldUpdate: boolean);
5
+ constructor(data: TActionState, shouldUpdate: boolean);
6
6
  }
7
7
  //# sourceMappingURL=actionExecutionResult.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"actionExecutionResult.d.ts","sourceRoot":"","sources":["../../entities/actionExecutionResult.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,qBAAa,qBAAqB;IAC9B,IAAI,EAAE,YAAY,CAAC;IACnB,YAAY,EAAE,OAAO,CAAC;gBAEV,IAAI,EAAE,YAAY,EAAE,YAAY,EAAE,OAAO;CAIxD"}
1
+ {"version":3,"file":"actionExecutionResult.d.ts","sourceRoot":"","sources":["../../entities/actionExecutionResult.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,qBAAa,qBAAqB,CAAC,YAAY,SAAS,YAAY;IAChE,IAAI,EAAE,YAAY,CAAC;IACnB,YAAY,EAAE,OAAO,CAAC;gBAEV,IAAI,EAAE,YAAY,EAAE,YAAY,EAAE,OAAO;CAIxD"}
@@ -5,7 +5,7 @@ import { IActionState } from '../../types/actionState';
5
5
  import { IActionWithState, ActionKey } from '../../types/actionWithState';
6
6
  import { MessageContext } from '../context/messageContext';
7
7
  import { CommandTrigger } from '../../types/commandTrigger';
8
- export declare class CommandAction<TActionState extends IActionState> implements IActionWithState {
8
+ export declare class CommandAction<TActionState extends IActionState> implements IActionWithState<TActionState> {
9
9
  triggers: CommandTrigger[];
10
10
  handler: CommandHandler<TActionState>;
11
11
  name: string;
@@ -17,7 +17,7 @@ export declare class CommandAction<TActionState extends IActionState> implements
17
17
  stateConstructor: () => TActionState;
18
18
  key: ActionKey;
19
19
  constructor(trigger: CommandTrigger | CommandTrigger[], handler: CommandHandler<TActionState>, name: string, active: boolean, cooldown: Seconds, chatsBlacklist: number[], allowedUsers: number[], condition: CommandCondition<TActionState>, stateConstructor: () => TActionState);
20
- exec(ctx: MessageContext<TActionState>): Promise<void>;
20
+ exec(ctx: MessageContext<TActionState>): Promise<import("../../types/response").BotResponse[]>;
21
21
  private checkTrigger;
22
22
  }
23
23
  //# sourceMappingURL=commandAction.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"commandAction.d.ts","sourceRoot":"","sources":["../../../entities/actions/commandAction.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OA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
25
25
  }
26
26
  async exec(ctx) {
27
27
  if (!ctx.isInitialized)
28
- throw new Error('Context is not initialized');
28
+ throw new Error(`Context for ${this.key} is not initialized or already consumed`);
29
29
  if (!this.active || this.chatsBlacklist.includes(ctx.chatId))
30
- return;
30
+ return [];
31
31
  const isConditionMet = await this.condition(ctx);
32
32
  if (!isConditionMet)
33
- return;
33
+ return [];
34
34
  const state = await ctx.storage.getActionState(this, ctx.chatId);
35
35
  const { shouldTrigger, matchResults, skipCooldown } = this.triggers
36
36
  .map((x) => this.checkTrigger(ctx, x, state))
37
37
  .reduce((acc, curr) => acc.mergeWith(curr), commandTriggerCheckResult_1.CommandTriggerCheckResult.DoNotTrigger);
38
38
  if (!shouldTrigger)
39
- return;
39
+ return [];
40
40
  logger_1.Logger.logWithTraceId(ctx.botName, ctx.traceId, ctx.chatName, ` - Executing [${this.name}] in ${ctx.chatId}`);
41
41
  ctx.matchResults = matchResults;
42
42
  await this.handler(ctx, state);
@@ -48,6 +48,8 @@ class CommandAction {
48
48
  }
49
49
  ctx.updateActions.forEach((action) => action(state));
50
50
  await ctx.storage.saveActionExecutionResult(this, ctx.chatId, new actionExecutionResult_1.ActionExecutionResult(state, ctx.startCooldown && shouldTrigger));
51
+ ctx.isInitialized = false;
52
+ return ctx.responses;
51
53
  }
52
54
  checkTrigger(ctx, trigger, state) {
53
55
  let shouldTrigger = false;
@@ -5,7 +5,7 @@ import { IActionState } from '../../types/actionState';
5
5
  import { IActionWithState, ActionKey } from '../../types/actionWithState';
6
6
  import { CachedStateFactory } from '../cachedStateFactory';
7
7
  import { ChatContext } from '../context/chatContext';
8
- export declare class ScheduledAction<TActionState extends IActionState> implements IActionWithState {
8
+ export declare class ScheduledAction<TActionState extends IActionState> implements IActionWithState<TActionState> {
9
9
  static locks: Map<string, Semaphore>;
10
10
  name: string;
11
11
  timeinHours: HoursOfDay;
@@ -17,7 +17,7 @@ export declare class ScheduledAction<TActionState extends IActionState> implemen
17
17
  cachedStateFactories: Map<string, CachedStateFactory>;
18
18
  handler: ScheduledHandler<TActionState>;
19
19
  constructor(name: string, handler: ScheduledHandler<TActionState>, timeinHours: HoursOfDay, active: boolean, whitelist: number[], cachedStateFactories: Map<string, CachedStateFactory>, stateConstructor: () => TActionState);
20
- exec(ctx: ChatContext<TActionState>): Promise<void>;
20
+ exec(ctx: ChatContext<TActionState>): Promise<import("../../types/response").BotResponse[]>;
21
21
  private getCachedValue;
22
22
  private shouldTrigger;
23
23
  }
@@ -1 +1 @@
1
- {"version":3,"file":"scheduledAction.d.ts","sourceRoot":"","sources":["../../../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;AAExD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAC1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAKrD,qBAAa,eAAe,CAAC,YAAY,SAAS,YAAY,CAC1D,YAAW,gBAAgB;IAE3B,MAAM,CAAC,KAAK,yBAAgC;IAE5C,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,UAAU,CAAC;IACxB,MAAM,EAAE,OAAO,CAAC;IAChB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,GAAG,EAAE,SAAS,CAAC;IAEf,WAAW,uBAA8B;IACzC,gBAAgB,EAAE,MAAM,YAAY,CAAC;IACrC,oBAAoB,EAAE,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IACtD,OAAO,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAC;gBAGpC,IAAI,EAAE,MAAM,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AAC;gBAGpC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,gBAAgB,CAAC,YAAY,CAAC,EACvC,WAAW,EAAE,UAAU,EACvB,MAAM,EAAE,OAAO,EACf,SAAS,EAAE,MAAM,EAAE,EACnB,oBAAoB,EAAE,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,EACrD,gBAAgB,EAAE,MAAM,YAAY;IAYlC,IAAI,CAAC,GAAG,EAAE,WAAW,CAAC,YAAY,CAAC;YA6C3B,cAAc;IA8C5B,OAAO,CAAC,aAAa;CAaxB"}
@@ -24,9 +24,9 @@ class ScheduledAction {
24
24
  }
25
25
  async exec(ctx) {
26
26
  if (!ctx.isInitialized)
27
- throw new Error('Context is not initialized');
27
+ throw new Error(`Context for ${this.key} is not initialized or already consumed`);
28
28
  if (!this.active || !this.chatsWhitelist.includes(ctx.chatId))
29
- return;
29
+ return [];
30
30
  const state = await ctx.storage.getActionState(this, ctx.chatId);
31
31
  const isAllowedToTrigger = this.shouldTrigger(state);
32
32
  if (isAllowedToTrigger) {
@@ -36,6 +36,8 @@ class ScheduledAction {
36
36
  ctx.updateActions.forEach((action) => action(state));
37
37
  await ctx.storage.saveActionExecutionResult(this, ctx.chatId, new actionExecutionResult_1.ActionExecutionResult(state, isAllowedToTrigger));
38
38
  }
39
+ ctx.isInitialized = false;
40
+ return ctx.responses;
39
41
  }
40
42
  async getCachedValue(key, botName) {
41
43
  if (!this.cachedStateFactories.has(key)) {
@@ -1 +1 @@
1
- {"version":3,"file":"botInstance.d.ts","sourceRoot":"","sources":["../../entities/botInstance.ts"],"names":[],"mappings":"AAKA,OAAO,EAAuB,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGlD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAA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CAAW;IAC3B,OAAO,CAAC,QAAQ,CAAgC;IAChD,OAAO,CAAC,SAAS,CAAkC;IACnD,OAAO,CAAC,KAAK,CAAyB;IACtC,OAAO,EAAE,cAAc,CAAC;gBAEZ,OAAO,EAAE;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,aAAa,CAAC,YAAY,CAAC,EAAE,CAAC;QACxC,SAAS,EAAE,eAAe,CAAC,YAAY,CAAC,EAAE,CAAC;QAC3C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC9B,aAAa,CAAC,EAAE,cAAc,CAAC;QAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,eAAe,CAAC,EAAE,OAAO,CAAC;QAC1B,gCAAgC,CAAC,EAAE,OAAO,CAAC;KAC9C;IAqCD,OAAO,CAAC,6BAA6B;IA2CrC,OAAO,CAAC,2BAA2B;IAiC7B,IAAI,CAAC,IAAI,EAAE,MAAM;YAYT,YAAY;YAyBZ,cAAc;CAsB/B"}
@@ -81,7 +81,8 @@ class BotInstance {
81
81
  for (const scheduledAction of this.scheduled) {
82
82
  this.api.initializeContextForChat(ctx, chatId, scheduledAction);
83
83
  try {
84
- await scheduledAction.exec(ctx);
84
+ const responses = await scheduledAction.exec(ctx);
85
+ this.api.enqueueBatchedResponses(responses);
85
86
  }
86
87
  catch (error) {
87
88
  logger_1.Logger.errorWithTraceId(ctx.botName, ctx.traceId, chatName, error, ctx);
@@ -95,7 +96,8 @@ class BotInstance {
95
96
  for (const commandAction of this.commands) {
96
97
  this.api.initializeContextForMessage(ctx, msg, commandAction);
97
98
  try {
98
- await commandAction.exec(ctx);
99
+ const responses = await commandAction.exec(ctx);
100
+ this.api.enqueueBatchedResponses(responses);
99
101
  }
100
102
  catch (error) {
101
103
  logger_1.Logger.errorWithTraceId(ctx.botName, ctx.traceId, ctx.chatName, error, ctx);
@@ -1,13 +1,14 @@
1
- import { IBotApiInteractions } from '../../services/telegramApi';
2
1
  import { IStorageClient } from '../../types/storage';
3
2
  import { MessageSendingOptions, TextMessageSendingOptions } from '../../types/messageSendingOptions';
4
3
  import { IActionWithState } from '../../types/actionWithState';
4
+ import { IActionState } from '../../types/actionState';
5
+ import { BotResponse } from '../../types/response';
6
+ import { Milliseconds } from '../../types/timeValues';
5
7
  /**
6
8
  * Context of action executed in chat.
7
9
  */
8
- export declare class ChatContext<TActionState> {
9
- protected action: IActionWithState;
10
- protected interactions: IBotApiInteractions;
10
+ export declare class ChatContext<TActionState extends IActionState> {
11
+ protected action: IActionWithState<TActionState>;
11
12
  updateActions: Array<(state: TActionState) => void>;
12
13
  /** Trace id of a action execution. */
13
14
  traceId: number | string;
@@ -19,36 +20,47 @@ export declare class ChatContext<TActionState> {
19
20
  chatName: string;
20
21
  /** Storage client instance for this bot. */
21
22
  storage: IStorageClient;
23
+ /** Ordered collection of responses to be processed */
24
+ responses: BotResponse[];
22
25
  isInitialized: boolean;
23
26
  constructor();
24
- initializeChatContext(botName: string, action: IActionWithState, interactions: IBotApiInteractions, chatId: number, chatName: string, traceId: number | string, storage: IStorageClient): this;
27
+ initializeChatContext(botName: string, action: IActionWithState<TActionState>, chatId: number, chatName: string, traceId: number | string, storage: IStorageClient): this;
25
28
  /**
26
29
  * Manually update the state of an action.
27
30
  * @param stateUpdateAction Function that will modify state.
28
31
  */
29
32
  updateState(stateUpdateAction: (state: TActionState) => void): void;
30
33
  /**
31
- * Sends text message to chat.
34
+ * Sends text message to chat after action execution is finished.
35
+ * 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.
32
36
  * @param text Message contents.
33
37
  * @param options Message sending option.
34
38
  */
35
39
  sendTextToChat(text: string, options?: TextMessageSendingOptions): void;
36
40
  /**
37
- * Sends image message to chat.
41
+ * Sends image message to chat after action execution is finished.
42
+ * 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.
38
43
  * @param name Message contents.
39
44
  * @param options Message sending option.
40
45
  */
41
46
  sendImageToChat(name: string, options?: MessageSendingOptions): void;
42
47
  /**
43
- * Sends video/gif message to chat.
48
+ * Sends video/gif message to chat after action execution is finished.
49
+ * 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.
44
50
  * @param name Message contents.
45
51
  * @param options Message sending option.
46
52
  */
47
53
  sendVideoToChat(name: string, options?: MessageSendingOptions): void;
48
54
  /**
49
- * Unpins message.
55
+ * Unpins message after action execution is finished.
56
+ * 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.
50
57
  * @param messageId Message id.
51
58
  */
52
59
  unpinMessage(messageId: number): void;
60
+ /**
61
+ * Delays next response by specified amount of time.
62
+ * @param delay Delay in milliseconds.
63
+ */
64
+ delayNextResponse(delay: Milliseconds): void;
53
65
  }
54
66
  //# sourceMappingURL=chatContext.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"chatContext.d.ts","sourceRoot":"","sources":["../../../entities/context/chatContext.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAKrD,OAAO,EACH,qBAAqB,EACrB,yBAAyB,EAC5B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D;;GAEG;AACH,qBAAa,WAAW,CAAC,YAAY;IACjC,SAAS,CAAC,MAAM,EAAG,gBAAgB,CAAC;IACpC,SAAS,CAAC,YAAY,EAAG,mBAAmB,CAAC;IAC7C,aAAa,EAAE,KAAK,CAAC,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC,CAAM;IACzD,sCAAsC;IACtC,OAAO,EAAG,MAAM,GAAG,MAAM,CAAC;IAC1B,+CAA+C;IAC/C,OAAO,EAAG,MAAM,CAAC;IACjB,+CAA+C;IAC/C,MAAM,E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,CAAC,CAAC;IAClD,aAAa,EAAE,KAAK,CAAC,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC,CAAM;IACzD,sCAAsC;IACtC,OAAO,EAAG,MAAM,GAAG,MAAM,CAAC;IAC1B,+CAA+C;IAC/C,OAAO,EAAG,MAAM,CAAC;IACjB,+CAA+C;IAC/C,MAAM,EAAG,MAAM,CAAC;IAChB,iDAAiD;IACjD,QAAQ,EAAG,MAAM,CAAC;IAClB,4CAA4C;IAC5C,OAAO,EAAG,cAAc,CAAC;IACzB,uDAAuD;IACvD,SAAS,EAAE,WAAW,EAAE,CAAM;IAE9B,aAAa,UAAS;;IAItB,qBAAqB,CACjB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,gBAAgB,CAAC,YAAY,CAAC,EACtC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,GAAG,MAAM,EACxB,OAAO,EAAE,cAAc;IAgB3B;;;OAGG;IACH,WAAW,CAAC,iBAAiB,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI;IAI5D;;;;;OAKG;IACH,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,yBAAyB;IAahE;;;;;OAKG;IACH,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,qBAAqB;IAc7D;;;;;OAKG;IACH,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,qBAAqB;IAc7D;;;;OAIG;IACH,YAAY,CAAC,SAAS,EAAE,MAAM;IAM9B;;;OAGG;IACH,iBAAiB,CAAC,KAAK,EAAE,YAAY;CAKxC"}
@@ -6,24 +6,27 @@ const imageMessage_1 = require("../responses/imageMessage");
6
6
  const textMessage_1 = require("../responses/textMessage");
7
7
  const videoMessage_1 = require("../responses/videoMessage");
8
8
  const unpin_1 = require("../responses/unpin");
9
+ const delay_1 = require("../responses/delay");
9
10
  /**
10
11
  * Context of action executed in chat.
11
12
  */
12
13
  class ChatContext {
13
14
  constructor() {
14
15
  this.updateActions = [];
16
+ /** Ordered collection of responses to be processed */
17
+ this.responses = [];
15
18
  this.isInitialized = false;
16
19
  }
17
- initializeChatContext(botName, action, interactions, chatId, chatName, traceId, storage) {
20
+ initializeChatContext(botName, action, chatId, chatName, traceId, storage) {
18
21
  this.botName = botName;
19
22
  this.action = action;
20
- this.interactions = interactions;
21
23
  this.chatId = chatId;
22
24
  this.chatName = chatName;
23
25
  this.traceId = traceId;
24
26
  this.storage = storage;
25
27
  this.updateActions = [];
26
28
  this.isInitialized = true;
29
+ this.responses = [];
27
30
  return this;
28
31
  }
29
32
  /**
@@ -34,37 +37,48 @@ class ChatContext {
34
37
  this.updateActions.push(stateUpdateAction);
35
38
  }
36
39
  /**
37
- * Sends text message to chat.
40
+ * Sends text message to chat after action execution is finished.
41
+ * 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.
38
42
  * @param text Message contents.
39
43
  * @param options Message sending option.
40
44
  */
41
45
  sendTextToChat(text, options) {
42
- this.interactions.respond(new textMessage_1.TextMessage(text, this.chatId, undefined, this.traceId, this.action, options));
46
+ this.responses.push(new textMessage_1.TextMessage(text, this.chatId, undefined, this.traceId, this.action, options));
43
47
  }
44
48
  /**
45
- * Sends image message to chat.
49
+ * Sends image message to chat after action execution is finished.
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.
46
51
  * @param name Message contents.
47
52
  * @param options Message sending option.
48
53
  */
49
54
  sendImageToChat(name, options) {
50
55
  const filePath = `./content/${name}.png`;
51
- this.interactions.respond(new imageMessage_1.ImageMessage({ source: (0, path_1.resolve)(filePath) }, this.chatId, undefined, this.traceId, this.action, options));
56
+ this.responses.push(new imageMessage_1.ImageMessage({ source: (0, path_1.resolve)(filePath) }, this.chatId, undefined, this.traceId, this.action, options));
52
57
  }
53
58
  /**
54
- * Sends video/gif message to chat.
59
+ * Sends video/gif message to chat after action execution is finished.
60
+ * 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.
55
61
  * @param name Message contents.
56
62
  * @param options Message sending option.
57
63
  */
58
64
  sendVideoToChat(name, options) {
59
65
  const filePath = `./content/${name}.mp4`;
60
- this.interactions.respond(new videoMessage_1.VideoMessage({ source: (0, path_1.resolve)(filePath) }, this.chatId, undefined, this.traceId, this.action, options));
66
+ this.responses.push(new videoMessage_1.VideoMessage({ source: (0, path_1.resolve)(filePath) }, this.chatId, undefined, this.traceId, this.action, options));
61
67
  }
62
68
  /**
63
- * Unpins message.
69
+ * Unpins message after action execution is finished.
70
+ * 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.
64
71
  * @param messageId Message id.
65
72
  */
66
73
  unpinMessage(messageId) {
67
- this.interactions.unpin(new unpin_1.UnpinResponse(messageId, this.chatId, this.traceId, this.action));
74
+ this.responses.push(new unpin_1.UnpinResponse(messageId, this.chatId, this.traceId, this.action));
75
+ }
76
+ /**
77
+ * Delays next response by specified amount of time.
78
+ * @param delay Delay in milliseconds.
79
+ */
80
+ delayNextResponse(delay) {
81
+ this.responses.push(new delay_1.DelayResponse(delay, this.chatId, this.traceId, this.action));
68
82
  }
69
83
  }
70
84
  exports.ChatContext = ChatContext;
@@ -1,4 +1,3 @@
1
- import { IBotApiInteractions } from '../../services/telegramApi';
2
1
  import { TelegramEmoji } from 'telegraf/types';
3
2
  import { IStorageClient } from '../../types/storage';
4
3
  import { IActionState } from '../../types/actionState';
@@ -26,7 +25,7 @@ export declare class MessageContext<TActionState extends IActionState> extends C
26
25
  /** Type of message being received */
27
26
  messageType: MessageTypeValue;
28
27
  constructor();
29
- initializeMessageContext(botName: string, action: IActionWithState, interactions: IBotApiInteractions, message: IncomingMessage, storage: IStorageClient): this;
28
+ initializeMessageContext(botName: string, action: IActionWithState<TActionState>, message: IncomingMessage, storage: IStorageClient): this;
30
29
  /**
31
30
  * Loads state of another action. Changes to the loaded state will no affect actual state of other action.
32
31
  * @param commandName Name of an action to load state of.
@@ -34,25 +33,29 @@ export declare class MessageContext<TActionState extends IActionState> extends C
34
33
  */
35
34
  loadStateOf<TAnotherActionState extends IActionState>(commandName: string): Promise<TAnotherActionState>;
36
35
  /**
37
- * Reply with text message to message that triggered this action.
36
+ * Reply with text message to message that triggered this action after action execution is finished.
37
+ * 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.
38
38
  * @param text Message contents.
39
39
  * @param options Message sending option.
40
40
  */
41
41
  replyWithText(text: string, options?: TextMessageSendingOptions): void;
42
42
  /**
43
- * Reply with image message to message that triggered this action.
43
+ * Reply with image message to message that triggered this action after action execution is finished.
44
+ * 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.
44
45
  * @param text Message contents.
45
46
  * @param options Message sending option.
46
47
  */
47
48
  replyWithImage(name: string, options?: MessageSendingOptions): void;
48
49
  /**
49
- * Reply with video/gif message to message that triggered this action.
50
+ * Reply with video/gif message to message that triggered this action after action execution is finished.
51
+ * 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.
50
52
  * @param text Message contents.
51
53
  * @param options Message sending option.
52
54
  */
53
55
  replyWithVideo(name: string, options?: MessageSendingOptions): void;
54
56
  /**
55
- * React to the message that triggered this action.
57
+ * React to the message that triggered this action after action execution is finished.
58
+ * 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
59
  * @param emoji Telegram emoji to react with.
57
60
  */
58
61
  react(emoji: TelegramEmoji): void;
@@ -1 +1 @@
1
- {"version":3,"file":"messageContext.d.ts","sourceRoot":"","sources":["../../../entities/context/messageContext.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAA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WAAW,EAAE,MAAM,GACpB,OAAO,CAAC,mBAAmB,CAAC;IAe/B;;;;;OAKG;IACH,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,yBAAyB;IAa/D;;;;;OAKG;IACH,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,qBAAqB;IAc5D;;;;;OAKG;IACH,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,qBAAqB;IAc5D;;;;OAIG;IACH,KAAK,CAAC,KAAK,EAAE,aAAa;CAW7B"}
@@ -19,7 +19,7 @@ class MessageContext extends chatContext_1.ChatContext {
19
19
  /** Indicates if cooldown should be started after action is executed. Set to `true` by default. */
20
20
  this.startCooldown = true;
21
21
  }
22
- initializeMessageContext(botName, action, interactions, message, storage) {
22
+ initializeMessageContext(botName, action, message, storage) {
23
23
  this.messageId = message.message_id;
24
24
  this.messageText = message.text ?? '';
25
25
  this.messageType = message.type;
@@ -29,7 +29,7 @@ class MessageContext extends chatContext_1.ChatContext {
29
29
  (message.from?.last_name ? ` ${message.from.last_name}` : '');
30
30
  this.matchResults = [];
31
31
  this.startCooldown = true;
32
- return this.initializeChatContext(botName, action, interactions, message.chat.id, message.chatName, message.traceId, storage);
32
+ return this.initializeChatContext(botName, action, message.chat.id, message.chatName, message.traceId, storage);
33
33
  }
34
34
  /**
35
35
  * Loads state of another action. Changes to the loaded state will no affect actual state of other action.
@@ -46,37 +46,41 @@ class MessageContext extends chatContext_1.ChatContext {
46
46
  return stateForChat;
47
47
  }
48
48
  /**
49
- * Reply with text message to message that triggered this action.
49
+ * Reply with text message to message that triggered this action after action execution is finished.
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.
50
51
  * @param text Message contents.
51
52
  * @param options Message sending option.
52
53
  */
53
54
  replyWithText(text, options) {
54
- this.interactions.respond(new textMessage_1.TextMessage(text, this.chatId, this.messageId, this.traceId, this.action, options));
55
+ this.responses.push(new textMessage_1.TextMessage(text, this.chatId, this.messageId, this.traceId, this.action, options));
55
56
  }
56
57
  /**
57
- * Reply with image message to message that triggered this action.
58
+ * Reply with image message to message that triggered this action after action execution is finished.
59
+ * 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
60
  * @param text Message contents.
59
61
  * @param options Message sending option.
60
62
  */
61
63
  replyWithImage(name, options) {
62
64
  const filePath = `./content/${name}.png`;
63
- this.interactions.respond(new imageMessage_1.ImageMessage({ source: (0, path_1.resolve)(filePath) }, this.chatId, this.messageId, this.traceId, this.action, options));
65
+ this.responses.push(new imageMessage_1.ImageMessage({ source: (0, path_1.resolve)(filePath) }, this.chatId, this.messageId, this.traceId, this.action, options));
64
66
  }
65
67
  /**
66
- * Reply with video/gif message to message that triggered this action.
68
+ * Reply with video/gif message to message that triggered this action after action execution is finished.
69
+ * 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.
67
70
  * @param text Message contents.
68
71
  * @param options Message sending option.
69
72
  */
70
73
  replyWithVideo(name, options) {
71
74
  const filePath = `./content/${name}.mp4`;
72
- this.interactions.respond(new videoMessage_1.VideoMessage({ source: (0, path_1.resolve)(filePath) }, this.chatId, this.messageId, this.traceId, this.action, options));
75
+ this.responses.push(new videoMessage_1.VideoMessage({ source: (0, path_1.resolve)(filePath) }, this.chatId, this.messageId, this.traceId, this.action, options));
73
76
  }
74
77
  /**
75
- * React to the message that triggered this action.
78
+ * React to the message that triggered this action after action execution is finished.
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.
76
80
  * @param emoji Telegram emoji to react with.
77
81
  */
78
82
  react(emoji) {
79
- this.interactions.react(new reaction_1.Reaction(this.traceId, this.chatId, this.messageId, emoji, this.action));
83
+ this.responses.push(new reaction_1.Reaction(this.traceId, this.chatId, this.messageId, emoji, this.action));
80
84
  }
81
85
  }
82
86
  exports.MessageContext = MessageContext;
@@ -0,0 +1,13 @@
1
+ import { IActionState } from '../../types/actionState';
2
+ import { IActionWithState } from '../../types/actionWithState';
3
+ import { IChatResponse } from '../../types/response';
4
+ import { Milliseconds } from '../../types/timeValues';
5
+ export declare class DelayResponse implements IChatResponse {
6
+ kind: "delay";
7
+ chatId: number;
8
+ traceId: number | string;
9
+ delay: Milliseconds;
10
+ action: IActionWithState<IActionState>;
11
+ constructor(delay: Milliseconds, chatId: number, traceId: number | string, action: IActionWithState<IActionState>);
12
+ }
13
+ //# sourceMappingURL=delay.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delay.d.ts","sourceRoot":"","sources":["../../../entities/responses/delay.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAoB,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,qBAAa,aAAc,YAAW,aAAa;IAC/C,IAAI,UAA0B;IAE9B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,KAAK,EAAE,YAAY,CAAC;IACpB,MAAM,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAC;gBAGnC,KAAK,EAAE,YAAY,EACnB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,GAAG,MAAM,EACxB,MAAM,EAAE,gBAAgB,CAAC,YAAY,CAAC;CAO7C"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DelayResponse = void 0;
4
+ const response_1 = require("../../types/response");
5
+ class DelayResponse {
6
+ constructor(delay, chatId, traceId, action) {
7
+ this.kind = response_1.BotResponseTypes.delay;
8
+ this.chatId = chatId;
9
+ this.delay = delay;
10
+ this.traceId = traceId;
11
+ this.action = action;
12
+ }
13
+ }
14
+ exports.DelayResponse = DelayResponse;
@@ -2,6 +2,7 @@ import { InputFile } from 'telegraf/types';
2
2
  import { IReplyMessage } from '../../types/response';
3
3
  import { MessageSendingOptions } from '../../types/messageSendingOptions';
4
4
  import { IActionWithState } from '../../types/actionWithState';
5
+ import { IActionState } from '../../types/actionState';
5
6
  export declare class ImageMessage implements IReplyMessage<InputFile> {
6
7
  kind: "image";
7
8
  content: InputFile;
@@ -10,7 +11,7 @@ export declare class ImageMessage implements IReplyMessage<InputFile> {
10
11
  traceId: string | number;
11
12
  disableWebPreview: boolean;
12
13
  shouldPin: boolean;
13
- action: IActionWithState;
14
- constructor(image: InputFile, chatId: number, replyId: number | undefined, traceId: number | string, action: IActionWithState, options?: MessageSendingOptions);
14
+ action: IActionWithState<IActionState>;
15
+ constructor(image: InputFile, chatId: number, replyId: number | undefined, traceId: number | string, action: IActionWithState<IActionState>, options?: MessageSendingOptions);
15
16
  }
16
17
  //# sourceMappingURL=imageMessage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"imageMessage.d.ts","sourceRoot":"","sources":["../../../entities/responses/imageMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAoB,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D,qBAAa,YAAa,YAAW,aAAa,CAAC,SAAS,CAAC;IACzD,IAAI,UAA0B;IAE9B,OAAO,EAAE,SAAS,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,iBAAiB,UAAS;IAC1B,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,gBAAgB,CAAC;gBAGrB,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,OAAO,EAAE,MAAM,GAAG,MAAM,EACxB,MAAM,EAAE,gBAAgB,EACxB,OAAO,CAAC,EAAE,qBAAqB;CAStC"}
1
+ {"version":3,"file":"imageMessage.d.ts","sourceRoot":"","sources":["../../../entities/responses/imageMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAoB,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,qBAAa,YAAa,YAAW,aAAa,CAAC,SAAS,CAAC;IACzD,IAAI,UAA0B;IAE9B,OAAO,EAAE,SAAS,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,iBAAiB,UAAS;IAC1B,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAC;gBAGnC,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,OAAO,EAAE,MAAM,GAAG,MAAM,EACxB,MAAM,EAAE,gBAAgB,CAAC,YAAY,CAAC,EACtC,OAAO,CAAC,EAAE,qBAAqB;CAStC"}
@@ -1,13 +1,14 @@
1
1
  import { TelegramEmoji } from 'telegraf/types';
2
2
  import { IChatResponse } from '../../types/response';
3
3
  import { IActionWithState } from '../../types/actionWithState';
4
+ import { IActionState } from '../../types/actionState';
4
5
  export declare class Reaction implements IChatResponse {
5
6
  kind: "react";
6
7
  chatId: number;
7
8
  messageId: number;
8
9
  traceId: number | string;
9
10
  emoji: TelegramEmoji;
10
- action: IActionWithState;
11
- constructor(traceId: number | string, chatId: number, messageId: number, emoji: TelegramEmoji, action: IActionWithState);
11
+ action: IActionWithState<IActionState>;
12
+ constructor(traceId: number | string, chatId: number, messageId: number, emoji: TelegramEmoji, action: IActionWithState<IActionState>);
12
13
  }
13
14
  //# sourceMappingURL=reaction.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"reaction.d.ts","sourceRoot":"","sources":["../../../entities/responses/reaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAoB,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D,qBAAa,QAAS,YAAW,aAAa;IAC1C,IAAI,UAA0B;IAE9B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,KAAK,EAAE,aAAa,CAAC;IACrB,MAAM,EAAE,gBAAgB,CAAC;gBAGrB,OAAO,EAAE,MAAM,GAAG,MAAM,EACxB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,aAAa,EACpB,MAAM,EAAE,gBAAgB;CAQ/B"}
1
+ {"version":3,"file":"reaction.d.ts","sourceRoot":"","sources":["../../../entities/responses/reaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAoB,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,qBAAa,QAAS,YAAW,aAAa;IAC1C,IAAI,UAA0B;IAE9B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,KAAK,EAAE,aAAa,CAAC;IACrB,MAAM,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAC;gBAGnC,OAAO,EAAE,MAAM,GAAG,MAAM,EACxB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,aAAa,EACpB,MAAM,EAAE,gBAAgB,CAAC,YAAY,CAAC;CAQ7C"}
@@ -1,6 +1,7 @@
1
1
  import { TextMessageSendingOptions } from '../../types/messageSendingOptions';
2
2
  import { IReplyMessage } from '../../types/response';
3
3
  import { IActionWithState } from '../../types/actionWithState';
4
+ import { IActionState } from '../../types/actionState';
4
5
  export declare class TextMessage implements IReplyMessage<string> {
5
6
  kind: "text";
6
7
  content: string;
@@ -9,7 +10,7 @@ export declare class TextMessage implements IReplyMessage<string> {
9
10
  traceId: string | number;
10
11
  disableWebPreview: boolean;
11
12
  shouldPin: boolean;
12
- action: IActionWithState;
13
- constructor(text: string, chatId: number, replyId: number | undefined, traceId: string | number, action: IActionWithState, options?: TextMessageSendingOptions);
13
+ action: IActionWithState<IActionState>;
14
+ constructor(text: string, chatId: number, replyId: number | undefined, traceId: string | number, action: IActionWithState<IActionState>, options?: TextMessageSendingOptions);
14
15
  }
15
16
  //# sourceMappingURL=textMessage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"textMessage.d.ts","sourceRoot":"","sources":["../../../entities/responses/textMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,EAAoB,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D,qBAAa,WAAY,YAAW,aAAa,CAAC,MAAM,CAAC;IACrD,IAAI,SAAyB;IAE7B,OAAO,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BAAyB;CAU1C"}
@@ -1,11 +1,12 @@
1
1
  import { IChatResponse } from '../../types/response';
2
2
  import { IActionWithState } from '../../types/actionWithState';
3
+ import { IActionState } from '../../types/actionState';
3
4
  export declare class UnpinResponse implements IChatResponse {
4
5
  kind: "unpin";
5
6
  messageId: number;
6
7
  chatId: number;
7
8
  traceId: number | string;
8
- action: IActionWithState;
9
- constructor(messageId: number, chatId: number, traceId: number | string, action: IActionWithState);
9
+ action: IActionWithState<IActionState>;
10
+ constructor(messageId: number, chatId: number, traceId: number | string, action: IActionWithState<IActionState>);
10
11
  }
11
12
  //# sourceMappingURL=unpin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"unpin.d.ts","sourceRoot":"","sources":["../../../entities/responses/unpin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D,qBAAa,aAAc,YAAW,aAAa;IAC/C,IAAI,UAA0B;IAE9B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,MAAM,EAAE,gBAAgB,CAAC;gBAGrB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,GAAG,MAAM,EACxB,MAAM,EAAE,gBAAgB;CAO/B"}
1
+ {"version":3,"file":"unpin.d.ts","sourceRoot":"","sources":["../../../entities/responses/unpin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,qBAAa,aAAc,YAAW,aAAa;IAC/C,IAAI,UAA0B;IAE9B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,MAAM,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAC;gBAGnC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,GAAG,MAAM,EACxB,MAAM,EAAE,gBAAgB,CAAC,YAAY,CAAC;CAO7C"}
@@ -2,6 +2,7 @@ import { InputFile } from 'telegraf/types';
2
2
  import { IReplyMessage } from '../../types/response';
3
3
  import { MessageSendingOptions } from '../../types/messageSendingOptions';
4
4
  import { IActionWithState } from '../../types/actionWithState';
5
+ import { IActionState } from '../../types/actionState';
5
6
  export declare class VideoMessage implements IReplyMessage<InputFile> {
6
7
  kind: "video";
7
8
  content: InputFile;
@@ -10,7 +11,7 @@ export declare class VideoMessage implements IReplyMessage<InputFile> {
10
11
  traceId: string | number;
11
12
  disableWebPreview: boolean;
12
13
  shouldPin: boolean;
13
- action: IActionWithState;
14
- constructor(video: InputFile, chatId: number, replyId: number | undefined, traceId: number | string, action: IActionWithState, options?: MessageSendingOptions);
14
+ action: IActionWithState<IActionState>;
15
+ constructor(video: InputFile, chatId: number, replyId: number | undefined, traceId: number | string, action: IActionWithState<IActionState>, options?: MessageSendingOptions);
15
16
  }
16
17
  //# sourceMappingURL=videoMessage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"videoMessage.d.ts","sourceRoot":"","sources":["../../../entities/responses/videoMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAoB,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D,qBAAa,YAAa,YAAW,aAAa,CAAC,SAAS,CAAC;IACzD,IAAI,UAA0B;IAE9B,OAAO,EAAE,SAAS,C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