0

I'm trying to create a command which allows the user to schedule a task to a specific time.

For example, when the command is used, the bot will wait until 2 PM then it will send a message (of course I don't want to make a time.sleep because the users won't be able to use the bot)

Do you know how could I code this ?

1 Answers1

0

You should consider using the python package 'schedule' for that.

It allows you to do things such as:

schedule.every().day.at("02:00").do(job)

Note that if you'd like to run your task only once, have a look at this section of the documentation: https://schedule.readthedocs.io/en/stable/faq.html#how-can-i-run-a-job-only-once

Roy2012
  • 11,755
  • 2
  • 22
  • 35