@client.event
async def on_ready():
print (f"Logged on as {settings['NAME BOT']}")
await client.change_presence(status=discord.Status.online, activity=discord.Game('Модерацию сервера'))
for guild in client.guilds:
print(f'Connected to server, id is: {guild.id}')
for member in guild.members:
cursor.execute(f"SELECT userid FROM users where userid={member.id}")
if cursor.fetchone() is None:
cursor.execute(f"INSERT INTO users VALUES (?, ?, ?, ?, ?)", (member.id, member.name, 1500, 0, 0))
else:
pass
conn.commit()
@client.event
async def on_member_join(member):
if cursor.execute(f"SELECT id from users WHERE id = {member.id}").fetchone() is None:
cursor.execute(f"INSERT INTO users VALUES (?, ?, ?, ?, ?)", (member.id, member.name, 1500, 0, 0))
conn.commit()
Не заносит подключившихся