create-gramstax 0.0.27 → 0.1.1
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/LICENSE +25 -25
- package/dist/src/index.cjs +2 -2
- package/dist/src/index.js +2 -2
- package/dist/src/templates/.env.example +15 -18
- package/dist/src/templates/.prettierrc +23 -23
- package/dist/src/templates/README.md +120 -121
- package/dist/src/templates/bunfig.toml +1 -1
- package/dist/src/templates/package.json +48 -54
- package/dist/src/templates/src/base/guard.ts +11 -11
- package/dist/src/templates/src/base/index.ts +4 -0
- package/dist/src/templates/src/base/page.ts +3 -3
- package/dist/src/templates/src/base/repository.ts +1 -1
- package/dist/src/templates/src/base/service.ts +1 -1
- package/dist/src/templates/src/core/bot.ts +23 -23
- package/dist/src/templates/src/core/ctx.ts +3 -3
- package/dist/src/templates/src/core/index.ts +2 -0
- package/dist/src/templates/src/db/index.ts +1 -3
- package/dist/src/templates/src/env.ts +5 -6
- package/dist/src/templates/src/guards/index.ts +1 -0
- package/dist/src/templates/src/guards/user.ts +19 -19
- package/dist/src/templates/src/index.ts +15 -15
- package/dist/src/templates/src/pages/general-error-input-notfound.ts +28 -39
- package/dist/src/templates/src/pages/general-error.ts +60 -59
- package/dist/src/templates/src/pages/help.ts +49 -61
- package/dist/src/templates/src/pages/start.ts +69 -70
- package/dist/src/templates/src/pages/username-notfound.ts +33 -46
- package/dist/src/templates/src/repositories/example.ts +3 -5
- package/dist/src/templates/src/repositories/index.ts +1 -0
- package/dist/src/templates/src/services/example.ts +3 -4
- package/dist/src/templates/src/services/index.ts +1 -0
- package/dist/src/templates/src/threads/index.ts +1 -0
- package/dist/src/templates/src/threads/main.ts +9 -9
- package/dist/src/templates/src/utils/index.ts +1 -0
- package/dist/src/templates/src/utils/log.ts +2 -3
- package/dist/src/templates/tsconfig.json +37 -37
- package/package.json +8 -2
- package/dist/src/templates/.prettierignore +0 -1
- package/dist/src/templates/ecosystem.config.js +0 -26
- package/dist/src/templates/src/base/general.ts +0 -3
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { Gramstax } from "gramstax"
|
|
2
|
-
import { UserGuard } from "
|
|
3
|
-
import { GeneralErrorPage } from "
|
|
4
|
-
import { GeneralErrorInputNotFoundPage } from "
|
|
5
|
-
import type { CtxCore } from "./ctx"
|
|
6
|
-
|
|
7
|
-
export class BotCore extends Gramstax {
|
|
8
|
-
public async hookBeforeRoute(ctx: CtxCore): Promise<boolean> {
|
|
9
|
-
const result = await new UserGuard(ctx).ensureValid(true)
|
|
10
|
-
if (result === null) {
|
|
11
|
-
return false
|
|
12
|
-
}
|
|
13
|
-
return true
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
public async hookErrorPage(ctx: CtxCore, listenerName: string, error: any, isEdit: boolean): Promise<void> {
|
|
17
|
-
await new GeneralErrorPage(ctx).transition(this.constructor.name, listenerName, error, isEdit)
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
public async hookErrorInputNotFoundPage(ctx: CtxCore): Promise<void> {
|
|
21
|
-
await new GeneralErrorInputNotFoundPage(ctx).transition()
|
|
22
|
-
}
|
|
23
|
-
}
|
|
1
|
+
import { Gramstax } from "gramstax"
|
|
2
|
+
import { UserGuard } from "~/guards"
|
|
3
|
+
import { GeneralErrorPage } from "~/pages/general-error"
|
|
4
|
+
import { GeneralErrorInputNotFoundPage } from "~/pages/general-error-input-notfound"
|
|
5
|
+
import type { CtxCore } from "./ctx"
|
|
6
|
+
|
|
7
|
+
export class BotCore extends Gramstax {
|
|
8
|
+
public async hookBeforeRoute(ctx: CtxCore): Promise<boolean> {
|
|
9
|
+
const result = await new UserGuard(ctx).ensureValid(true)
|
|
10
|
+
if (result === null) {
|
|
11
|
+
return false
|
|
12
|
+
}
|
|
13
|
+
return true
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
public async hookErrorPage(ctx: CtxCore, listenerName: string, error: any, isEdit: boolean): Promise<void> {
|
|
17
|
+
await new GeneralErrorPage(ctx).transition(this.constructor.name, listenerName, error, isEdit)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
public async hookErrorInputNotFoundPage(ctx: CtxCore): Promise<void> {
|
|
21
|
+
await new GeneralErrorInputNotFoundPage(ctx).transition()
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Ctx } from "gramstax"
|
|
2
|
-
|
|
3
|
-
export class CtxCore extends Ctx {}
|
|
1
|
+
import { Ctx } from "gramstax"
|
|
2
|
+
|
|
3
|
+
export class CtxCore extends Ctx {}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
export const env = {
|
|
2
|
-
BOT_TOKEN: process.env.BOT_TOKEN as string,
|
|
3
|
-
BOT_DEPLOY: process.env.BOT_DEPLOY as string,
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
1
|
+
export const env = {
|
|
2
|
+
BOT_TOKEN: process.env.BOT_TOKEN as string,
|
|
3
|
+
BOT_DEPLOY: process.env.BOT_DEPLOY as string,
|
|
4
|
+
CACHE_SESSION: process.env.CACHE_SESSION as string
|
|
5
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./user"
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { GuardBase } from "~/base
|
|
2
|
-
import { GeneralErrorPage } from "
|
|
3
|
-
import { UserNameNotFoundPage } from "
|
|
4
|
-
|
|
5
|
-
export class UserGuard extends GuardBase {
|
|
6
|
-
public async ensureValid(isEdit: boolean) {
|
|
7
|
-
try {
|
|
8
|
-
if (!this.
|
|
9
|
-
await new UserNameNotFoundPage(this).transition(isEdit)
|
|
10
|
-
return null
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
return { status: true }
|
|
14
|
-
} catch (err) {
|
|
15
|
-
await new GeneralErrorPage(this).transition(this.constructor.name, `ensureValid`, err, isEdit)
|
|
16
|
-
return null
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
1
|
+
import { GuardBase } from "~/base"
|
|
2
|
+
import { GeneralErrorPage } from "~/pages/general-error"
|
|
3
|
+
import { UserNameNotFoundPage } from "~/pages/username-notfound"
|
|
4
|
+
|
|
5
|
+
export class UserGuard extends GuardBase {
|
|
6
|
+
public async ensureValid(isEdit: boolean) {
|
|
7
|
+
try {
|
|
8
|
+
if (!this.userName || this.userName.length == 0) {
|
|
9
|
+
await new UserNameNotFoundPage(this).transition(isEdit)
|
|
10
|
+
return null
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
return { status: true }
|
|
14
|
+
} catch (err) {
|
|
15
|
+
await new GeneralErrorPage(this).transition(this.constructor.name, `ensureValid`, err, isEdit)
|
|
16
|
+
return null
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { env } from "./env"
|
|
2
|
-
import { log } from "./utils/log"
|
|
3
|
-
import { BotCore } from "./core/bot"
|
|
4
|
-
import { MainThread } from "./threads/main"
|
|
5
|
-
import { CacheExternal } from "gramstax"
|
|
6
|
-
|
|
7
|
-
new MainThread(() => {
|
|
8
|
-
log.success(`Bot started..`)
|
|
9
|
-
|
|
10
|
-
new BotCore({
|
|
11
|
-
token: env.BOT_TOKEN,
|
|
12
|
-
deploy: env.BOT_DEPLOY,
|
|
13
|
-
cacheSession: new CacheExternal(env.CACHE_SESSION, `session`, 24 * 60 * 60 * 1000)
|
|
14
|
-
})
|
|
15
|
-
})
|
|
1
|
+
import { env } from "./env"
|
|
2
|
+
import { log } from "./utils/log"
|
|
3
|
+
import { BotCore } from "./core/bot"
|
|
4
|
+
import { MainThread } from "./threads/main"
|
|
5
|
+
import { CacheExternal } from "gramstax"
|
|
6
|
+
|
|
7
|
+
new MainThread(() => {
|
|
8
|
+
log.success(`Bot started..`)
|
|
9
|
+
|
|
10
|
+
new BotCore({
|
|
11
|
+
token: env.BOT_TOKEN,
|
|
12
|
+
deploy: env.BOT_DEPLOY,
|
|
13
|
+
cacheSession: new CacheExternal(env.CACHE_SESSION, `session`, 24 * 60 * 60 * 1000)
|
|
14
|
+
})
|
|
15
|
+
})
|
|
@@ -1,39 +1,28 @@
|
|
|
1
|
-
import { PageBase } from "~/base
|
|
2
|
-
import { StartPage } from "./start"
|
|
3
|
-
|
|
4
|
-
export class GeneralErrorInputNotFoundPage extends PageBase {
|
|
5
|
-
public kb() {
|
|
6
|
-
return this.inlineKeyboard((kb, arr) => {
|
|
7
|
-
return kb.text(arr[0]
|
|
8
|
-
})
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
public async transition() {
|
|
12
|
-
await this.edit(this.kb())
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
public static template = /*jsx*/ `
|
|
16
|
-
<base>
|
|
17
|
-
<keyboard type="inline">.. Home</keyboard>
|
|
18
|
-
<keyboard lang="en" type="inline">.. Home</keyboard>
|
|
19
|
-
<keyboard lang="it" type="inline">.. Casa</keyboard>
|
|
20
|
-
<keyboard lang="id" type="inline">.. Beranda</keyboard>
|
|
21
|
-
|
|
22
|
-
<message>
|
|
23
|
-
|
|
24
|
-
</message>
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
<message lang="it">
|
|
31
|
-
<b>❌ Non Trovato</b>
|
|
32
|
-
</message>
|
|
33
|
-
|
|
34
|
-
<message lang="id">
|
|
35
|
-
<b>❌ Tidak Ditemukan</b>
|
|
36
|
-
</message>
|
|
37
|
-
</base>
|
|
38
|
-
`
|
|
39
|
-
}
|
|
1
|
+
import { PageBase } from "~/base"
|
|
2
|
+
import { StartPage } from "./start"
|
|
3
|
+
|
|
4
|
+
export class GeneralErrorInputNotFoundPage extends PageBase {
|
|
5
|
+
public kb() {
|
|
6
|
+
return this.inlineKeyboard((kb, arr) => {
|
|
7
|
+
return kb.text(arr[0]!, StartPage.data.callbackData())
|
|
8
|
+
})
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
public async transition() {
|
|
12
|
+
await this.edit(this.kb())
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
public static template = /*jsx*/ `
|
|
16
|
+
<base>
|
|
17
|
+
<keyboard type="inline">.. Home</keyboard>
|
|
18
|
+
<keyboard lang="en" type="inline">.. Home</keyboard>
|
|
19
|
+
<keyboard lang="it" type="inline">.. Casa</keyboard>
|
|
20
|
+
<keyboard lang="id" type="inline">.. Beranda</keyboard>
|
|
21
|
+
|
|
22
|
+
<message><b>❌ Not Found</b></message>
|
|
23
|
+
<message lang="en"><b>❌ Not Found</b></message>
|
|
24
|
+
<message lang="it"><b>❌ Non Trovato</b></message>
|
|
25
|
+
<message lang="id"><b>❌ Tidak Ditemukan</b></message>
|
|
26
|
+
</base>
|
|
27
|
+
`
|
|
28
|
+
}
|
|
@@ -1,59 +1,60 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
<keyboard
|
|
27
|
-
<keyboard lang="
|
|
28
|
-
<keyboard lang="
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
1
|
+
import { log } from "~/utils"
|
|
2
|
+
import { PageBase } from "~/base"
|
|
3
|
+
import { StartPage } from "./start"
|
|
4
|
+
|
|
5
|
+
export class GeneralErrorPage extends PageBase {
|
|
6
|
+
public kb() {
|
|
7
|
+
return this.inlineKeyboard((kb, arr) => {
|
|
8
|
+
return kb.text(arr[0]!, StartPage.data.callbackData())
|
|
9
|
+
})
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
public async transition(constructorName: string, funcName: string, error: unknown, isUpdate = true) {
|
|
13
|
+
log.errorMake(error, constructorName, funcName)
|
|
14
|
+
await this.sessionClear()
|
|
15
|
+
|
|
16
|
+
const kb = this.kb()
|
|
17
|
+
if (isUpdate === true) {
|
|
18
|
+
await this.edit(kb)
|
|
19
|
+
} else {
|
|
20
|
+
await this.reply(kb)
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
public static template = /*jsx*/ `
|
|
25
|
+
<base>
|
|
26
|
+
<keyboard type="inline">.. Home</keyboard>
|
|
27
|
+
<keyboard lang="en" type="inline">.. Home</keyboard>
|
|
28
|
+
<keyboard lang="es" type="inline">.. Inicio</keyboard>
|
|
29
|
+
<keyboard lang="id" type="inline">.. Beranda</keyboard>
|
|
30
|
+
|
|
31
|
+
<message>
|
|
32
|
+
<b>❌ Error</b>
|
|
33
|
+
|
|
34
|
+
An unexpected error occurred.
|
|
35
|
+
Please try again later.
|
|
36
|
+
</message>
|
|
37
|
+
|
|
38
|
+
<message lang="en">
|
|
39
|
+
<b>❌ Error</b>
|
|
40
|
+
|
|
41
|
+
An unexpected error occurred.
|
|
42
|
+
Please try again later.
|
|
43
|
+
</message>
|
|
44
|
+
|
|
45
|
+
<message lang="it">
|
|
46
|
+
<b>❌ Errore</b>
|
|
47
|
+
|
|
48
|
+
Si è verificato un errore imprevisto.
|
|
49
|
+
Riprova più tardi.
|
|
50
|
+
</message>
|
|
51
|
+
|
|
52
|
+
<message lang="id">
|
|
53
|
+
<b>❌ Kesalahan</b>
|
|
54
|
+
|
|
55
|
+
Terjadi kesalahan yang tidak diharapkan.
|
|
56
|
+
Silakan coba lagi nanti.
|
|
57
|
+
</message>
|
|
58
|
+
</base>
|
|
59
|
+
`
|
|
60
|
+
}
|
|
@@ -1,61 +1,49 @@
|
|
|
1
|
-
import { PageBase } from "~/base
|
|
2
|
-
import { StartPage } from "./start"
|
|
3
|
-
|
|
4
|
-
export class HelpPage extends PageBase {
|
|
5
|
-
public kb() {
|
|
6
|
-
return this.inlineKeyboard((kb, arr) => {
|
|
7
|
-
return kb
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
<keyboard type="inline">.. Back</keyboard>
|
|
40
|
-
<keyboard lang="
|
|
41
|
-
<keyboard lang="
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
<message>
|
|
45
|
-
|
|
46
|
-
</message>
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
</message>
|
|
51
|
-
|
|
52
|
-
<message lang="it">
|
|
53
|
-
<b>Ordina aiuto</b>
|
|
54
|
-
</message>
|
|
55
|
-
|
|
56
|
-
<message lang="id">
|
|
57
|
-
<b>Pesan bantuan</b>
|
|
58
|
-
</message>
|
|
59
|
-
</base>
|
|
60
|
-
`
|
|
61
|
-
}
|
|
1
|
+
import { PageBase } from "~/base"
|
|
2
|
+
import { StartPage } from "./start"
|
|
3
|
+
|
|
4
|
+
export class HelpPage extends PageBase {
|
|
5
|
+
public kb() {
|
|
6
|
+
return this.inlineKeyboard((kb, arr) => {
|
|
7
|
+
return kb.text(arr[0]!, StartPage.data.callbackData())
|
|
8
|
+
})
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
public async internal(edit = true) {
|
|
12
|
+
const kb = this.kb()
|
|
13
|
+
if (edit) {
|
|
14
|
+
await this.edit(kb)
|
|
15
|
+
} else {
|
|
16
|
+
await this.reply(kb)
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
public async callback() {
|
|
21
|
+
await this.internal(true)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
public async text() {
|
|
25
|
+
await this.internal(false)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
public async textCommand() {
|
|
29
|
+
await this.internal(false)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
public async textCommandPayload() {
|
|
33
|
+
await this.internal(false)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
public static template = /*jsx*/ `
|
|
37
|
+
<base>
|
|
38
|
+
<keyboard type="inline">.. Back</keyboard>
|
|
39
|
+
<keyboard lang="en" type="inline">.. Back</keyboard>
|
|
40
|
+
<keyboard lang="it" type="inline">.. Ritorno</keyboard>
|
|
41
|
+
<keyboard lang="id" type="inline">.. Kembali</keyboard>
|
|
42
|
+
|
|
43
|
+
<message><b>Help message</b></message>
|
|
44
|
+
<message lang="en"><b>Help message</b></message>
|
|
45
|
+
<message lang="it"><b>Ordina aiuto</b></message>
|
|
46
|
+
<message lang="id"><b>Pesan bantuan</b></message>
|
|
47
|
+
</base>
|
|
48
|
+
`
|
|
49
|
+
}
|
|
@@ -1,70 +1,69 @@
|
|
|
1
|
-
import { HelpPage } from "./help"
|
|
2
|
-
import { PageBase } from "~/base
|
|
3
|
-
|
|
4
|
-
export class StartPage extends PageBase {
|
|
5
|
-
public kb() {
|
|
6
|
-
return this.inlineKeyboard((kb, arr) => {
|
|
7
|
-
return kb
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
<keyboard type="inline">❓ Help</keyboard>
|
|
41
|
-
<keyboard lang="
|
|
42
|
-
<keyboard lang="
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
1
|
+
import { HelpPage } from "./help"
|
|
2
|
+
import { PageBase } from "~/base"
|
|
3
|
+
|
|
4
|
+
export class StartPage extends PageBase {
|
|
5
|
+
public kb() {
|
|
6
|
+
return this.inlineKeyboard((kb, arr) => {
|
|
7
|
+
return kb.text(arr[0]!, HelpPage.data.callbackData())
|
|
8
|
+
})
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
public async internal(edit = true) {
|
|
12
|
+
const kb = this.kb()
|
|
13
|
+
const data = { userName: this.userName }
|
|
14
|
+
if (edit) {
|
|
15
|
+
await this.edit(kb, data)
|
|
16
|
+
} else {
|
|
17
|
+
await this.reply(kb, data)
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
public async callback() {
|
|
22
|
+
await this.internal(true)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
public async text() {
|
|
26
|
+
await this.internal(false)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
public async textCommand() {
|
|
30
|
+
await this.internal(false)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
public async textCommandPayload() {
|
|
34
|
+
await this.internal(false)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public static template = /*jsx*/ `
|
|
38
|
+
<base>
|
|
39
|
+
<keyboard type="inline">❓ Help</keyboard>
|
|
40
|
+
<keyboard lang="en" type="inline">❓ Help</keyboard>
|
|
41
|
+
<keyboard lang="it" type="inline">❓ Aiuto</keyboard>
|
|
42
|
+
<keyboard lang="id" type="inline">❓ Bantuan</keyboard>
|
|
43
|
+
|
|
44
|
+
<message>
|
|
45
|
+
<b>Welcome to the bot {{userName}}</b>
|
|
46
|
+
|
|
47
|
+
<b>❓ Help</b> - View help
|
|
48
|
+
</message>
|
|
49
|
+
|
|
50
|
+
<message lang="en">
|
|
51
|
+
<b>Welcome to the bot {{userName}}</b>
|
|
52
|
+
|
|
53
|
+
<b>❓ Help</b> - View help
|
|
54
|
+
</message>
|
|
55
|
+
|
|
56
|
+
<message lang="it">
|
|
57
|
+
<b>Benvenuto nel Bot di {{userName}}</b>
|
|
58
|
+
|
|
59
|
+
<b>❓ Aiuto</b> - Ottieni assistenza e informazioni
|
|
60
|
+
</message>
|
|
61
|
+
|
|
62
|
+
<message lang="id">
|
|
63
|
+
<b>Selamat datang di bot {{userName}}</b>
|
|
64
|
+
|
|
65
|
+
<b>❓ Bantuan</b> - Lihat bantuan
|
|
66
|
+
</message>
|
|
67
|
+
</base>
|
|
68
|
+
`
|
|
69
|
+
}
|