R
R
Roman9212021-05-06 07:11:34
Python
Roman921, 2021-05-06 07:11:34

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

1 answer(s)
M
Maxim Nevzorov, 2021-05-06
@fixator10

https://discordpy.readthedocs.io/en/stable/faq.htm...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question