I am using This ConversationHandler Script as a basis for my program.
How can I retrieve a users answer from a previous state? For example, when the user is asked about their Bio, how can I print their Gender (that was the first thing that was asked)?
It looks like each function returns the next steps (GENDER->PHOTO->LOCATION->BIO) but is there a way to see what a previous input was?
I faced exactly the same issue where I needed to keep previous user answers for a conversation. Take a look at Handler documentation which is a base class for all handlers. It has parameter called pass_user_data. When set to True it passes user_data dictionary to your handler and it's related to the user the update was sent from. You can utilize it to achieve what you are looking for.
Let's say I have a conversation with an entry point and two states:
Here are the handlers for the conversation:
In the first handler I show user keyboard to choose an option, in the next handler I grab selection from callback query and store it into user data. The last handler is a message handler so it has no callback data, but since I added user_data to it I can access the dictionary with the data that I added previously. With this approach you can store and access anything between the handlers that will be related to a user.