create-gramstax 0.0.20 → 0.0.22

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.
@@ -0,0 +1,6 @@
1
+ export const env = {
2
+ BOT_TOKEN: process.env.BOT_TOKEN as string,
3
+ BOT_DEPLOY: process.env.BOT_DEPLOY as string,
4
+ NODE_ENV: process.env.NODE_ENV as string,
5
+ CACHE_SESSION: process.env.CACHE_SESSION as string
6
+ }
@@ -1,3 +1,4 @@
1
+ import { env } from "./env"
1
2
  import { log } from "./utils/log"
2
3
  import { BotCore } from "./core/bot"
3
4
  import { MainThread } from "./threads/main"
@@ -6,12 +7,9 @@ import { CacheExternal } from "gramstax"
6
7
  new MainThread(() => {
7
8
  log.success(`Bot started..`)
8
9
 
9
- const token = process.env.BOT_TOKEN as string
10
- const deploy = process.env.BOT_DEPLOY as string
11
- const cache = process.env.CACHE_SESSION as string
12
10
  new BotCore({
13
- token,
14
- deploy,
15
- cacheSession: new CacheExternal(cache, `session`, 24 * 60 * 60 * 1000)
11
+ token: env.BOT_TOKEN,
12
+ deploy: env.BOT_DEPLOY,
13
+ cacheSession: new CacheExternal(env.CACHE_SESSION, `session`, 24 * 60 * 60 * 1000)
16
14
  })
17
15
  })
@@ -3,7 +3,7 @@ import { StartPage } from "./start"
3
3
 
4
4
  export class GeneralErrorInputNotFoundPage extends PageBase {
5
5
  public kb() {
6
- return this.buildInlineKeyboard((kb, arr) => {
6
+ return this.inlineKeyboard((kb, arr) => {
7
7
  return kb.text(arr[0], StartPage.data.callbackData())
8
8
  })
9
9
  }
@@ -3,7 +3,7 @@ import { StartPage } from "./start"
3
3
 
4
4
  export class GeneralErrorPage extends PageBase {
5
5
  public kb() {
6
- return this.buildInlineKeyboard((kb, arr) => {
6
+ return this.inlineKeyboard((kb, arr) => {
7
7
  return kb.text(arr[0], StartPage.data.callbackData())
8
8
  })
9
9
  }
@@ -3,7 +3,7 @@ import { StartPage } from "./start"
3
3
 
4
4
  export class HelpPage extends PageBase {
5
5
  public kb() {
6
- return this.buildInlineKeyboard((kb, arr) => {
6
+ return this.inlineKeyboard((kb, arr) => {
7
7
  return kb //
8
8
  .text(arr[0], StartPage.data.callbackData())
9
9
  })
@@ -3,7 +3,7 @@ import { PageBase } from "~/base/page"
3
3
 
4
4
  export class StartPage extends PageBase {
5
5
  public kb() {
6
- return this.buildInlineKeyboard((kb, arr) => {
6
+ return this.inlineKeyboard((kb, arr) => {
7
7
  return kb //
8
8
  .text(arr[0], HelpPage.data.callbackData())
9
9
  })
@@ -3,7 +3,7 @@ import { PageBase } from "~/base/page"
3
3
 
4
4
  export class UserNameNotFoundPage extends PageBase {
5
5
  public kb() {
6
- return this.buildInlineKeyboard((kb, arr) => {
6
+ return this.inlineKeyboard((kb, arr) => {
7
7
  return kb //
8
8
  .text(arr[0], HelpPage.data.callbackData())
9
9
  })
@@ -2,4 +2,4 @@
2
2
 
3
3
  import { RepositoryBase } from "../base/repository"
4
4
 
5
- export class ExampleRepository extends RepositoryBase {}
5
+ export class ExampleRepo extends RepositoryBase {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-gramstax",
3
- "version": "0.0.20",
3
+ "version": "0.0.22",
4
4
  "private": false,
5
5
  "description": "CLI tool to quickly create a new Gramstax Telegram bot project with all the best practices",
6
6
  "keywords": [