chr-1x / hmh_bot

Python modules for the Willie IRC bot used in the Handmade Hero twitch chat.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bot intreprets "today" in UTC

chr-1x opened this issue · comments

Bot is inconsistent about tense, and since most of the rest of the bot is running in PST, schedule should behave the same.

Can you be more specific about where this is occurring, and what command is throwing this?

Happens when you use the !schedule command. The parsedatetime module is used to determine what the arguments mean -- if one of the arguments is "today", it will try to reflect that in the output datetime object. However, I think the function deals with it incorrectly, or parsedatetime doesn't know what timezone we're in, and so if you ask for it at any time after 4pm PST, it will give you the wrong date for "today". (to see this just do "!schedule today" after that time on a weekday, it will say "The stream will air tomorrow at <>")

It doesn't appear to be doing anything erroneous, I'm doing this at 9pm at night, and this is what I get back:

The stream should have aired today at 10 AM PST

Also, perhaps if there isn't anything scheduled for the upcoming thing, maybe it should say so, saying "next week's schedule has not been released yet, please check back or consult handmadehero.org/xxx" or something to that effect?

It may be related to the timezone of the computer the bot is running on. Was your test done locally?

The raspberry pi I have the bot on is in UTC, I think, and that may be why this issue is arising. I could just change the timezone, but I'd prefer that the behavior was invariant with deployment conditions.

This has been fixed with my PR (and I think it was fixed before then)