T
T
TheGodOfThunder2020-10-05 23:16:53
Python
TheGodOfThunder, 2020-10-05 23:16:53

Python-telegram-bot how to make a timer?

Hello. This is how I recently started writing a bot for a telegram in python (python-telegram-bot library) and I want to do one such thing, for example, say a banana, so that when the user writes this word, the bot sends your banana increased by a "random number" and so that he can do it once every 24 hours. But I'm not very good right now, and if someone can help with this I will be very grateful!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
MagicMight, 2020-10-06
@MagicMight

Get in a DB the table from ID of the user, the current account and date of the last change.
When processing, check that at least 24 hours have passed since the date of the change, and in this case, increase the account by a random number

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question