chz-telegram-bot 0.0.30 → 0.0.31
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/main.d.ts +3 -0
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +2 -1
- package/main.ts +5 -1
- package/package.json +1 -1
package/dist/main.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { CommandAction } from './entities/actions/commandAction';
|
|
|
3
3
|
import { ScheduledAction } from './entities/actions/scheduledAction';
|
|
4
4
|
import { IActionState } from './types/actionState';
|
|
5
5
|
import { BotInstance } from './entities/botInstance';
|
|
6
|
+
import { Seconds } from './types/timeValues';
|
|
6
7
|
/**
|
|
7
8
|
* Starts bot
|
|
8
9
|
*/
|
|
@@ -21,6 +22,8 @@ declare function startBot(options: {
|
|
|
21
22
|
storageClient?: IStorageClient;
|
|
22
23
|
/** Storage path for default `JsonFileStorage` client. Will be used only if `storageClient` is not provided. If not provided, default value of `./storage/` will be used.*/
|
|
23
24
|
storagePath?: string;
|
|
25
|
+
/** Period of time between execution of scheduled actions. */
|
|
26
|
+
scheduledPeriod?: Seconds;
|
|
24
27
|
}): Promise<BotInstance>;
|
|
25
28
|
/**
|
|
26
29
|
* Terminates all scheduled tasks, closes storage connections and stops all bots.
|
package/dist/main.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../main.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../main.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAQ7C;;GAEG;AACH,iBAAe,QAAQ,CAAC,OAAO,EAAE;IAC7B,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,kDAAkD;IAClD,aAAa,EAAE,MAAM,CAAC;IACtB,2HAA2H;IAC3H,QAAQ,EAAE,aAAa,CAAC,YAAY,CAAC,EAAE,CAAC;IACxC,mGAAmG;IACnG,SAAS,EAAE,eAAe,CAAC,YAAY,CAAC,EAAE,CAAC;IAC3C,yGAAyG;IACzG,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,qGAAqG;IACrG,aAAa,CAAC,EAAE,cAAc,CAAC;IAC/B,2KAA2K;IAC3K,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6DAA6D;IAC7D,eAAe,CAAC,EAAE,OAAO,CAAC;CAC7B,wBAeA;AAED;;GAEG;AACH,iBAAe,QAAQ,CAAC,MAAM,EAAE,MAAM,iBASrC;AAED,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC"}
|
package/dist/main.js
CHANGED
|
@@ -22,7 +22,8 @@ async function startBot(options) {
|
|
|
22
22
|
scheduled: options.scheduled,
|
|
23
23
|
chats: options.chats,
|
|
24
24
|
storageClient: options.storageClient,
|
|
25
|
-
storagePath: options.storagePath
|
|
25
|
+
storagePath: options.storagePath,
|
|
26
|
+
scheduledPeriod: options.scheduledPeriod
|
|
26
27
|
});
|
|
27
28
|
bots.push(bot);
|
|
28
29
|
return bot;
|
package/main.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { ScheduledAction } from './entities/actions/scheduledAction';
|
|
|
6
6
|
import { IActionState } from './types/actionState';
|
|
7
7
|
import { Scheduler } from './services/taskScheduler';
|
|
8
8
|
import { BotInstance } from './entities/botInstance';
|
|
9
|
+
import { Seconds } from './types/timeValues';
|
|
9
10
|
|
|
10
11
|
const bots: BotInstance[] = [];
|
|
11
12
|
|
|
@@ -31,6 +32,8 @@ async function startBot(options: {
|
|
|
31
32
|
storageClient?: IStorageClient;
|
|
32
33
|
/** Storage path for default `JsonFileStorage` client. Will be used only if `storageClient` is not provided. If not provided, default value of `./storage/` will be used.*/
|
|
33
34
|
storagePath?: string;
|
|
35
|
+
/** Period of time between execution of scheduled actions. */
|
|
36
|
+
scheduledPeriod?: Seconds;
|
|
34
37
|
}) {
|
|
35
38
|
const token = await readFile(options.tokenFilePath, 'utf8');
|
|
36
39
|
const bot = new BotInstance({
|
|
@@ -40,7 +43,8 @@ async function startBot(options: {
|
|
|
40
43
|
scheduled: options.scheduled,
|
|
41
44
|
chats: options.chats,
|
|
42
45
|
storageClient: options.storageClient,
|
|
43
|
-
storagePath: options.storagePath
|
|
46
|
+
storagePath: options.storagePath,
|
|
47
|
+
scheduledPeriod: options.scheduledPeriod
|
|
44
48
|
});
|
|
45
49
|
bots.push(bot);
|
|
46
50
|
|