create-gramstax 0.8.4 → 0.8.6
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.
|
@@ -38,8 +38,9 @@ TELEGRAM_BOT_TOKEN="<...your_bot_token_here...>"
|
|
|
38
38
|
- `src/blocks/` - Block data builder classes
|
|
39
39
|
- `src/core/` - Core bot configuration and hooks
|
|
40
40
|
- `src/guards/` - Route guards and middleware
|
|
41
|
+
- `src/helpers/` - Helper function
|
|
41
42
|
- `src/pages/` - Bot pages/screens
|
|
42
|
-
- `src/utils/` - Utility functions
|
|
43
|
+
- `src/utils/` - Utility functions for raw like array
|
|
43
44
|
- `logs/` - Application logs (created automatically)
|
|
44
45
|
|
|
45
46
|
## Configuration
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import {PageBase} from "~/base/page"
|
|
2
2
|
|
|
3
|
+
class Main {
|
|
4
|
+
static async showEntryPoint(ctx: BlankPage) {
|
|
5
|
+
await ctx.callbackQueryAnswer()
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
3
9
|
export class BlankPage extends PageBase {
|
|
4
10
|
async handleCallbackData() {
|
|
5
|
-
await
|
|
11
|
+
await Main.showEntryPoint(this)
|
|
6
12
|
}
|
|
7
13
|
|
|
8
14
|
static template = `<base></base>`
|
|
@@ -17,6 +17,16 @@ class Helper {
|
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
class Alert {
|
|
21
|
+
static async success(ctx: SumNumberPage, left: number, right: number) {
|
|
22
|
+
await ctx.clearSession()
|
|
23
|
+
const bi = Base.success
|
|
24
|
+
const kb = Helper.kb(ctx, bi)
|
|
25
|
+
const da = {result: left! + right}
|
|
26
|
+
await ctx.reply(kb, da, bi)
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
20
30
|
class Main {
|
|
21
31
|
static async showStep1Form(ctx: SumNumberPage, edit: boolean) {
|
|
22
32
|
await ctx.sessionFreeText({step: `left`})
|
|
@@ -58,16 +68,6 @@ class Main {
|
|
|
58
68
|
}
|
|
59
69
|
}
|
|
60
70
|
|
|
61
|
-
class Alert {
|
|
62
|
-
static async success(ctx: SumNumberPage, left: number, right: number) {
|
|
63
|
-
await ctx.clearSession()
|
|
64
|
-
const bi = Base.success
|
|
65
|
-
const kb = Helper.kb(ctx, bi)
|
|
66
|
-
const da = {result: left! + right}
|
|
67
|
-
await ctx.reply(kb, da, bi)
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
71
|
export class SumNumberPage extends PageBase {
|
|
72
72
|
async handleCallbackData() {
|
|
73
73
|
await Main.showStep1Form(this, true)
|