Reputation: 11
I am making a discord bot using python, and I have run into an unexplainable error which I am unable to fix. I thought I fixed it by deleting the checks but I'm completely stumped by the massive block of errors I'm getting. If anyone could please decode even some of this, I would be greatly appreciative.
Task exception was never retrieved future: <Task finished name='CommandTree-invoker' coro=<CommandTree._from_interaction..wrapper() done, defined at C:\Users\mitsuk\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\discord\app_commands\tree.py:1089> exception=OperationalError('no such table: blacklist')> Traceback (most recent call last): File "C:\Users\mitsuk\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\discord\app_commands\tree.py", line 1091, in wrapper await self._call(interaction) File "C:\Users\mitsuk\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\discord\app_commands\tree.py", line 1242, in _call await command._invoke_with_namespace(interaction, namespace) File "C:\Users\mitsuk\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\discord\ext\commands\hybrid.py", line 436, in _invoke_with_namespace await command.prepare(ctx) File "C:\Users\mitsuk\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\discord\ext\commands\core.py", line 919, in prepare if not await self.can_run(ctx): File "C:\Users\mitsuk\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\discord\ext\commands\hybrid.py", line 524, in can_run return await self.app_command._check_can_run(ctx.interaction) File "C:\Users\mitsuk\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\discord\ext\commands\hybrid.py", line 418, in _check_can_run if self.wrapped.checks and not await async_all(f(ctx) for f in self.wrapped.checks): File "C:\Users\mitsuk\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\discord\utils.py", line 674, in async_all elem = await elem File "C:\Users\mitsuk\Documents\rirakkumabot\main\helpers\checks.py", line 31, in predicate if await db_manager.is_blacklisted(context.author.id): File "C:\Users\mitsuk\Documents\rirakkumabot\main\helpers\db_manager.py", line 8, in is_blacklisted async with db.execute("SELECT * FROM blacklist WHERE user_id=?", (user_id,)) as cursor: File "C:\Users\mitsuk\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\aiosqlite\context.py", line 41, in aenter self._obj = await self._coro File "C:\Users\mitsuk\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\aiosqlite\core.py", line 184, in execute cursor = await self._execute(self._conn.execute, sql, parameters) File "C:\Users\mitsuk\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\aiosqlite\core.py", line 129, in _execute return await future File "C:\Users\mitsuk\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\aiosqlite\core.py", line 102, in run result = function() sqlite3.OperationalError: no such table: blacklist
Upvotes: 0
Views: 614
Reputation: 718
In the file C:\Users\mitsuk\Documents\rirakkumabot\main\helpers\db_manager.py, line 8
async with db.execute("SELECT * FROM blacklist WHERE user_id=?", (user_id,)) as cursor:
Error message
sqlite3.OperationalError: no such table: blacklist
This error means that there's no table named blacklist
in the database; you may want to create it before accessing it.
Upvotes: 0