diff --git a/README.rst b/README.rst index 0a5dadc..bfc6da6 100644 --- a/README.rst +++ b/README.rst @@ -19,6 +19,8 @@ Installation Usage ====== +For Web Bot +----------- in settings.py add the following:: INSTALLED_APPS = [ @@ -43,30 +45,9 @@ in urls.py add the following:: ... ] -For Microsoft Bot Framework Webhook ------------------------------------ - -in addition to the above in settings.py add -:: - - APP_CLIENT_ID = "" - APP_CLIENT_SECRET = "" - - -in urls.py add the following:: - - from django.chatbot.views import botframework - - urlpatterns = [ - ... - path("botframework-webhook/", - botframework.web_hook, - name="botframework-webhook"), - ... - ] Web Hook API (should authenticate before API request) -===================================================== +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :: URL: /webhook/ @@ -79,15 +60,49 @@ Web Hook API (should authenticate before API request) "status": "Success", "messages": [ { - "id": 6, "text": "what is dosa", + "id": 6, "text": "what is dosa", "created": "2020-03-22 19:42:59", "by": "user" }, { - "id": 7, - "text": "A dosa is a cooked flat thin layered rice batter, originating from South India, made from a fermented batter....", - "created": "2020-03-22 19:42:59", + "id": 7, + "text": "A dosa is a cooked flat thin layered rice batter, originating from South India, made from a fermented batter....", + "created": "2020-03-22 19:42:59", "by": "bot" } ] } - + + + +For Microsoft Bot Framework Webhook +----------------------------------- + +pip install django-background-task + +in settings.py add the following:: + + INSTALLED_APPS = [ + ... + 'background_task', + 'django.chatbot', + ... + ] + + CHATBOT_TEMPLATE = + START_MESSAGE = "Welcome to ChatBotAI" + APP_CLIENT_ID = "" + APP_CLIENT_SECRET = "" + + + +in urls.py add the following:: + + from django.chatbot.views import botframework + + urlpatterns = [ + ... + path("webhook/", + botframework.web_hook, + name="botframework-webhook"), + ... + ] diff --git a/django_chatbot/__init__.py b/django_chatbot/__init__.py index 9ca62ca..8d35570 100644 --- a/django_chatbot/__init__.py +++ b/django_chatbot/__init__.py @@ -1,6 +1,3 @@ -from .chatbot import chat - - VERSION = (0, 0, 2) __version__ = '.'.join(map(str, VERSION))