Answer the question
In order to leave comments, you need to log in
ctx command not working?
Which code does not work ctx command
@client.event
async def on_message(message):
if len(message.content) > 10:#за каждое сообщение длиной > 10 символов...
for row in cursor.execute(f"SELECT xp,lvl,cash FROM users where id={message.author.id}"):
expi=row[0]+50#к опыту добавляется число
cursor.execute(f'UPDATE users SET xp={expi} where id={message.author.id}')
connection.commit()
for row in cursor.execute(f"SELECT xp,lvl,cash FROM users where id={message.author.id}"):
if row[0] >= 500+(100*row[1]):
await message.channel.send(f'Новый уровень!')
set=row[0]-(500+100*row[1])
cursor.execute(f'UPDATE users SET xp={set} where id={message.author.id}')
lv=row[1]+1
cursor.execute(f'UPDATE users SET lvl={lv} where id={message.author.id}')
bal=row[2]+100*row[1]
cursor.execute(f'UPDATE users SET cash={bal} where id={message.author.id}')
connection.commit()
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