πCallback functions
The module has several colback functions that are called as they are initialized:
def on_init
- Called after Stage2, due to the peculiarities of asynchronous programming the availability of the database is not guaranteedasync def on_db_ready
- Called immediately after full database initialization, useful to use if you need to work with the database immediately after startup
Example usage:
async def on_db_ready(self):
async with self.db.session_maker() as session:
# load chat states from database
Last updated