Created
August 19, 2020 21:46
-
-
Save MemphisMeng/ad83f9ce612ec5cd329e5444dc59d050 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
response, similarity = transformer.match_query(message['message'].get('text')) | |
# no acceptable answers found in the pool | |
if similarity < 0.5: | |
response = "Please wait! Our representative is on the way to help you!" | |
bot.send_text_message(recipient_id, response) | |
else: | |
responses = response.split('|') | |
for r in responses: | |
if r != '': | |
bot.send_text_message(recipient_id, r.strip()) | |
insert(message, response) | |
# if user sends us a GIF, photo,video, or any other non-text item | |
if message['message'].get('attachments'): | |
i = 0 | |
while i < 1: | |
bot.send_text_message(recipient_id, "Interesting! Anything else I could help?") | |
i += 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment