Skip to content

Latest commit

 

History

History
65 lines (51 loc) · 2.16 KB

README.md

File metadata and controls

65 lines (51 loc) · 2.16 KB

Google "Dialogflow" and telegram bot and vk bot

Project to integration google api dialogflow in telegram bot and vk bot via python-telegram-bot and vk-api modules.

Getting Started

  • Via python-telegram-bot and vk-api modules created simple echo bot on telegram messenger, and vkontakte social network.
  • Create Group in VK and use vk api to get secret key vk API.
  • Fulfill all necessary conditions on google cloud and create dialogflow agent.
  • Get all necessary api key and fill .env file.
BOT_TOKEN="your telegram bot token"
PROJECT_ID="your google cloud project identification"
CHAT_ID="your chat ID"
DIALOG_TOKEN="dialog flow agent token"
GOOGLE_APPLICATION_CREDENTIALS ="your credentials JSON file"
VK_GROUP_KEY="vk api secret key"

Running

Running from command line:

python tg_bot.py 

to start telegram bot.

python vk_bot.py 

to start vkontakte bot.

Training dialog flow agent to new phrases in code

Dialog flow agent training by json file. Specify the path to the file.

to start:

python training.py [file path]

Example content of training phrases, json file:

    "Устройство на работу": {
        "questions": [
            "Как устроиться к вам на работу?",
            "Как устроиться к вам?",
            "Как работать у вас?",
            "Хочу работать у вас",
            "Возможно-ли устроиться к вам?",
            "Можно-ли мне поработать у вас?",
            "Хочу работать редактором у вас"
        ],
        "answer": "Если вы хотите устроиться к нам, напишите на почту game-of-verbs@gmail.com мини-эссе о себе и прикрепите ваше портфолио."
    },  ...

License

You may copy, distribute and modify the software.