2021年3月18日星期四

Making a discord.py (rewrite version) timer based off of UTC time

So I want to add a timer based off of UTC time to refresh my API files that I download daily. I am using the rewrite version of Discord.py. This is how I made it below:

@client.event  # Updates API files daily  async def clock_timer():      from datetime import datetime      import pytz        datetime_utc = datetime.now(pytz.utc)        await datetime_utc.strftime("%H:%M:%S") == "03:00:00"      if datetime_utc.strftime("%H:%M:%S") == "03:00:00":          processes.api_grabber()  

Am I even doing this right?

Thanks in advance!

https://stackoverflow.com/questions/66701611/making-a-discord-py-rewrite-version-timer-based-off-of-utc-time March 19, 2021 at 10:06AM

没有评论:

发表评论