chz-telegram-bot 0.7.13 → 0.7.15

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 (98) hide show
  1. package/dist/dtos/propertyProviderSets.d.ts +0 -1
  2. package/dist/dtos/propertyProviderSets.d.ts.map +1 -1
  3. package/dist/entities/actions/commandAction.d.ts +1 -1
  4. package/dist/entities/actions/commandAction.d.ts.map +1 -1
  5. package/dist/entities/actions/commandAction.js +2 -2
  6. package/dist/helpers/builders/commandActionBuilder.d.ts.map +1 -1
  7. package/dist/helpers/builders/commandActionBuilder.js +2 -3
  8. package/package.json +4 -1
  9. package/eslint.config.ts +0 -62
  10. package/src/builtin/helpAction.ts +0 -17
  11. package/src/dtos/chatHistoryMessage.ts +0 -22
  12. package/src/dtos/chatInfo.ts +0 -12
  13. package/src/dtos/commandTriggerCheckResult.ts +0 -40
  14. package/src/dtos/cooldownInfo.ts +0 -10
  15. package/src/dtos/incomingMessage.ts +0 -71
  16. package/src/dtos/incomingQuery.ts +0 -14
  17. package/src/dtos/messageInfo.ts +0 -15
  18. package/src/dtos/propertyProviderSets.ts +0 -21
  19. package/src/dtos/replyInfo.ts +0 -9
  20. package/src/dtos/responses/delay.ts +0 -28
  21. package/src/dtos/responses/imageMessage.ts +0 -41
  22. package/src/dtos/responses/inlineQueryResponse.ts +0 -26
  23. package/src/dtos/responses/reaction.ts +0 -30
  24. package/src/dtos/responses/textMessage.ts +0 -44
  25. package/src/dtos/responses/unpin.ts +0 -27
  26. package/src/dtos/responses/videoMessage.ts +0 -41
  27. package/src/dtos/userInfo.ts +0 -8
  28. package/src/entities/actions/commandAction.ts +0 -275
  29. package/src/entities/actions/inlineQueryAction.ts +0 -83
  30. package/src/entities/actions/replyCaptureAction.ts +0 -110
  31. package/src/entities/actions/scheduledAction.ts +0 -182
  32. package/src/entities/botInstance.ts +0 -92
  33. package/src/entities/cachedStateFactory.ts +0 -14
  34. package/src/entities/context/baseContext.ts +0 -111
  35. package/src/entities/context/chatContext.ts +0 -135
  36. package/src/entities/context/inlineQueryContext.ts +0 -63
  37. package/src/entities/context/messageContext.ts +0 -250
  38. package/src/entities/context/replyContext.ts +0 -260
  39. package/src/entities/states/actionStateBase.ts +0 -6
  40. package/src/entities/taskRecord.ts +0 -11
  41. package/src/helpers/builders/commandActionBuilder.ts +0 -214
  42. package/src/helpers/builders/inlineQueryActionBuilder.ts +0 -71
  43. package/src/helpers/builders/scheduledActionBuilder.ts +0 -143
  44. package/src/helpers/mapUtils.ts +0 -28
  45. package/src/helpers/noop.ts +0 -20
  46. package/src/helpers/objectFromEntries.ts +0 -7
  47. package/src/helpers/timeConvertions.ts +0 -13
  48. package/src/helpers/toArray.ts +0 -3
  49. package/src/helpers/traceFactory.ts +0 -11
  50. package/src/index.ts +0 -33
  51. package/src/main.ts +0 -76
  52. package/src/services/actionProcessingService.ts +0 -125
  53. package/src/services/actionProcessors/baseProcessor.ts +0 -67
  54. package/src/services/actionProcessors/commandActionProcessor.ts +0 -231
  55. package/src/services/actionProcessors/inlineQueryActionProcessor.ts +0 -165
  56. package/src/services/actionProcessors/scheduledActionProcessor.ts +0 -136
  57. package/src/services/jsonFileStorage.ts +0 -181
  58. package/src/services/nodeTimeoutScheduler.ts +0 -79
  59. package/src/services/responseProcessingQueue.ts +0 -57
  60. package/src/services/telegramApi.ts +0 -278
  61. package/src/types/action.ts +0 -15
  62. package/src/types/actionState.ts +0 -4
  63. package/src/types/cachedValueAccessor.ts +0 -1
  64. package/src/types/capture.ts +0 -33
  65. package/src/types/commandCondition.ts +0 -9
  66. package/src/types/commandTrigger.ts +0 -1
  67. package/src/types/events.ts +0 -286
  68. package/src/types/externalAliases.ts +0 -18
  69. package/src/types/handlers.ts +0 -26
  70. package/src/types/inputFile.ts +0 -4
  71. package/src/types/messageSendingOptions.ts +0 -10
  72. package/src/types/messageTypes.ts +0 -21
  73. package/src/types/propertyProvider.ts +0 -14
  74. package/src/types/response.ts +0 -51
  75. package/src/types/scheduler.ts +0 -20
  76. package/src/types/storage.ts +0 -23
  77. package/src/types/timeValues.ts +0 -33
  78. package/src/types/trace.ts +0 -5
  79. package/tests/dtos/commandTriggerCheckResult.test.ts +0 -301
  80. package/tests/entities/actions/inlineQueryAction.test.ts +0 -359
  81. package/tests/entities/actions/replyCaptureAction.test.ts +0 -501
  82. package/tests/entities/cachedStateFactory.test.ts +0 -98
  83. package/tests/entities/context/chatContext.test.ts +0 -606
  84. package/tests/entities/context/messageContext.test.ts +0 -370
  85. package/tests/entities/states/actionStateBase.test.ts +0 -138
  86. package/tests/entities/taskRecord.test.ts +0 -195
  87. package/tests/helpers/mapUtils.test.ts +0 -163
  88. package/tests/helpers/timeConvertions.test.ts +0 -129
  89. package/tests/services/actionProcessors/baseActionProcessor.test.ts +0 -359
  90. package/tests/services/actionProcessors/commandActionProcessor.test.ts +0 -268
  91. package/tests/services/actionProcessors/inlineQueryActionProcessor.test.ts +0 -616
  92. package/tests/services/actionProcessors/processorTestHelpers.ts +0 -147
  93. package/tests/services/actionProcessors/scheduledActionProcessor.test.ts +0 -153
  94. package/tests/services/jsonFileStorage.test.ts +0 -927
  95. package/tests/services/nodeTimeoutScheduler.test.ts +0 -421
  96. package/tests/services/responseProcessingQueue.test.ts +0 -388
  97. package/tsconfig.build.json +0 -8
  98. package/tsconfig.json +0 -118
@@ -7,7 +7,6 @@ export type CommandActionProviders = {
7
7
  chatsBlacklistProvider: CommandActionPropertyProvider<number[]>;
8
8
  chatsWhitelistProvider: CommandActionPropertyProvider<number[]>;
9
9
  usersWhitelistProvider: CommandActionPropertyProvider<number[]>;
10
- maxAllowedSimultaniousExecutions: number;
11
10
  };
12
11
  export type ScheduledActionProviders = {
13
12
  timeinHoursProvider: ScheduledActionPropertyProvider<HoursOfDay>;
@@ -1 +1 @@
1
- {"version":3,"file":"propertyProviderSets.d.ts","sourceRoot":"","sources":["../../src/dtos/propertyProviderSets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,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IAChE,sBAAsB,EAAE,6BAA6B,CAAC,MAAM,EAAE,CAAC,CAAC;CACnE,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACnC,mBAAmB,EAAE,+BAA+B,CAAC,UAAU,CAAC,CAAC;IACjE,gBAAgB,EAAE,+BAA+B,CAAC,OAAO,CAAC,CAAC;IAC3D,sBAAsB,EAAE,+BAA+B,CAAC,MAAM,EAAE,CAAC,CAAC;CACrE,CAAC"}
@@ -23,7 +23,7 @@ export declare class CommandAction<TActionState extends IActionState> implements
23
23
  readonly stateConstructor: () => TActionState;
24
24
  readonly readmeFactory: (botName: string) => string;
25
25
  private lastCustomCooldown;
26
- constructor(trigger: CommandTrigger | CommandTrigger[], handler: CommandHandler<TActionState>, name: string, providers: CommandActionProviders, condition: CommandCondition<TActionState>, stateConstructor: () => TActionState, readmeFactory: (botName: string) => string);
26
+ constructor(trigger: CommandTrigger | CommandTrigger[], handler: CommandHandler<TActionState>, name: string, providers: CommandActionProviders, maxAllowedSimultaniousExecutions: number, condition: CommandCondition<TActionState>, stateConstructor: () => TActionState, readmeFactory: (botName: string) => string);
27
27
  exec(ctx: MessageContextInternal<TActionState>): Promise<BotResponse[]>;
28
28
  private checkIfShouldBeExecuted;
29
29
  private checkTrigger;
@@ -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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AQ,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;IAEpD,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;IAsBxC,IAAI,CACN,GAAG,EAAE,sBAAsB,CAAC,YAAY,CAAC,GAC1C,OAAO,CAAC,WAAW,EAAE,CAAC;IA2FzB,OAAO,CAAC,uBAAuB;IA6D/B,OAAO,CAAC,YAAY;CAuCvB"}
@@ -25,7 +25,7 @@ export class CommandAction {
25
25
  stateConstructor;
26
26
  readmeFactory;
27
27
  lastCustomCooldown;
28
- constructor(trigger, handler, name, providers, condition, stateConstructor, readmeFactory) {
28
+ constructor(trigger, handler, name, providers, maxAllowedSimultaniousExecutions, condition, stateConstructor, readmeFactory) {
29
29
  this.triggers = toArray(trigger);
30
30
  this.name = name;
31
31
  this.cooldownInfoProvider = providers.cooldownProvider;
@@ -38,7 +38,7 @@ export class CommandAction {
38
38
  this.stateConstructor = stateConstructor;
39
39
  this.readmeFactory = readmeFactory;
40
40
  this.maxAllowedSimultaniousExecutions =
41
- providers.maxAllowedSimultaniousExecutions;
41
+ maxAllowedSimultaniousExecutions;
42
42
  this.key = `command:${this.name.replace('.', '-')}`;
43
43
  }
44
44
  async exec(ctx) {
@@ -1 +1 @@
1
- {"version":3,"file":"commandActionBuilder.d.ts","sourceRoot":"","sources":["../../../src/helpers/builders/commandActionBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAGvD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,6BAA6B,EAAE,MAAM,8BAA8B,CAAC;AAE7E;;GAEG;AACH,qBAAa,6BAA6B,CAAC,YAAY,SAAS,YAAY;IACxE,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAS;IAC9B,OAAO,CAAC,OAAO,CAAyC;IAExD,OAAO,CAAC,cAAc,CAAsD;IAC5E,OAAO,CAAC,wBAAwB,CACS;IACzC,OAAO,CAAC,iBAAiB,CACZ;IACb,OAAO,CAAC,iBAAiB,CACZ;IACb,OAAO,CAAC,oBAAoB,CACf;IAEb,OAAO,CAAC,aAAa,CAAiD;IACtE,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAqB;IACtD,OAAO,CAAC,OAAO,CAA2C;IAC1D,OAAO,CAAC,SAAS,CAA6C;IAC9D,OAAO,CAAC,gCAAgC,CAAa;IAErD;;;;OAIG;gBACS,IAAI,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,YAAY;IAK9D;;;;;OAKG;IACH,EAAE,CAAC,OAAO,EAAE,cAAc,GAAG,cAAc,EAAE;IAM7C;;OAE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M,EAAE;IAMpB;;;OAGG;IACH,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE;IAMvB;;OAEG;IACH,EAAE,CAAC,OAAO,EAAE,cAAc,CAAC,YAAY,CAAC;IAMxC;;OAEG;IACH,IAAI,CAAC,SAAS,EAAE,gBAAgB,CAAC,YAAY,CAAC;IAM9C;;;OAGG;IACH,QAAQ,CAAC,aAAa,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM;IAMnD,iFAAiF;IACjF,QAAQ;IAMR,qHAAqH;IACrH,aAAa,CAAC,gCAAgC,EAAE,MAAM;IAOtD;;OAEG;IACH,YAAY,CAAC,gBAAgB,EAAE;QAAE,QAAQ,EAAE,OAAO,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE;IAUtE;;OAEG;IACH,iBAAiB,CACb,aAAa,EACP,mCAAmC,GACnC,CAAC,MAAM,mCAAmC,CAAC;IAwBrD,oBAAoB;IACpB,KAAK;CAkBR;AAED,MAAM,MAAM,mCAAmC,GAAG;IAC9C,gBAAgB,CAAC,EAAE,6BAA6B,CAAC,YAAY,CAAC,CAAC;IAC/D,gBAAgB,CAAC,EAAE,6BAA6B,CAAC,OAAO,CAAC,CAAC;IAC1D,sBAAsB,CAAC,EAAE,6BAA6B,CAAC,MAAM,EAAE,CAAC,CAAC;IACjE,sBAAsB,CAAC,EAAE,6BAA6B,CAAC,MAAM,EAAE,CAAC,CAAC;IACjE,sBAAsB,CAAC,EAAE,6BAA6B,CAAC,MAAM,EAAE,CAAC,CAAC;CACpE,CAAC;AAEF;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,6BAA6B,CAAC,eAAe,CAAC;IACpF;;OAEG;gBACS,IAAI,EAAE,MAAM;CAG3B"}
@@ -129,9 +129,8 @@ export class CommandActionBuilderWithState {
129
129
  isActiveProvider: this.activeProvider,
130
130
  chatsBlacklistProvider: this.blacklistProvider,
131
131
  chatsWhitelistProvider: this.whitelistProvider,
132
- usersWhitelistProvider: this.allowedUsersProvider,
133
- maxAllowedSimultaniousExecutions: this.maxAllowedSimultaniousExecutions
134
- }, this.condition, this.stateConstructor, this.readmeFactory);
132
+ usersWhitelistProvider: this.allowedUsersProvider
133
+ }, this.maxAllowedSimultaniousExecutions, this.condition, this.stateConstructor, this.readmeFactory);
135
134
  }
136
135
  }
137
136
  /**
package/package.json CHANGED
@@ -14,7 +14,7 @@
14
14
  "type": "git",
15
15
  "url": "https://github.com/AlexSolari/botFramework.git"
16
16
  },
17
- "version": "0.7.13",
17
+ "version": "0.7.15",
18
18
  "type": "module",
19
19
  "dependencies": {
20
20
  "async-sema": "^3.1.1",
@@ -23,6 +23,9 @@
23
23
  },
24
24
  "main": "dist/index.js",
25
25
  "types": "dist/index.d.ts",
26
+ "files": [
27
+ "dist"
28
+ ],
26
29
  "devDependencies": {
27
30
  "@eslint/js": "^9.39.4",
28
31
  "@types/bun": "^1.3.11",
package/eslint.config.ts DELETED
@@ -1,62 +0,0 @@
1
- /// <reference types="node" />
2
- import eslint from '@eslint/js';
3
- import tseslint from 'typescript-eslint';
4
- import parser from '@typescript-eslint/parser';
5
- import { defineConfig } from 'eslint/config';
6
- import { fileURLToPath } from 'node:url';
7
- import { dirname } from 'node:path';
8
-
9
- const __dirname = dirname(fileURLToPath(import.meta.url));
10
-
11
- export default defineConfig(
12
- {
13
- ignores: ['dist/**', 'eslint.config.ts']
14
- },
15
- eslint.configs.recommended,
16
- tseslint.configs.strictTypeChecked,
17
- {
18
- languageOptions: {
19
- parser,
20
- parserOptions: {
21
- tsconfigRootDir: __dirname,
22
- sourceType: 'module',
23
- projectService: true
24
- }
25
- },
26
- plugins: { '@typescript-eslint': tseslint.plugin },
27
- rules: {
28
- '@typescript-eslint/switch-exhaustiveness-check': 'error',
29
- '@typescript-eslint/no-unused-vars': [
30
- 'error',
31
- {
32
- args: 'all',
33
- argsIgnorePattern: '^_',
34
- caughtErrors: 'all',
35
- caughtErrorsIgnorePattern: '^_',
36
- destructuredArrayIgnorePattern: '^_',
37
- varsIgnorePattern: '^_',
38
- ignoreRestSiblings: true
39
- }
40
- ],
41
- '@typescript-eslint/no-misused-promises': [
42
- 'error',
43
- {
44
- checksVoidReturn: true,
45
- checksConditionals: true
46
- }
47
- ],
48
- '@typescript-eslint/restrict-template-expressions': [
49
- 'error',
50
- {
51
- allowNumber: true
52
- }
53
- ],
54
- '@typescript-eslint/unbound-method': [
55
- 'error',
56
- {
57
- ignoreStatic: true
58
- }
59
- ]
60
- }
61
- }
62
- );
@@ -1,17 +0,0 @@
1
- import { CommandActionBuilder } from '../helpers/builders/commandActionBuilder';
2
- import { Seconds } from '../types/timeValues';
3
-
4
- export function buildHelpCommand(readmes: string[], botUsername: string) {
5
- const helpCommandBuilder = new CommandActionBuilder('Reaction.Help')
6
- .on(['/help', `/help@${botUsername}`])
7
- .do((ctx) => {
8
- ctx.reply.withText(readmes.join('\n\n'));
9
- })
10
- .withCooldown({
11
- cooldown: 60 as Seconds
12
- });
13
-
14
- if (readmes.length == 0) helpCommandBuilder.disabled();
15
-
16
- return helpCommandBuilder.build();
17
- }
@@ -1,22 +0,0 @@
1
- import { TelegramUser } from '../types/externalAliases';
2
- import { MessageTypeValue } from '../types/messageTypes';
3
- import { TraceId } from '../types/trace';
4
-
5
- export class ChatHistoryMessage {
6
- constructor(
7
- /** The unique identifier for the message */
8
- readonly id: number,
9
- /** The user who sent the message */
10
- readonly from: TelegramUser | undefined,
11
- /** The content of the message */
12
- readonly text: string,
13
- /** The type of the message */
14
- readonly type: MessageTypeValue,
15
- /** The trace identifier for the message */
16
- readonly traceId: TraceId,
17
- /** The identifier for the message this message is replying to */
18
- readonly replyToId: number | undefined,
19
- /** The date the message was sent, represented as a Unix timestamp */
20
- readonly date: number
21
- ) {}
22
- }
@@ -1,12 +0,0 @@
1
- import { ChatHistoryMessage } from './chatHistoryMessage';
2
-
3
- export class ChatInfo {
4
- constructor(
5
- /** Id of a chat that action is executed in. */
6
- readonly id: number,
7
- /** Name of a chat that action is executed in. */
8
- readonly name: string,
9
- /** Last 100 messages in chat where action is executed */
10
- readonly messageHistory: ChatHistoryMessage[]
11
- ) {}
12
- }
@@ -1,40 +0,0 @@
1
- const _SkipTriggerReasonsObject = {
2
- UserIdMissing: 'UserIdMissing',
3
- UserForbidden: 'UserForbidden',
4
- OnCooldown: 'OnCooldown',
5
- CustomConditionNotMet: 'CustomConditionNotMet',
6
- TriggerNotSatisfied: 'TriggerNotSatisfied',
7
- Other: 'Other',
8
- ActionDisabled: 'ActionDisabled',
9
- ChatForbidden: 'ChatForbidden'
10
- } as const;
11
-
12
- export type SkipTriggerReasons = keyof typeof _SkipTriggerReasonsObject;
13
-
14
- export class CommandTriggerCheckResult {
15
- static DontTriggerAndSkipCooldown(reason: SkipTriggerReasons) {
16
- return new CommandTriggerCheckResult(false, [], true, reason);
17
- }
18
- static DoNotTrigger(reason: SkipTriggerReasons) {
19
- return new CommandTriggerCheckResult(false, [], false, reason);
20
- }
21
- static Trigger() {
22
- return new CommandTriggerCheckResult(true, [], false);
23
- }
24
-
25
- constructor(
26
- readonly shouldExecute: boolean,
27
- readonly matchResults: RegExpExecArray[],
28
- readonly skipCooldown: boolean,
29
- readonly reason?: SkipTriggerReasons
30
- ) {}
31
-
32
- mergeWith(other: CommandTriggerCheckResult) {
33
- return new CommandTriggerCheckResult(
34
- this.shouldExecute || other.shouldExecute,
35
- this.matchResults.concat(other.matchResults),
36
- this.skipCooldown || other.skipCooldown,
37
- other.reason
38
- );
39
- }
40
- }
@@ -1,10 +0,0 @@
1
- import { Seconds } from '../types/timeValues';
2
-
3
- export class CooldownInfo {
4
- constructor(
5
- /** Cooldown configuration */
6
- readonly cooldown: Seconds,
7
- /** Cooldown message to be shown */
8
- readonly message?: string
9
- ) {}
10
- }
@@ -1,71 +0,0 @@
1
- import { randomInt } from 'crypto';
2
- import { MessageType, MessageTypeValue } from '../types/messageTypes';
3
- import { ChatInfo } from './chatInfo';
4
- import { createTrace } from '../helpers/traceFactory';
5
- import { TraceId } from '../types/trace';
6
- import { ChatHistoryMessage } from './chatHistoryMessage';
7
- import { TelegramMessage, TelegramUser } from '../types/externalAliases';
8
-
9
- export class IncomingMessage {
10
- readonly messageId: number;
11
- readonly chatInfo: ChatInfo;
12
- readonly from: TelegramUser | undefined;
13
- readonly text: string;
14
- readonly type: MessageTypeValue;
15
- readonly traceId: TraceId;
16
- readonly replyToMessageId: number | undefined;
17
-
18
- readonly updateObject: TelegramMessage;
19
-
20
- private detectMessageType(message: TelegramMessage) {
21
- if ('forward_origin' in message) return MessageType.Forward;
22
- if ('text' in message) return MessageType.Text;
23
- if ('video' in message) return MessageType.Video;
24
- if ('photo' in message) return MessageType.Photo;
25
- if ('sticker' in message) return MessageType.Sticker;
26
- if ('animation' in message) return MessageType.Animation;
27
- if ('voice' in message) return MessageType.Voice;
28
- if ('audio' in message) return MessageType.Audio;
29
- if ('document' in message) return MessageType.Document;
30
- if ('left_chat_member' in message) return MessageType.LeftChatMember;
31
- if ('new_chat_member' in message) return MessageType.NewChatMember;
32
- if ('poll' in message) return MessageType.Poll;
33
- if ('location' in message) return MessageType.Location;
34
-
35
- return MessageType.Unknown;
36
- }
37
-
38
- constructor(
39
- ctxMessage: TelegramMessage,
40
- botName: string,
41
- history: ChatHistoryMessage[]
42
- ) {
43
- this.traceId = createTrace(
44
- this,
45
- botName,
46
- randomInt(10000, 99999).toString()
47
- );
48
- this.messageId = ctxMessage.message_id;
49
- this.replyToMessageId =
50
- 'reply_to_message' in ctxMessage
51
- ? ctxMessage.reply_to_message?.message_id
52
- : undefined;
53
- this.from = ctxMessage.from;
54
- this.text = this.getMessageText(ctxMessage);
55
- this.chatInfo = new ChatInfo(
56
- ctxMessage.chat.id,
57
- 'title' in ctxMessage.chat
58
- ? `${ctxMessage.chat.title} ${ctxMessage.chat.id}`
59
- : 'DM',
60
- history
61
- );
62
- this.type = this.detectMessageType(ctxMessage);
63
- this.updateObject = ctxMessage;
64
- }
65
-
66
- private getMessageText(ctxMessage: TelegramMessage) {
67
- if ('text' in ctxMessage) return ctxMessage.text;
68
-
69
- return 'caption' in ctxMessage ? ctxMessage.caption ?? '' : '';
70
- }
71
- }
@@ -1,14 +0,0 @@
1
- import { TraceId } from '../types/trace';
2
-
3
- export class IncomingInlineQuery {
4
- readonly abortController: AbortController;
5
-
6
- constructor(
7
- readonly queryId: string,
8
- readonly query: string,
9
- readonly userId: number,
10
- readonly traceId: TraceId
11
- ) {
12
- this.abortController = new AbortController();
13
- }
14
- }
@@ -1,15 +0,0 @@
1
- import { TelegramMessage } from '../types/externalAliases';
2
- import { MessageTypeValue } from '../types/messageTypes';
3
-
4
- export class MessageInfo {
5
- constructor(
6
- /** Id of a message that triggered this action. */
7
- readonly id: number,
8
- /** Text of a message that triggered this action. */
9
- readonly text: string,
10
- /** Type of message being received */
11
- readonly type: MessageTypeValue,
12
- /** Message object recieved from Telegram */
13
- readonly telegramUpdateObject: TelegramMessage
14
- ) {}
15
- }
@@ -1,21 +0,0 @@
1
- import { CooldownInfo } from './cooldownInfo';
2
- import {
3
- CommandActionPropertyProvider,
4
- ScheduledActionPropertyProvider
5
- } from '../types/propertyProvider';
6
- import { HoursOfDay } from '../types/timeValues';
7
-
8
- export type CommandActionProviders = {
9
- cooldownProvider: CommandActionPropertyProvider<CooldownInfo>;
10
- isActiveProvider: CommandActionPropertyProvider<boolean>;
11
- chatsBlacklistProvider: CommandActionPropertyProvider<number[]>;
12
- chatsWhitelistProvider: CommandActionPropertyProvider<number[]>;
13
- usersWhitelistProvider: CommandActionPropertyProvider<number[]>;
14
- maxAllowedSimultaniousExecutions: number;
15
- };
16
-
17
- export type ScheduledActionProviders = {
18
- timeinHoursProvider: ScheduledActionPropertyProvider<HoursOfDay>;
19
- isActiveProvider: ScheduledActionPropertyProvider<boolean>;
20
- chatsWhitelistProvider: ScheduledActionPropertyProvider<number[]>;
21
- };
@@ -1,9 +0,0 @@
1
- export class ReplyInfo {
2
- readonly id: number;
3
- readonly quote: string | undefined;
4
-
5
- constructor(id: number, quote?: string) {
6
- this.id = id;
7
- this.quote = quote;
8
- }
9
- }
@@ -1,28 +0,0 @@
1
- import { IActionState } from '../../types/actionState';
2
- import { IActionWithState } from '../../types/action';
3
- import { BotResponseTypes, IChatResponse } from '../../types/response';
4
- import { Milliseconds } from '../../types/timeValues';
5
- import { TraceId } from '../../types/trace';
6
- import { ChatInfo } from '../chatInfo';
7
-
8
- export class DelayResponse implements IChatResponse {
9
- readonly kind = BotResponseTypes.delay;
10
- readonly createdAt = Date.now();
11
-
12
- readonly chatInfo: ChatInfo;
13
- readonly traceId: TraceId;
14
- readonly delay: Milliseconds;
15
- readonly action: IActionWithState<IActionState>;
16
-
17
- constructor(
18
- delay: Milliseconds,
19
- chatInfo: ChatInfo,
20
- traceId: TraceId,
21
- action: IActionWithState<IActionState>
22
- ) {
23
- this.chatInfo = chatInfo;
24
- this.delay = delay;
25
- this.traceId = traceId;
26
- this.action = action;
27
- }
28
- }
@@ -1,41 +0,0 @@
1
- import {
2
- BotResponseTypes,
3
- IReplyResponseWithContent
4
- } from '../../types/response';
5
- import { MessageSendingOptions } from '../../types/messageSendingOptions';
6
- import { IAction } from '../../types/action';
7
- import { ChatInfo } from '../chatInfo';
8
- import { TraceId } from '../../types/trace';
9
- import { ReplyInfo } from '../replyInfo';
10
- import { IReplyCapture } from '../../types/capture';
11
- import { InputFile } from '../../types/inputFile';
12
-
13
- export class ImageMessage implements IReplyResponseWithContent<InputFile> {
14
- readonly kind = BotResponseTypes.image;
15
- readonly createdAt = Date.now();
16
- readonly captures: IReplyCapture[] = [];
17
-
18
- readonly content: InputFile;
19
- readonly chatInfo: ChatInfo;
20
- readonly replyInfo: ReplyInfo | undefined;
21
- readonly traceId: TraceId;
22
- readonly disableWebPreview = false;
23
- readonly shouldPin: boolean;
24
- readonly action: IAction;
25
-
26
- constructor(
27
- image: InputFile,
28
- chatInfo: ChatInfo,
29
- traceId: TraceId,
30
- action: IAction,
31
- replyInfo: ReplyInfo | undefined,
32
- options?: MessageSendingOptions
33
- ) {
34
- this.content = image;
35
- this.chatInfo = chatInfo;
36
- this.replyInfo = replyInfo;
37
- this.traceId = traceId;
38
- this.shouldPin = options?.pin ?? false;
39
- this.action = action;
40
- }
41
- }
@@ -1,26 +0,0 @@
1
- import { InlineQueryAction } from '../../entities/actions/inlineQueryAction';
2
- import { TelegramInlineQueryResult } from '../../types/externalAliases';
3
- import { BotResponseTypes } from '../../types/response';
4
- import { TraceId } from '../../types/trace';
5
-
6
- export class InlineQueryResponse {
7
- readonly kind = BotResponseTypes.inlineQuery;
8
- readonly createdAt = Date.now();
9
-
10
- readonly queryId: string;
11
- readonly traceId: TraceId;
12
- readonly action: InlineQueryAction;
13
- readonly queryResults: TelegramInlineQueryResult[];
14
-
15
- constructor(
16
- queryResult: TelegramInlineQueryResult[],
17
- queryId: string,
18
- traceId: TraceId,
19
- action: InlineQueryAction
20
- ) {
21
- this.queryResults = queryResult;
22
- this.queryId = queryId;
23
- this.traceId = traceId;
24
- this.action = action;
25
- }
26
- }
@@ -1,30 +0,0 @@
1
- import { BotResponseTypes, IChatResponse } from '../../types/response';
2
- import { IAction } from '../../types/action';
3
- import { ChatInfo } from '../chatInfo';
4
- import { TraceId } from '../../types/trace';
5
- import { TelegramEmoji } from '../../types/externalAliases';
6
-
7
- export class Reaction implements IChatResponse {
8
- readonly kind = BotResponseTypes.react;
9
- readonly createdAt = Date.now();
10
-
11
- readonly chatInfo: ChatInfo;
12
- readonly messageId: number;
13
- readonly traceId: TraceId;
14
- readonly emoji: TelegramEmoji;
15
- readonly action: IAction;
16
-
17
- constructor(
18
- traceId: TraceId,
19
- chatInfo: ChatInfo,
20
- messageId: number,
21
- emoji: TelegramEmoji,
22
- action: IAction
23
- ) {
24
- this.chatInfo = chatInfo;
25
- this.messageId = messageId;
26
- this.emoji = emoji;
27
- this.traceId = traceId;
28
- this.action = action;
29
- }
30
- }
@@ -1,44 +0,0 @@
1
- import { TextMessageSendingOptions } from '../../types/messageSendingOptions';
2
- import {
3
- BotResponseTypes,
4
- IReplyResponseWithContent
5
- } from '../../types/response';
6
- import { IAction } from '../../types/action';
7
- import { ChatInfo } from '../chatInfo';
8
- import { TraceId } from '../../types/trace';
9
- import { ReplyInfo } from '../replyInfo';
10
- import { IReplyCapture } from '../../types/capture';
11
- import { TelegramInlineKeyboardButton } from '../../types/externalAliases';
12
-
13
- export class TextMessage implements IReplyResponseWithContent<string> {
14
- readonly kind = BotResponseTypes.text;
15
- readonly createdAt = Date.now();
16
- readonly captures: IReplyCapture[] = [];
17
-
18
- readonly content: string;
19
- readonly chatInfo: ChatInfo;
20
- readonly replyInfo: ReplyInfo | undefined;
21
- readonly traceId: TraceId;
22
- readonly disableWebPreview: boolean;
23
- readonly shouldPin: boolean;
24
- readonly action: IAction;
25
- readonly keyboard?: TelegramInlineKeyboardButton[][];
26
-
27
- constructor(
28
- text: string,
29
- chatInfo: ChatInfo,
30
- traceId: TraceId,
31
- action: IAction,
32
- replyInfo?: ReplyInfo,
33
- options?: TextMessageSendingOptions
34
- ) {
35
- this.content = text;
36
- this.chatInfo = chatInfo;
37
- this.replyInfo = replyInfo;
38
- this.traceId = traceId;
39
- this.disableWebPreview = options?.disableWebPreview ?? false;
40
- this.shouldPin = options?.pin ?? false;
41
- this.action = action;
42
- this.keyboard = options?.keyboard;
43
- }
44
- }
@@ -1,27 +0,0 @@
1
- import { BotResponseTypes, 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
-
7
- export class UnpinResponse implements IChatResponse {
8
- readonly kind = BotResponseTypes.unpin;
9
- readonly createdAt = Date.now();
10
-
11
- readonly messageId: number;
12
- readonly chatInfo: ChatInfo;
13
- readonly traceId: TraceId;
14
- readonly action: IActionWithState<IActionState>;
15
-
16
- constructor(
17
- messageId: number,
18
- chatInfo: ChatInfo,
19
- traceId: TraceId,
20
- action: IActionWithState<IActionState>
21
- ) {
22
- this.messageId = messageId;
23
- this.chatInfo = chatInfo;
24
- this.traceId = traceId;
25
- this.action = action;
26
- }
27
- }
@@ -1,41 +0,0 @@
1
- import {
2
- BotResponseTypes,
3
- IReplyResponseWithContent
4
- } from '../../types/response';
5
- import { MessageSendingOptions } from '../../types/messageSendingOptions';
6
- import { IAction } from '../../types/action';
7
- import { ChatInfo } from '../chatInfo';
8
- import { TraceId } from '../../types/trace';
9
- import { ReplyInfo } from '../replyInfo';
10
- import { IReplyCapture } from '../../types/capture';
11
- import { InputFile } from '../../types/inputFile';
12
-
13
- export class VideoMessage implements IReplyResponseWithContent<InputFile> {
14
- readonly kind = BotResponseTypes.video;
15
- readonly createdAt = Date.now();
16
- readonly captures: IReplyCapture[] = [];
17
-
18
- readonly content: InputFile;
19
- readonly chatInfo: ChatInfo;
20
- readonly replyInfo: ReplyInfo | undefined;
21
- readonly traceId: TraceId;
22
- readonly disableWebPreview = false;
23
- readonly shouldPin: boolean;
24
- readonly action: IAction;
25
-
26
- constructor(
27
- video: InputFile,
28
- chatInfo: ChatInfo,
29
- traceId: TraceId,
30
- action: IAction,
31
- replyInfo: ReplyInfo | undefined,
32
- options?: MessageSendingOptions
33
- ) {
34
- this.content = video;
35
- this.chatInfo = chatInfo;
36
- this.replyInfo = replyInfo;
37
- this.traceId = traceId;
38
- this.shouldPin = options?.pin ?? false;
39
- this.action = action;
40
- }
41
- }