Access turn_context in a waterfall dialog

Viewed 21

The recommended way to access a user's aad_object_id value is via the TurnContext class.

I have trouble accessing this value from within a waterfall dialog. My ideal codebase looks something like

bots/
   -dialog_bot.py # Which contains the ActivityHandler and TurnContext
dialog/
   -Waterfall_dialog.py # Which contains the Waterfall dialog
app.py 

From reading the Botbuilder documentation, it would seem that TurnContext calls the dialog on each turn. I can't seem to pass the values contained with TurnContext to be read inside of the Dialog

1 Answers

If you are using the WaterfallDialog. It can be accessed by

async def some_step(self, step_context: WaterfallStepContext) -> DialogTurnResult:
    print(step_context.context.activity.from_property)
Related