Spaces:
Runtime error
Runtime error
| def gathering_data(res): | |
| try: | |
| phone_number = res["entry"][0]["changes"][0]["value"]["messages"][0]["from"] | |
| except BaseException: | |
| return None | |
| try: | |
| text = res["entry"][0]["changes"][0]["value"]["messages"][0]["text"]["body"] | |
| try: | |
| text = int(text) | |
| except BaseException: | |
| pass | |
| except BaseException: | |
| try: | |
| text = res["entry"][0]["changes"][0]["value"]["messages"][0]["button"][ | |
| "text" | |
| ] | |
| except BaseException: | |
| text = res["entry"][0]["changes"][0]["value"]["messages"][0]["location"] | |
| return phone_number, str(text) | |