tsnaik / helth-bot

MIT License
3 stars 3 forks source link

helth-bot

Contributing to helth-bot

  1. Fork the Repo
  2. Clone repo in your local workspace git clone <repo_url>
  3. Track origin/dev branch git branch dev
  4. Create new feature branch git checkout -b new-feature-branch
  5. Commit your change git commit -m "message"
  6. Push your change git push origin new-feature-branch
  7. Create Pull Request using UI

Reference: https://www.youtube.com/watch?v=8lGpZkjnkt4&ab_channel=Fireship

Pre-requisites

Create telegram bot for development

To use the Telegram Bot API, you first have to get a bot account by chatting with BotFather.

BotFather will give you a token, something like 123456789:AbCdfGhIJKlmNoQQRsTUVwxyZ.

Put it in a file named .env:

BOT_TOKEN=123456789:AbCdfGhIJKlmNoQQRsTUVwxyZ

(optional: you can also specify a port for the server in .env)

PORT=5000

Installing required modules

yarn install

Running bot server locally

yarn start

Linting js source files

yarn lint

...and fix (some of the) lint errors

yarn lint-fix

Production Deployment

Set following variables in your production environment:

  1. BOT_TOKEN: Same as above
  2. WEBHOOK_DOMAIN: Domain of your web server. It be running on port 80 and support HTTPS. Example value:mydomain.com