template-bot
April 30, 2018 ยท View on GitHub
๐ Kick-start a Telegram bot with telegraf.js and sao.
Features
- Build with telegraf.js.
- Lint with @atomix/eslint-config.
- Uses knex as a DB query builder.
Usage
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