【发布时间】:2022-11-02 04:43:54
【问题描述】:
当我试图从我的数据库(sqlite3)中删除特定的东西时,它给了我错误:discord.errors.ApplicationCommandInvokeError: Application Command raised an exception: OperationalError: near ",": syntax error 由于某些原因,这是所需的代码:
c.execute("DELETE FROM accounts WHERE email=?, password=?", (newresults[0], newresults[1]))
顺便说一下,值 newresults[0] 和 newresults[1] 是在主代码中定义的。
这是完整的追溯:
Ignoring exception in command buy:
Traceback (most recent call last):
File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 127, in wrapped
ret = await coro(arg)
File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 911, in _invoke
await self.callback(ctx, **kwargs)
File "C:\Users\user\Desktop\Sidtho\main.py", line 62, in buy
c.execute("DELETE FROM accounts WHERE email=?, password=?", (newresults[0], newresults[1]))
sqlite3.OperationalError: near ",": syntax error
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\bot.py", line 1008, in invoke_application_command
await ctx.command.invoke(ctx)
File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 359, in invoke
await injected(ctx)
File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 135, in wrapped
raise ApplicationCommandInvokeError(exc) from exc
discord.errors.ApplicationCommandInvokeError: Application Command raised an exception: OperationalError: near ",": syntax error
【问题讨论】:
标签: python sqlite discord.py pycord