Изменить язык: Русский
Telegram bot for automated collection of applications for the provision of services - transfers data filled in by the user to a google spreadsheet, sends a notification to the manager about the applications left.
- Collects information about the user
- Checks if the application was left for the first time
- Transfers user-filled data to google spreadsheets
- Notifies the manager about abandoned applications, fixes unprocessed applications in the dialog
- Colors in green the requests processed by the manager
- Accepts payment confirmation, as well as a client request in text or audio format and sends it to the manager
For convenience, it is recommended to add these commands to the side menu of the bot using BotFather.
- menu - calls the menu (add via BotFather for convenient display)
- taro - request a service for deciphering the date of birth
- help - help
- Logging in case of an error is carried out in the file py_log.log
- Install dependencies:
pip install -r requirements.txt- in the .env file specify:
- Bot telegram token: TELEGRAM_TOKEN=TOKEN
- Bot ID: BOT_ID=ID (first digits from bot token, before :)
- Manager ID: MANAGER_ID=MANAGER_ID; will have the right to execute the /update command, he will receive notifications - to receive notifications, the manager needs to activate the bot from his account (press the "start" button)
To determine the user ID, you need to send any message from the corresponding account to the next [bot] (https://t.me/getmyid_bot). Value contained in Your user ID - User ID
- Links to telegram channel and instagram TELEGRAM_CHANNEL_LINK, INSTAGRAM_LINK
- Manager username - the "manager" button in the menu will enter the specified profile: MANAGER_USERNAME=example (specified without @)
- get file with credentials (connection parameters):
https://console.cloud.google.com/
https://www.youtube.com/watch?v=bu5wXjz2KvU - instruction from 00:00 to 02:35
Save the resulting file in the root of the project, with the name service_account.json - provide service e-mail with access to the table (instruction in the video at the link above)
- set the following variables in the config.py file:
IMAGE_ID - ID of the greeting image sent by the bot (to which it has access)
SPREAD_NAME - the name of the table in google sheets where data about new applications is written
LIST_NAME - sheet name in the table - run the project:
python3 main.py- before activating the bot, be sure to set the names of the columns for easy navigation and correct operation:
- order of displayed information on the application sheet:
- unique user ID
- user nickname in Telegram
- username
- last name of the user
- user's instagram link
- date of birth of the user
- time of sending the application (Moscow)
- order of displayed information on the application sheet: