Skip to content

[BUG] Improve readability of nested conversation example #1941

@mr-rooftop

Description

@mr-rooftop

Issue I am facing

Tried to understand the example of the nested conversation handler example https://github.com/python-telegram-bot/python-telegram-bot/blob/master/examples/nestedconversationbot.py

At the bottom, lines 354 - 357, there is this code snippet:

# Because the states of the third level conversation map to the ones of the
# second level conversation, we need to be a bit hacky about that:
conv_handler.states[SELECTING_LEVEL] = conv_handler.states[SELECTING_ACTION]
conv_handler.states[STOPPING] = conv_handler.entry_points
  1. What does the conversation state assignment do?
  2. Why is it needed?
  3. Why is it 'hacky'?

I asked the same question in the telegram group, but my post got lost amongst messages of 5000 channel members.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ⚙️ examplesaffected functionality: examples

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions