chz-telegram-bot 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -11,5 +11,5 @@ declare const helpers: {
11
11
  secondsToMilliseconds: typeof secondsToMilliseconds;
12
12
  Noop: typeof Noop;
13
13
  };
14
- export { startBot, stopBots, CommandActionBuilder, CommandActionBuilderWithState, ScheduledActionBuilder, IStorageClient as IStorage, helpers };
14
+ export { startBot, stopBots, CommandActionBuilder, CommandActionBuilderWithState, ScheduledActionBuilder, IStorageClient, helpers };
15
15
  //# 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,OAAO,sBAAsB,MAAM,2CAA2C,CAAC;AAC/E,OAAO,EACH,mBAAmB,EACnB,cAAc,EACd,qBAAqB,EACxB,MAAM,2BAA2B,CAAC;AACnC,OAAO,IAAI,MAAM,gBAAgB,CAAC;AAClC,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,QAAA,MAAM,OAAO;;;;;CAKZ,CAAC;AAEF,OAAO,EACH,QAAQ,EACR,QAAQ,EACR,oBAAoB,EACpB,6BAA6B,EAC7B,sBAAsB,EACtB,cAAc,IAAI,QAAQ,EAC1B,OAAO,EACV,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,OAAO,sBAAsB,MAAM,2CAA2C,CAAC;AAC/E,OAAO,EACH,mBAAmB,EACnB,cAAc,EACd,qBAAqB,EACxB,MAAM,2BAA2B,CAAC;AACnC,OAAO,IAAI,MAAM,gBAAgB,CAAC;AAClC,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,QAAA,MAAM,OAAO;;;;;CAKZ,CAAC;AAEF,OAAO,EACH,QAAQ,EACR,QAAQ,EACR,oBAAoB,EACpB,6BAA6B,EAC7B,sBAAsB,EACtB,cAAc,EACd,OAAO,EACV,CAAC"}
package/dist/main.d.ts CHANGED
@@ -2,7 +2,8 @@ import BotInstance from './entities/bot.js';
2
2
  import CommandAction from './entities/actions/commandAction.js';
3
3
  import IActionState from './types/actionState.js';
4
4
  import ScheduledAction from './entities/actions/scheduledAction.js';
5
- declare function startBot(name: string, tokenFilePath: string, commands: CommandAction<IActionState>[], scheduled: ScheduledAction[], chats: Map<string, number>, storagePath?: string): Promise<BotInstance>;
5
+ import { IStorageClient } from './types/storage.js';
6
+ declare function startBot(name: string, tokenFilePath: string, commands: CommandAction<IActionState>[], scheduled: ScheduledAction[], chats: Map<string, number>, storageClient?: IStorageClient, storagePath?: string): Promise<BotInstance>;
6
7
  declare function stopBots(reason: string): Promise<void>;
7
8
  export { startBot, stopBots };
8
9
  //# sourceMappingURL=main.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../main.ts"],"names":[],"mappings":"AACA,OAAO,WAAW,MAAM,mBAAmB,CAAC;AAG5C,OAAO,aAAa,MAAM,qCAAqC,CAAC;AAChE,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAClD,OAAO,eAAe,MAAM,uCAAuC,CAAC;AAQpE,iBAAe,QAAQ,CACnB,IAAI,EAAE,MAAM,EACZ,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE,aAAa,CAAC,YAAY,CAAC,EAAE,EACvC,SAAS,EAAE,eAAe,EAAE,EAC5B,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAC1B,WAAW,CAAC,EAAE,MAAM,wBAcvB;AAED,iBAAe,QAAQ,CAAC,MAAM,EAAE,MAAM,iBASrC;AAED,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC"}
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../main.ts"],"names":[],"mappings":"AACA,OAAO,WAAW,MAAM,mBAAmB,CAAC;AAG5C,OAAO,aAAa,MAAM,qCAAqC,CAAC;AAChE,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAClD,OAAO,eAAe,MAAM,uCAAuC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAQpD,iBAAe,QAAQ,CACnB,IAAI,EAAE,MAAM,EACZ,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE,aAAa,CAAC,YAAY,CAAC,EAAE,EACvC,SAAS,EAAE,eAAe,EAAE,EAC5B,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAC1B,aAAa,CAAC,EAAE,cAAc,EAC9B,WAAW,CAAC,EAAE,MAAM,wBAevB;AAED,iBAAe,QAAQ,CAAC,MAAM,EAAE,MAAM,iBASrC;AAED,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC"}
package/dist/main.js CHANGED
@@ -13,7 +13,7 @@ const bots = [];
13
13
  function log(text) {
14
14
  logger_js_1.default.logWithTraceId('ALL BOTS', 'System:Bot', 'System', text);
15
15
  }
16
- async function startBot(name, tokenFilePath, commands, scheduled, chats, storagePath) {
16
+ async function startBot(name, tokenFilePath, commands, scheduled, chats, storageClient, storagePath) {
17
17
  const token = await (0, promises_1.readFile)(tokenFilePath, 'utf8');
18
18
  const bot = new bot_js_1.default({
19
19
  name,
@@ -21,6 +21,7 @@ async function startBot(name, tokenFilePath, commands, scheduled, chats, storage
21
21
  commands,
22
22
  scheduled,
23
23
  chats,
24
+ storageClient,
24
25
  storagePath
25
26
  });
26
27
  bots.push(bot);
package/index.ts CHANGED
@@ -23,6 +23,6 @@ export {
23
23
  CommandActionBuilder,
24
24
  CommandActionBuilderWithState,
25
25
  ScheduledActionBuilder,
26
- IStorageClient as IStorage,
26
+ IStorageClient,
27
27
  helpers
28
28
  };
package/main.ts CHANGED
@@ -5,6 +5,7 @@ import logger from './services/logger.js';
5
5
  import CommandAction from './entities/actions/commandAction.js';
6
6
  import IActionState from './types/actionState.js';
7
7
  import ScheduledAction from './entities/actions/scheduledAction.js';
8
+ import { IStorageClient } from './types/storage.js';
8
9
 
9
10
  const bots: BotInstance[] = [];
10
11
 
@@ -18,6 +19,7 @@ async function startBot(
18
19
  commands: CommandAction<IActionState>[],
19
20
  scheduled: ScheduledAction[],
20
21
  chats: Map<string, number>,
22
+ storageClient?: IStorageClient,
21
23
  storagePath?: string
22
24
  ) {
23
25
  const token = await readFile(tokenFilePath, 'utf8');
@@ -27,6 +29,7 @@ async function startBot(
27
29
  commands,
28
30
  scheduled,
29
31
  chats,
32
+ storageClient,
30
33
  storagePath
31
34
  });
32
35
  bots.push(bot);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chz-telegram-bot",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "type": "module",
5
5
  "dependencies": {
6
6
  "async-sema": "^3.1.1",