Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

How get current dialog state from dialog_manager #411

Open
kadyrovfriend opened this issue Jun 10, 2024 · 1 comment
Open

How get current dialog state from dialog_manager #411

kadyrovfriend opened this issue Jun 10, 2024 · 1 comment
Labels
question Further information is requested

Comments

@kadyrovfriend
Copy link

Hi!
Is there an easy way to get the name of dialog, or its state from dialog_manager?

So i`ve made путукфд handler for all exceptions, ocurred in my code, sending message to admin with description of error. And i need the name of dialog, so i can recreate the bug.

dialog_manager.middleware_data.raw_state was my first option, but this variable is None
So I can iterate through storage to find the last state, but maybe there are easier ways to find the current state?

@F0rgenet
Copy link

F0rgenet commented Jul 10, 2024

if dialog_manager.has_context():
    current_state: State = dialog_manager.current_context().state

@Tishka17 Tishka17 added the question Further information is requested label Jul 14, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants