@2byte/tgbot-framework 1.0.3 → 1.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/README.md +300 -300
- package/bin/2byte-cli.ts +97 -97
- package/package.json +6 -5
- package/src/cli/CreateBotCommand.ts +181 -181
- package/src/cli/GenerateCommand.ts +195 -195
- package/src/cli/InitCommand.ts +107 -107
- package/src/cli/TgAccountManager.ts +50 -0
- package/src/console/migrate.ts +82 -82
- package/src/core/ApiService.ts +20 -20
- package/src/core/ApiServiceManager.ts +63 -63
- package/src/core/App.ts +1143 -1113
- package/src/core/BotArtisan.ts +79 -79
- package/src/core/BotMigration.ts +30 -30
- package/src/core/BotSeeder.ts +66 -66
- package/src/core/Model.ts +84 -84
- package/src/core/utils.ts +2 -2
- package/src/illumination/Artisan.ts +149 -149
- package/src/illumination/InlineKeyboard.ts +61 -61
- package/src/illumination/Message2Byte.ts +255 -255
- package/src/illumination/Message2ByteLiveProgressive.ts +278 -278
- package/src/illumination/Message2bytePool.ts +107 -107
- package/src/illumination/Migration.ts +186 -186
- package/src/illumination/RunSectionRoute.ts +85 -85
- package/src/illumination/Section.ts +410 -410
- package/src/illumination/SectionComponent.ts +64 -64
- package/src/illumination/Telegraf2byteContext.ts +32 -32
- package/src/index.ts +42 -35
- package/src/libs/TelegramAccountControl.ts +1140 -738
- package/src/libs/TgSender.ts +53 -0
- package/src/models/Model.ts +67 -0
- package/src/models/Proxy.ts +218 -0
- package/src/models/TgAccount.ts +362 -0
- package/src/models/index.ts +3 -0
- package/src/types.ts +191 -188
- package/src/user/UserModel.ts +297 -297
- package/src/user/UserStore.ts +119 -119
- package/src/workflow/services/MassSendApiService.ts +80 -80
- package/templates/bot/.env.example +23 -19
- package/templates/bot/artisan.ts +8 -8
- package/templates/bot/bot.ts +82 -79
- package/templates/bot/database/dbConnector.ts +4 -4
- package/templates/bot/database/migrate.ts +9 -9
- package/templates/bot/database/migrations/001_create_users.sql +18 -18
- package/templates/bot/database/migrations/007_proxy.sql +27 -0
- package/templates/bot/database/migrations/008_tg_accounts.sql +32 -0
- package/templates/bot/database/seed.ts +14 -14
- package/templates/bot/docs/CLI_SERVICES.md +536 -0
- package/templates/bot/docs/INPUT_SYSTEM.md +211 -0
- package/templates/bot/docs/SERVICE_EXAMPLES.md +384 -0
- package/templates/bot/docs/TASK_SYSTEM.md +156 -0
- package/templates/bot/models/Model.ts +7 -0
- package/templates/bot/models/index.ts +2 -0
- package/templates/bot/package.json +30 -30
- package/templates/bot/sectionList.ts +9 -9
- package/templates/bot/sections/ExampleInputSection.ts +85 -85
- package/templates/bot/sections/ExampleLiveTaskerSection.ts +60 -60
- package/templates/bot/sections/HomeSection.ts +63 -63
- package/templates/bot/workflow/services/{ExampleServise.ts → ExampleService.ts} +23 -23
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { App } from "@2byte/tgbot-framework";
|
|
2
|
-
import { ApiService } from "@2byte/tgbot-framework";
|
|
3
|
-
|
|
4
|
-
export default class ExampleService extends ApiService {
|
|
5
|
-
|
|
6
|
-
constructor(
|
|
7
|
-
protected app: App,
|
|
8
|
-
public name: string = "ExampleService"
|
|
9
|
-
) {
|
|
10
|
-
super(app, name);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
public async setup(): Promise<void> {
|
|
14
|
-
return Promise.resolve();
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
public async unsetup(): Promise<void> {
|
|
18
|
-
return Promise.resolve();
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
public async run(): Promise<void> {
|
|
22
|
-
return Promise.resolve();
|
|
23
|
-
}
|
|
1
|
+
import { App } from "@2byte/tgbot-framework";
|
|
2
|
+
import { ApiService } from "@2byte/tgbot-framework";
|
|
3
|
+
|
|
4
|
+
export default class ExampleService extends ApiService {
|
|
5
|
+
|
|
6
|
+
constructor(
|
|
7
|
+
protected app: App,
|
|
8
|
+
public name: string = "ExampleService"
|
|
9
|
+
) {
|
|
10
|
+
super(app, name);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
public async setup(): Promise<void> {
|
|
14
|
+
return Promise.resolve();
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
public async unsetup(): Promise<void> {
|
|
18
|
+
return Promise.resolve();
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
public async run(): Promise<void> {
|
|
22
|
+
return Promise.resolve();
|
|
23
|
+
}
|
|
24
24
|
}
|