How to fix: sqlite3.ProgrammingError: parameters are of unsupported type?

103 views Asked by At

I am trying to create a ticket system, where it pulls the guild_id from SQlite3, but it does not work

I have already tried changing it so that its is defined as different things, but it does not work. this is the code

conn1 = sqlite3.connect('user.sqlite')
cur1 = conn1.cursor()
conn2 = sqlite3.connect('setup.sqlite')
cur2 = conn2.cursor()
cur1.execute("""CREATE TABLE IF NOT EXISTS ticket 
           (id INTEGER PRIMARY KEY AUTOINCREMENT, discord_name TEXT, discord_id INTEGER, ticket_created TIMESTAMP DEFAULT CURRENT_TIMESTAMP)""")
conn1.commit()
guild = discord.Guild
print(guild)
GUILD_ID = cur2.execute("SELECT guild_id FROM setup WHERE guild_id = ?", (guild.id)) 

Table:

CREATE TABLE "setup" (
    "guild_id"  NUMERIC,
    "ticket_channel_id" NUMERIC,
    "category_id_1" NUMERIC,
    "category_id_2" NUMERIC,
    "team_role_id_1"    NUMERIC,
    "team_role_id_2"    NUMERIC,
    "log_channel_id"    NUMERIC,
    "timezone"  TEXT
);

Error:

parameters are of unsupported type
  File "C:\Users\My name\Documents\Bot\ticket_system.py", line 23, in <module>
    GUILD_ID = cur2.execute("SELECT guild_id FROM setup WHERE guild_id = ?", (guild.id))
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\My name\Documents\Bot\Bot.py", line 20, in <module>
    from ticket_system import Ticket_System
sqlite3.ProgrammingError: parameters are of unsupported type```
0

There are 0 answers