π Kick-start a Telegram bot with telegraf.js
and sao
.
- Build with telegraf.js.
- Lint with @atomix/eslint-config.
- Uses knex as a DB query builder.
Install SAO first:
$ npm i sao -g
Or for crazy junkies:
$ sudo npm i sao -g
Then create a new bot:
$ sao piterden/template-bot my-new-bot --update --force-npm
$ cd my-new-bot
Or for npm@5
you \wo sao
install:
$ npx sao piterden/template-bot my-new-bot --update --force-npm
$ cd my-new-bot
The .env
file:
NODE_ENV=development
BOT_TOKEN=
BOT_NAME=
DB_HOST=127.0.0.1
DB_PORT=3306
DB_CLIENT=mysql
DB_DATABASE=
DB_USERNAME=
DB_PASSWORD=
DB_CHARSET=utf8mb4
DB_MIGRATIONS_TABLE=migrations
DEBUG_COLORS=true
DEBUG_SHOW_HIDDEN=true
DEBUG_DEPTH=10
The bot's default structure:
βββ migrations/
βββ src/
β βββ handlers/
β β βββ help/
β β β βββ index.js
β β βββ settings/
β β β βββ index.js
β β βββ start/
β β β βββ index.js
β β βββ index.js
β βββ helpers/
β β βββ debug/
β β β βββ index.js
β β βββ index.js
β βββ keyboards/
β β βββ index.js
β βββ scenes/
β β βββ index.js
β βββ index.js
βββ .gitignore
βββ knexfile.js
βββ LICENSE
βββ README.md
βββ package.json