williamagyapong commited on
Commit
22f4c37
·
verified ·
1 Parent(s): 72f8142

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +7 -4
main.py CHANGED
@@ -115,10 +115,13 @@ def process_user_msg(message, mobile):
115
  messenger.send_message(f"*Raw Response*:\n {response}, \n \n *Parsed Response*:\n {parsed_trans_data}, \n \n *Final Response*:\n {response2}", recipient_id=mobile)
116
  else:
117
  # Persist transaction data temporarily for Create, Update, or Delete operations
118
- persist_temporary_transaction(parsed_trans_data, mobile)
119
- # messenger.send_message(f"{response} \n\n {parsed_trans_data}", mobile)
120
- # Give user the chance to confirm/cancel transaction before processing other intents
121
- messenger_reply_button(mobile, f"Raw Response: {response}, \n \n Parsed Response: {parsed_trans_data}")
 
 
 
122
 
123
  return True
124
 
 
115
  messenger.send_message(f"*Raw Response*:\n {response}, \n \n *Parsed Response*:\n {parsed_trans_data}, \n \n *Final Response*:\n {response2}", recipient_id=mobile)
116
  else:
117
  # Persist transaction data temporarily for Create, Update, or Delete operations
118
+ persist = persist_temporary_transaction(parsed_trans_data, mobile)
119
+ if persist:
120
+ messenger.send_message(f"{response} \n\n {parsed_trans_data}", mobile)
121
+ # Give user the chance to confirm/cancel transaction before processing other intents
122
+ messenger_reply_button(mobile, f"Raw Response: {response}, \n \n Parsed Response: {parsed_trans_data}")
123
+ else:
124
+ messenger.send_message("Please try again!", mobile)
125
 
126
  return True
127