chz-telegram-bot 0.0.38 → 0.0.40

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.
@@ -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,MAAM,2BAA2B,CAAC;AAM5D,qBAAa,WAAW;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,GAAG,CAAqB;IAChC,OAAO,CAAC,QAAQ,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;KAC7B;IAmCD,OAAO,CAAC,6BAA6B;IA2CrC,OAAO,CAAC,2BAA2B;IAsB7B,IAAI,CAAC,IAAI,EAAE,MAAM;YAYT,YAAY;YAyBZ,cAAc;CAmB/B"}
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,MAAM,2BAA2B,CAAC;AAM5D,qBAAa,WAAW;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,GAAG,CAAqB;IAChC,OAAO,CAAC,QAAQ,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;KAC7B;IAmCD,OAAO,CAAC,6BAA6B;IA2CrC,OAAO,CAAC,2BAA2B;IAqB7B,IAAI,CAAC,IAAI,EAAE,MAAM;YAYT,YAAY;YAyBZ,cAAc;CAmB/B"}
@@ -54,7 +54,6 @@ class BotInstance {
54
54
  initializeMessageProcessing() {
55
55
  if (this.commands.length > 0) {
56
56
  this.telegraf.on('message', async (ctx) => {
57
- console.dir(ctx.update);
58
57
  const msg = new incomingMessage_1.IncomingMessage(ctx.update.message);
59
58
  const messageContent = msg.text || `<non-text message: ${msg.type}>`;
60
59
  const messageFromName = msg.from?.first_name ?? 'Unknown';
package/dist/index.d.ts CHANGED
@@ -6,4 +6,5 @@ export { IStorageClient } from './types/storage';
6
6
  export * from './types/actionState';
7
7
  export * from './entities/states/actionStateBase';
8
8
  export { Hours, Milliseconds, Seconds } from './types/timeValues';
9
+ export { MessageType } from './types/messageTypes';
9
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAC/E,OAAO,EAAE,6BAA6B,EAAE,MAAM,yCAAyC,CAAC;AACxF,cAAc,2CAA2C,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,cAAc,qBAAqB,CAAC;AACpC,cAAc,mCAAmC,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAC/E,OAAO,EAAE,6BAA6B,EAAE,MAAM,yCAAyC,CAAC;AACxF,cAAc,2CAA2C,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,cAAc,qBAAqB,CAAC;AACpC,cAAc,mCAAmC,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC"}
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.CommandActionBuilderWithState = exports.CommandActionBuilder = exports.stopBots = exports.startBot = void 0;
17
+ exports.MessageType = exports.CommandActionBuilderWithState = exports.CommandActionBuilder = exports.stopBots = exports.startBot = void 0;
18
18
  var main_1 = require("./main");
19
19
  Object.defineProperty(exports, "startBot", { enumerable: true, get: function () { return main_1.startBot; } });
20
20
  Object.defineProperty(exports, "stopBots", { enumerable: true, get: function () { return main_1.stopBots; } });
@@ -25,3 +25,5 @@ Object.defineProperty(exports, "CommandActionBuilderWithState", { enumerable: tr
25
25
  __exportStar(require("./helpers/builders/scheduledActionBuilder"), exports);
26
26
  __exportStar(require("./types/actionState"), exports);
27
27
  __exportStar(require("./entities/states/actionStateBase"), exports);
28
+ var messageTypes_1 = require("./types/messageTypes");
29
+ Object.defineProperty(exports, "MessageType", { enumerable: true, get: function () { return messageTypes_1.MessageType; } });
@@ -1,2 +1,3 @@
1
- export type CommandTrigger = string | RegExp;
1
+ import { MessageType } from './messageTypes';
2
+ export type CommandTrigger = (typeof MessageType)[keyof typeof MessageType] | string | RegExp;
2
3
  //# sourceMappingURL=commandTrigger.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"commandTrigger.d.ts","sourceRoot":"","sources":["../../types/commandTrigger.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,CAAC"}
1
+ {"version":3,"file":"commandTrigger.d.ts","sourceRoot":"","sources":["../../types/commandTrigger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,MAAM,cAAc,GACpB,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,OAAO,WAAW,CAAC,GAC9C,MAAM,GACN,MAAM,CAAC"}
@@ -114,7 +114,6 @@ export class BotInstance {
114
114
  private initializeMessageProcessing() {
115
115
  if (this.commands.length > 0) {
116
116
  this.telegraf.on('message', async (ctx) => {
117
- console.dir(ctx.update);
118
117
  const msg = new IncomingMessage(ctx.update.message);
119
118
  const messageContent =
120
119
  msg.text || `<non-text message: ${msg.type}>`;
package/index.ts CHANGED
@@ -6,3 +6,4 @@ export { IStorageClient } from './types/storage';
6
6
  export * from './types/actionState';
7
7
  export * from './entities/states/actionStateBase';
8
8
  export { Hours, Milliseconds, Seconds } from './types/timeValues';
9
+ export { MessageType } from './types/messageTypes';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chz-telegram-bot",
3
- "version": "0.0.38",
3
+ "version": "0.0.40",
4
4
  "type": "module",
5
5
  "dependencies": {
6
6
  "async-sema": "^3.1.1",
@@ -1 +1,6 @@
1
- export type CommandTrigger = string | RegExp;
1
+ import { MessageType } from './messageTypes';
2
+
3
+ export type CommandTrigger =
4
+ | (typeof MessageType)[keyof typeof MessageType]
5
+ | string
6
+ | RegExp;