Я делал один код и там мне нужен sql, я взял sqlite, я не понимаю почему оно так говорит, просто потому, что он даже не создал файл, посмотрите мой код, может найдете ошибку:
async def on_ready():
print("Бот готов к работе")
await bot.change_presence(status=discord.Status.idle,activity=discord.Game("n!help"))
global color
color = random.randint(000000,999999)
cursor.execute("""CREATE TABLE IF NOT EXISTS users (
name TEXT,
id INT,
xp BIGINT,
lvl INT,
premium TEXT,
messages BIGINT,
guild_id INT
)""")
cursor.execute("""CREATE TABLE IF NOT EXISTS shops (
role_id INT,
id INT,
cost BIGINT
)""")
cursor.execute("""CREATE TABLE IF NOT EXISTS economy (
id INT,
cash BIGINT,
bank BIGINT,
vakanc INT,
staj INT,
guild_id INT,
credits INT,
credit1 BIGINT,
credit2 BIGINT,
credit3 BIGINT,
credit4 BIGINT,
credit5 BIGINT,
credit6 BIGINT,
nad TEXT
)""")
cursor.execute("""CREATE TABLE IF NOT EXISTS settings (
name TEXT,
guild_id INT,
prefix TEXT,
color TEXT
)""")
connection.commit()
for guild in bot.guilds:
for member in guild.members:
if member.bot is True:
pass
else:
if cursor.execute("SELECT id FROM users WHERE id = ?", ( member.id, )).fetchone() is None:
cursor.execute("INSERT INTO users VALUES (?, ?, 0, 1,?,0,?)",
( str(member), member.id, "no", guild.id , ) )
connection.commit()
else:
pass
if cursor.execute("SELECT id FROM economy WHERE id = ?", ( member.id, )).fetchone() is None:
cursor.execute("INSERT INTO economy VALUES(?,100,0,0,0,?,0,0,0,0,0,0,0,?)",
(member.id,guild.id,"no") )
else:
pass
Вот тут у меня выходит ошибка:
Ignoring exception in on_ready
Traceback (most recent call last):
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/site-packages/disnake/client.py", line 700, in _run_event
await coro(*args, **kwargs)
File "<string>", line 99, in on_ready
sqlite3.OperationalError: table economy has 6 columns but 14 values were supplied
Делал я на disnake