Skip to content

Instantly share code, notes, and snippets.

Created August 19, 2020 21:46
What would you like to do?
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)
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