Skip to content
This repository has been archived by the owner on Sep 6, 2020. It is now read-only.

vikmind/pfa-telegram

Repository files navigation

Personal finances telegram bot

Send your spendings to bot and it will add them to specified spreadsheet.

Preparation steps

  1. Add google credentials as described in Google Sheets API Node.js Quickstart, content of client_secret.json file is CLIENT_SECRET
  2. Create your bot with @botfather, it's token is BOT_TOKEN
  3. Create spreadsheet with Google's template Monthly budget, assign SHEET_ID variable to its ID

Starting locally

  1. cp .env.example .env
  2. Fill .env:
    1. POLLING=true: for local usage you can work without webhook's configuratoin
    2. STORAGE=file: for quick start you shouldn't configure db
  3. npm install
  4. npm start

Deploy to Heroku

You can deploy your own instance of this bot by following this steps:

  1. Install Heroku CLI
  2. Create project heroku create <your-name>
  3. Add postgress add-on heroku addons:create heroku-postgresql:hobby-dev
  4. Fill environment variables on project's dashboard:
    1. WEBHOOK_ROOT is the address of your project, like https://<your-name>.heroku.com
    2. POLLING=false: Apps on Heroku shut down from time to time, so you need to use webhooks.
    3. BOT_TOKEN, SHEET_ID, CLIENT_SECRET: see above
    4. ADAPTER=standart
    5. STORAGE=db
  5. git push heroku master

About adapters

I have slightly different spreadsheet from default template, so I have changed data-to-rows converters. Feel free to create your own: maybe you will use this app for completely different purpose?

About

Personal finances telegram bot

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published