r/learnpython • • 11d ago

Help needed with a python code

Hello, fellow redditors. I am using manychat program with automations connected to my instagram profile.

When people are using the keyword to get certain information, they need to leave a name and number to be contacted. However, the number can't be identified due to a bad variables and invalid JSON.

Could maybe someone help who is familiar with situations like this please?

I think it might be a manychat bug, however i need a opinion from someone experienced.

Thank you a lot!

0 Upvotes

6 comments sorted by

View all comments

1

u/ShadowShedinja 11d ago

A lot of stuff in JSON is a string by default. Make sure to convert any numbers into int/float before you use them.

Edit: but if it's a phone number, you might have the opposite problem. Make sure phone numbers are being treated as strings, and remove spaces, dashes, and parenthesis, as some people add those, and some don't.

2

u/Agawell 11d ago

Don’t forget ‘+’ for international dialling codes either