Home > Net >  Why do I get error "ValueError: parameters are of unsupported type"?
Why do I get error "ValueError: parameters are of unsupported type"?

Time:11-12

I get the error:

ValueError: parameters are of unsupported type

The code :

async def add(ctx, el: str, email: str, password: str):
    con= sqlite3.connect("db.sqlite")
    c = con.cursor()
    c.execute("SELECT type FROM accounts WHERE type=?", (el,))
    results = c.fetchall()
    if len(results) == 0:
        await ctx.send("there is no type with this")
    else:
        c.execute("UPDATE accounts SET type = ?, email = ?, password = ? ;", {el, email, password})
        print("done")
        await ctx.send("done")
    con.commit()
    con.close()

Error trace:

Ignoring exception in command add:
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 42, in add
    c.execute("UPDATE accounts SET type = ?, email = ?, password = ? ;", {el, email, password})
ValueError: parameters are of unsupported type

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: ValueError: parameters are of unsupported type

CodePudding user response:

I feel so dumb right now I really wanna cry

the problem is that i did after the c.execute("UPDATE accounts SET type = ?, email = ?, password = ? ;") I putted a {el, email, password} instead of (el, email, password)...

  • Related