GuysRGithub commited on
Commit
0ccc523
1 Parent(s): fe29a6c

Add chat API

Browse files
Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -101,5 +101,12 @@ def send_message(recipient_id, text):
101
 
102
  return response.json()
103
 
104
- subprocess.Popen(["autossh", "-M", "0", "-o", "StrictHostKeyChecking=no", "-i", "id_rsa", "-R", "guysmedchatt:80:localhost:7860", "serveo.net"])
 
 
 
 
 
 
 
105
  # subprocess.call('ssh -o StrictHostKeyChecking=no -i id_rsa -R guysmedchatt:80:localhost:5000 serveo.net', shell=True)
 
101
 
102
  return response.json()
103
 
104
+ @app.route("/webhook/chat", methods=['POST'])
105
+ def chat():
106
+ payload = request.json
107
+ message = payload['message']
108
+ response = get_bot_response(message)
109
+ return response
110
+
111
+ subprocess.Popen(["ssh", "-M", "0", "-o", "StrictHostKeyChecking=no", "-i", "id_rsa", "-R", "guysmedchatt:80:localhost:7860", "serveo.net"])
112
  # subprocess.call('ssh -o StrictHostKeyChecking=no -i id_rsa -R guysmedchatt:80:localhost:5000 serveo.net', shell=True)