tranvietphuoc / python-orders-collector-bot

Reading comments of members of telegram's chat group. Splitting all orders relying on regex then save the information to google sheets.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This is a telegram bot to collect data of order in a chat room

Requirement:

  • pyTelegramBotAPI
  • flask
  • oauth2client
  • gspread
  • poetry

Prepare!!!

  • On telegram app, go to botfather to make a telegram bot, then get API key and save into .env file
  • Make google api: The gspread documentation explains how to create Google OAuth2.0 JWTs
  • Save the JWTs file into working directory
  • In the working directory, run poetry install to make the virtualenv. Then poetry shell to activate virtual environment, poetry run python app.py to run app in debug mode

How to deploy?

  1. Install heroku cli
  2. Login to heroku by heroku login
  3. Create new app
  4. Go to tab setting, choose Reveal Config Vars to set environment variables follow .env file
  5. Use command: heroku container:push --app <PROJECT_NAME> web to build and push docker file
  6. Use command: heroku container:release --app <PROJECT_NAME> web to release this app
  7. Done! Go to telegram bot to check the result.

About

Reading comments of members of telegram's chat group. Splitting all orders relying on regex then save the information to google sheets.


Languages

Language:Python 95.9%Language:Shell 2.3%Language:Dockerfile 1.8%