Answer the question
In order to leave comments, you need to log in
How to update value in sqlte table?
The console swears only at this function:
(Yes, the code is written collectively, but it's easier for me)
@bot.command()
async def путешествие(ctx):
author = ctx.message.author
a = author.id
ran = random.randint(1, 1)
xp = c.execute('SELECT xp FROM test WHERE login == ?', (a,)).fetchone()
if ran == 1:
ranxp = random.randint(1, 3)
await ctx.send(random.choice(randomadvent))
await ctx.send('Получен опыт: ' + str(ranxp))
updatexp = xp + ranxp
c.execute('UPDATE test SET xp == ? WHERE login == ?', (updatexp, a))
sql.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