flaree / flare-cogs

Various cogs written for Red-DiscordBot
MIT License
76 stars 69 forks source link

Update f1.py - race_notification_check func added #188

Closed JohnBeres closed 1 year ago

JohnBeres commented 1 year ago

Original code didn't have a function to check whether or not it was a race day. This was something quickly generated by GPT-4 LLM. Please note: await asyncio.sleep(60) on line 482 has this action performing every minute. Adjust as needed.

Feel free to edit as needed, just figured folks would appreciate this working!

flaree commented 1 year ago

There's already code to support sending a notif for race day, I dont see the point in spamming a reminder every hour.

Also, I will not blindly accept any AI generated code. Specifically when it doesn't know Red and it's inner workings.

JohnBeres commented 1 year ago

Yea async def raceday_loop(self):. I'll close. But an interesting point, your function was never being called. Adjusted as shown and the raceday posts are occuring as intended.

flaree commented 1 year ago

its called every day at midnight UTC

I get the notifs properly, ill have another check soon. Note: all fixes will goto my dpy2 release and not what is currently available

JohnBeres commented 1 year ago

I was on the master branch, I'll switch over to dpy2 and use the original code to test. Thank-you!