Вот сам код:
import discord
from discord.ext import commands
import sqlite3
import config
from config import settings
from Cybernator import Paginator as pag
class MyClient(discord.Client):
async def on_ready(self):
print('Logged on as {0}!'.format(self.user))
client = commands.Bot(command_prefix = settings['PREFIX'], intents=discord.Intents.all())
client.remove_command('help')
connection = sqlite3.connect('server.db')
cursor = connection.cursor()
@client.event
async def on_ready():
cursor.execute("""CREATE TABLE IF NOT EXISTS users (
name TEXT,
id INT,
cash BIGINT,
rep INT,
lvl INT
)""")
for guild in client.guilds:
for member in guild.members:
if cursor.execute(f"SELECT id FROM user WHERE id = {member.id}").fetchone() is None:
cursor.execute(f"INSTERT INTO users VELUES ('{member}', {member.id}, 0, 0, 1)")
else:
pass
connection.commit()
print('Bot connected')
@client.event
async def on_member_join(member):
if cursor.execute(f"SELECT id FROM user WHERE id = {member.id}").fetchone() is None:
cursor.execute(f"INSTERT INTO users VELUES ('{member}' , {member.id}, 0, 0, 1)")
connection.commit()
else:
pass
client = MyClient(intents = discord.Intents.all())
client.run('TOKEN')
ВОТ ОШИБКА: