Answer the question
In order to leave comments, you need to log in
Does not ban the user on the discord server, how to fix it?
sqlite3 imported
Code:
db = sqlite3.connect('users.db')
sql = db.cursor()
sql.execute("""CREATE TABLE IF NOT EXISTS badusers (
userid INT
)""")
db.commit()
@client.event
async def on_ready():
print('bot connected')
@client.event
async def on_member_join(member:discord.member):
sql.execute(f"SELECT userid FROM badusers")
if sql.fetchone() is None:
print('пропуск')
else:
await member.ban(reason='Этот пользователь в черном списке бота(крашер или рейдер)')
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question