How do I stop “ValueError: tortoise.backends.sqlite.client.SqliteClient object was created in a different Context”?
问题 I'm writing a discord bot and using tortoise orm to store data. I need to use transactions, but I continually get the following error: Full type of the error is <class 'discord.ext.commands.errors.CommandInvokeError'> Command raised an exception: ValueError: <Token var=<ContextVar name='default' default=<tortoise.backends.sqlite.client.SqliteClient object at 0x7f52ef5080d0> at 0x7f52ef362630> at 0x7f52dd636c80> was created in a different Context - [x] Traceback (most recent call last): - [x]