The bot adds only itself to the database, but not me
Code:
@bot.event
async def on_ready():
cursor.execute("""CREATE TABLE IF NOT EXISTS users (
name TEXT,
id BIGINT,
wins BIGINT,
fails BIGINT
)""")
for guild in bot.guilds:
for member in guild.members:
if cursor.execute(f"SELECT id FROM users WHERE id = {member.id}").fetchone() is None:
cursor.execute(f"INSERT INTO users VALUES('{member}', {member.id}, 0, 0)")
else:
continue
connection.commit()
print("Бот зашёл")