I have a script for a Twitter bot which will send out a Tweet every Friday, however I'm struggling to find a way to make keep it from killing the code if it is not Friday.
I have tried using a loop which does usually work for my Discord bot, but my 11pm brain didn't realise it was discord.py syntax until before I executed that. As a result, I can't think of anything else to try. I have looked over Google and the links to this site that Google gives but I can't find much that helps me.
Here is the code I am using:
for i in range(10000):
if date.today().weekday() == 6:
i += 1
print("Congratulating those who made it to Friday :D")
api.update_status(f"Week {i} of Congratulations Sailor, you made it to Friday!\nhttps://www.youtube.com/videoid")
print("Congratulated\n")
else:
print("not friday :(")
asyncio.sleep(10)
But that just constantly prints not friday :(
into the console for 10 seconds before killing the code and not trying again.
So any help would be appreciated. Also, I am sorry if I am missing something so simple, my 11pm brain isn't the best.
Thanks