diff --git a/app/bot/events.py b/app/bot/events.py index d05c618..a17b4ce 100644 --- a/app/bot/events.py +++ b/app/bot/events.py @@ -22,10 +22,10 @@ def postmessage(message): current['message'].append(mess) update = {"$set":{"message":current['message']}} db_m.update_one(db_m.find(query)[0],update) - print("About to Execute Response") try: response=requests.post(app.config['ADI_BOT_URL'],data=json.dumps({'sender':hash(request.remote_addr),'message':mess})) + response=response.json() except requests.exceptions.ConnectionError: - response={'text':'Connection to Bot Failed, Sorry!'} - print("Emitted") - emit('received_message',response) \ No newline at end of file + response=[{'text':'Connection to Bot Failed, Sorry!'}] + print(response) + emit('received_message',{'data':response}) \ No newline at end of file diff --git a/app/bot/routes.py b/app/bot/routes.py index 6f1abcd..ddb93a8 100644 --- a/app/bot/routes.py +++ b/app/bot/routes.py @@ -1,8 +1,3 @@ from . import bot from app import db_m -@bot.route('/hello') -def bot_helloe(): - todos = db_m.todos - todos.insert_one({'content': 'Trial', 'degree': 'Trial'}) - return "Bot Hello Here" \ No newline at end of file diff --git a/app/templates/base.html b/app/templates/base.html index 46c37ba..33843e2 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -69,7 +69,7 @@ {% block body %} {% endblock %} -

Bot Coming Soon....

+

Bot Beta Version is here...