Answer the question
In order to leave comments, you need to log in
How to add coins to the balance every 24 hours?
It is necessary that every 24 hours users are added 5 coins.
The code:
balance = int(5)
db.addBalance(message.from_user.id, balance5)
def addBalance(self, user_id, balance):
with self.connection:
return self.cursor.execute("UPDATE `users` SET `balance` = ? WHERE `user_id` = ?", (balance, user_id,))
Answer the question
In order to leave comments, you need to log in
It is clear that the author did not bother to simply understand the code that he brought himself, it is necessary to correct the sql query in it
UPDATE `users` SET `balance` = `balance` + ? WHERE `user_id` = ?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question