Skip to content

post_shutdown method in addition to post_init #3105

@91DarioDev

Description

@91DarioDev

What kind of feature are you missing? Where do you notice a shortcoming of PTB?

i would like to be able to await coroutines before of shutting down the bot after application.run_polling().

it could be done implementing a post_shutdown method in addition to the already existing post_init method

Describe the solution you'd like

It is especially useful for closing a db connection in aiosqlite ( await db.close() )

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions