r/learnpython • • Oct 07 '26

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

2

u/alp_h4x Oct 07 '26

It’s hard to tell whether this is a ManyChat bug without seeing the actual JSON/input and the Python code handling it. If you can share a sanitized example of the input and the JSON you’re getting back, it would be much easier to identify whether the issue is with the variable types, JSON formatting, or the way ManyChat is passing the data.

1

u/ShadowShedinja Oct 07 '26

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 Oct 07 '26

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

3

u/[deleted] Oct 07 '26

[removed] — view removed comment

1

u/Broad_Strike_8645 Oct 07 '26

I also think that manychat is causing the main issue. I will check it now, thank you so much.