Skip to content

tsnaik/helth-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

  • Node.js 16+. Recommended to use nvm to get the specific Node.js version. Package managers often don't have newer versions.
  • Yarn

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published