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 +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/main.d.ts +2 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +2 -1
- package/index.ts +1 -1
- package/main.ts +3 -0
- package/package.json +1 -1
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
|
|
14
|
+
export { startBot, stopBots, CommandActionBuilder, CommandActionBuilderWithState, ScheduledActionBuilder, IStorageClient, helpers };
|
|
15
15
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -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,
|
|
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
|
-
|
|
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
|
package/dist/main.d.ts.map
CHANGED
|
@@ -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;
|
|
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
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);
|