Skip to content

Commit

Permalink
modify chatbot.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Haebuk committed Jul 21, 2021
1 parent a9bea6c commit 95ba2e9
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 6 deletions.
15 changes: 15 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal"
}
]
}
Binary file modified project/flask/api/__pycache__/chatbot.cpython-38.pyc
Binary file not shown.
8 changes: 5 additions & 3 deletions project/flask/api/chatbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import requests
import json
from datetime import datetime
import time

class ChatbotMessageSender:

Expand All @@ -23,7 +24,7 @@ def req_message_send(self):
{
'type': 'text',
'data': {
'description': '도서 추천해줘'
'description': '아몬드랑 비슷한 책 추천해줘'
}
}
],
Expand Down Expand Up @@ -97,10 +98,11 @@ def success(self):
response = requests.post(headers=custom_headers, url=self.ep_path, data=encode_request_body)

return response

@staticmethod
def get_timestamp():
timestamp = datetime.now()
return str(timestamp)
timestamp = int(time.time() * 1000)
return timestamp

@staticmethod
def make_signature(secret_key, request_body):
Expand Down
9 changes: 6 additions & 3 deletions project/flask/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@
# return render_template('bookcode.html')

if __name__ == '__main__':
# message_send = CM().req_message_send()
app.run(debug=True)
welcome_message = CM().welcome()
res = CM().req_message_send()
print(res.status_code)
if(res.status_code == 200):
print(res.text)
# print(res.read().d


0 comments on commit 95ba2e9

Please sign in to comment.