Smart support bots

Maintainability Build Status Documentation Status GitHub wemake-python-styleguide

This repository contains Telegram and Vkontakte bots that help support small and medium-sized businesses in communicating with customers. They close all the typical questions, but something more difficult – redirect to the operators. To increase the quality of communication bots are trained by Dialogflow.

Dialogflow (formerly Api.ai, Speaktoit) is a Google-owned developer of human–computer interaction technologies based on natural language conversations. The company is best known for creating the Assistant (by Speaktoit), a virtual buddy for Android, iOS, and Windows Phone smartphones that performs tasks and answers users’ question in a natural language. Speaktoit has also created a natural language processing engine that incorporates conversation context like dialogue history, location and user preferences. — Wiki.

Telegram bot

VK bot

View bots in the work can be on the links:

How to install

  • Copy the scripts to your computer:

    git clone https://github.com/eskelevir/support-bots.git
    
  • Go to the folder:

    cd support-bots
    
  • Install the required python packages:

Python3 should be already installed. Then use pip (or pip3, if there is a conflict with Python2) to install dependencies:

pip install -r requirements.txt

Remember, it is recommended to use virtualenv/venv for better isolation.

  • Get the necessary data to work with Dialogflow (link)

  • Get the necessary data to work with Vkontakte and Telegram (link)

  • Create and configure Telegram bot to receive notifications (link)

  • Training of Dialogflow (link)

  • Create the file. env and record the received data:

       echo "DIALOGFLOW_PROJECT_ID=your project id_of Dialogflow" > .env
       echo "DIALOGFLOW_LANGUAGE_CODE=language training dialogflow(example 'ru' or 'en')" >> .env
       echo "GOOGLE_APPLICATION_CREDENTIALS=the path to the json file with the keys to google.cloud" >> .env
       echo "VK_TOKEN_OF_GROUP=your token of group of Vkontakte" >> .env
       echo "TG_TOKEN=your token of Telegram" >> .env
       echo "TG_LOGGER_BOT_CHAT_ID=your chat id of Telegram logger bot" >> .env
       echo "TG_LOGGER_TOKEN=your token of Telegram logger bot" >> .env
    
    Example .env file:
    
    DIALOGFLOW_PROJECT_ID=newagent-hbyugfrt
    DIALOGFLOW_LANGUAGE_CODE=ru
    GOOGLE_APPLICATION_CREDENTIALS=credentials.json
    VK_TOKEN_OF_GROUP=ght5rfyhnee7jgjgd98itkg785hfyr644hfyr7756h
    TG_TOKEN=125125489:fhHHy4rfg**hjdhry46GGG64gfgrj
    TG_LOGGER_BOT_CHAT_ID=123456789
    TG_LOGGER_TOKEN=25148548:AAGx2C7WH-9gjfurhfytJ0BXeJc6ddjfufurjfmx64hdf-io
    

How to run

Telegram bot:

python3 tg_bot.py

VK bot:

python3 vk_bot.py

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project Goals

The code is written for educational purposes on online-course for web-developers dvmn.org.

Indices and tables